Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Factory pattern
Message
De
10/04/2011 17:09:41
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01506688
Message ID:
01506862
Vues:
85
>What is wisdom here, is there a "right" way of doing this, or is this just a preference what I like more?
>One thing I can imaging is that the latter solution violates the single responsibility principle, because the country class should not be made responsible for deciding which taxtable to use. But on the other hand, it is in the context of the country that the decision is done...

Does the procedure differ between tax tables for a given country? Does the behavior change so much that you need to have different code for each year?

If so, then go for country+year classes. If not, i.e. the logic changes only from country to country, then have only country classes and pass the year as a parameter, i.e. create the Aruba tax class, tell it to use 2009 data and that's it.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform