|
-
Jun 8th, 2006, 09:26 AM
#1
Thread Starter
Member
[2.0] Efficient or not efficient, what do you think?
Here's the setup.
1) Main Form
2) Options Form
3) Seperate class which handles effecting the main form's status based on the options that were changed.
The idea behind the code was to have 1 property that I could call, rather than writing duplicate code.
For example...
When I change an option in the options form, the main form will have changes that take effect (like the context menu showing the shortcut keys or not, etc.).
Now... the main form also needs to get that option when the initial main form loads (without modifying the options).
It's working fine, but it feels wrong to pass the main form directly to the class...
I wonder if it's more efficient to duplicate the code or continue with this class setup where I pass it the actual main form in addition to any other params?
-
Jun 8th, 2006, 07:02 PM
#2
Re: [2.0] Efficient or not efficient, what do you think?
In computers business we have a saying:
"If it works, don't mess with it"
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 9th, 2006, 07:04 AM
#3
Fanatic Member
Re: [2.0] Efficient or not efficient, what do you think?
If it ain't broke, don't fix it.
However, I'd probably do that by creating an option class, then give the main form a public method to recieve (receive?) that option class and make changes to itself. That way the main form takes care of handling the options for itself, and no other class needs to know specifics about the main form. (Note: I have no idea what kind options you are talking about... data? UI setup?) If you ever wanted to use that option class for a different or similar form, it may or may not want to use the selected options differently.
MHO.
-
Jun 9th, 2006, 10:00 AM
#4
Re: [2.0] Efficient or not efficient, what do you think?
 Originally Posted by JPicasso
If it ain't broke, don't fix it.
However, I'd probably do that by creating an option class, then give the main form a public method to recieve (receive?) that option class and make changes to itself. That way the main form takes care of handling the options for itself, and no other class needs to know specifics about the main form. (Note: I have no idea what kind options you are talking about... data? UI setup?) If you ever wanted to use that option class for a different or similar form, it may or may not want to use the selected options differently.
MHO.
MEO.
I'd do something like that too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|