Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dependency Injection ... What is it?
Message
 
À
02/02/2009 16:51:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01378811
Message ID:
01378885
Vues:
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!

No, not really. If you're going to leave it on the form it's all in the same class, so there isn't much reason to pass it in as a parameter. I was just suggesting that if you really want to isolate all of this, it belongs in it's own class.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform