T
Tim Mulholland
We have a user control with several other controls on it. We then have a
bunch of functions in the user control that operate on those controls.
In order to allow the user to invoke those functions, we have a "Breakaway"
form with several buttons on it.
When the user clicks those buttons, we want to invoke the correspoding
functions on the user control.
Two suggestions were made:
1) One developer suggested raising events from the breakway form and hooking
them into the functions on the user control.
2) Another developer suggested just passing the user control (technically a
reference i suppose) as a parameter to the constructor of the breakaway
form, and making the functions public so that the breakaway form could call
them.
Everyone agrees that the second suggestion just "feels" wrong. Maybe its all
those CS classes we took back in college.
But it would be significantly less code to do that.
What are the benefits to #1 over #2? We can't see any in our implementation
currently, but it still "feels" better.
Or are we all smoking something and there aren't any?
Thanks in advance,
-Tim
bunch of functions in the user control that operate on those controls.
In order to allow the user to invoke those functions, we have a "Breakaway"
form with several buttons on it.
When the user clicks those buttons, we want to invoke the correspoding
functions on the user control.
Two suggestions were made:
1) One developer suggested raising events from the breakway form and hooking
them into the functions on the user control.
2) Another developer suggested just passing the user control (technically a
reference i suppose) as a parameter to the constructor of the breakaway
form, and making the functions public so that the breakaway form could call
them.
Everyone agrees that the second suggestion just "feels" wrong. Maybe its all
those CS classes we took back in college.
But it would be significantly less code to do that.
What are the benefits to #1 over #2? We can't see any in our implementation
currently, but it still "feels" better.
Or are we all smoking something and there aren't any?
Thanks in advance,
-Tim