Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dependency Injection ... What is it?
Message
From
02/02/2009 16:51:05
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01378811
Message ID:
01378853
Views:
14
>In your case, it's probably even a better idea to extract out this code into it's own business object, then have the form call this class to do the calculation. That lets you do things like reuse this code on other forms, via the web, etc.

So, you'd advise passing in the parameter, even though it's in the same class (for now), so that if you did go back and extract the method out to a BO, at least most of the architucture for that design would already be in place. ???

I kinda like that approach, but it sure could look silly when you are passing in info that the method could easily get from the form. It is at least a hybrid approach until the method is moved out of the form and into a BO.

It does at least break the depency on what the form property is named. Well, actually it MOVES the requirement of know what the form property is named from the method out to every method that calls the target method. So, then I'm maintining many calling methods, when I could just concentrate it all in the called method. Rats! I still can't decide!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform