Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Factory pattern
Message
From
10/04/2011 17:09:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
08/04/2011 14:16:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01506688
Message ID:
01506862
Views:
84
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform