Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where does the OO go?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Where does the OO go?
Miscellaneous
Thread ID:
00222270
Message ID:
00222270
Views:
60
I created a class to process 'Work Order Items'. Nothing special: quantity, item, price and total.

My class has a property for the alias, so it can work with several different alias. The class assumes that the field names are going to be the SAME in any alias that I use. This make the class very limited. Not as reusable as I would like.

Now, lets make the field names dynamic as well. I added 4 more properties to let the programmer specify the field names. Now everything needs to be defined in the properties and I lost all the visual stuff from VFP.

Now, to get the item name and item price I need to look another tables. Hum, here we have the same problem. The look up tables needs to have the same structure for all the instances that pretend to use this class (or I need to make everything a property to let VFP redirect at run time.)

Shouldn't I been working with objects and forget about the underlying structure (tables structures)? After all I can just add Load and Save methods to my classes and put there the table-specific code. That will make me an truly-OO guy. Well that also will make me lost a lot of the VFP database capabilities at some points (the code executed between the Load and Save methods - and there will be a lot of code.)

So, I have 2 options:
* Be truly-OO and lost VFP database capabilities
* Use VFP database capabilities and forget about reusability (true reusability)


Which one is the better? Why?
Hector Correa
Next
Reply
Map
View

Click here to load this message in the networking platform