Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does anyone have trouble with this statement
Message
 
To
10/05/2004 14:44:19
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00902540
Message ID:
00902572
Views:
15
I think a template class can have great value. Consider the following situation. I have one set of classes that will access data from a database and another that will open files for editing. You can create a common interface for both with no code. For example,

oObject.Open()
oObject.Save()
oObject.Revert()

There might be no code associated with the class at this level because the two sets of classes are so different. Still, having a common interface is desireable for a number of reasons.

So, you might create a class tree something like this:
                   +-----------+
                   | EditSaver |
                   +-----+-----+
                         |
                         |
               +---------+---------+
               |                   |
               |                   |
         +-----+-----+       +-----+-----+
         |  FileEdit |       |  DataEdit |
         +-----+-----+       +-----+-----+
When you get down to the File/Data classes you might make the classes somewhat less abstract and more concrete.

Menachem


>Taking your thoughts to the end -how would your class be used. Again I come back to inherit an implementation rather than setting up some sort pattern/template....
>
>John
Menachem Bazian, CPA
President
BC Consulting Services, Inc.
973-773-7276
Menachem@BazianCentral.com
Previous
Reply
Map
View

Click here to load this message in the networking platform