G
GiJeet
Hello, just wondering, in the event model windows uses, they use an
argument wrapper class called EventArgs which you can subclass to
encapsulate all the arguments you need to pass to any eventhandler
method, so my question is, why is this model not used for pass
arguments to ALL methods? Why pass many individually typed arguments
to methods? Why not create our own MethodArgs class and wrap any
argument the method requires, this way we are only passing ONE
argument to methods - our class with any member we need to send to the
method.
And the method could just as easily return a MethodArgs class to pass
back any variables we need to manipulate.
It just seems so much more cleaner and MS is doing it with their event
model...
G
argument wrapper class called EventArgs which you can subclass to
encapsulate all the arguments you need to pass to any eventhandler
method, so my question is, why is this model not used for pass
arguments to ALL methods? Why pass many individually typed arguments
to methods? Why not create our own MethodArgs class and wrap any
argument the method requires, this way we are only passing ONE
argument to methods - our class with any member we need to send to the
method.
And the method could just as easily return a MethodArgs class to pass
back any variables we need to manipulate.
It just seems so much more cleaner and MS is doing it with their event
model...
G