Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Abstract vs. Concrete Classes. Can anyone tell me?
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00250219
Message ID:
00250227
Views:
14
Aiko,

An abstract class is one that will NEVER be used to create an object. Its main purpose in life is to define an interface (Methods and properties) for a whole group of subclasses. Abstract classes seldom have very much code in them, they are only defining the interface for the subclasses that will cotain the code.

A concrete class is one that IS intended to be used to create objects. Concrete classes often have a fairly large amount of implementation code in them.

Example: A form class heirarchy

fmrBase: Adds methods for MoveNext,MovePrevious, MoveTop, MoveBottom

fmrOneTable: Adds code to the above methods for moving when only one table is involved

fmrOneToMany: Adds code to the Move* methods to move the record pointer when a one to many relationship is involved

In this example, frmBase is an abstract class while frmOneTable and frmOneToMany are concrete classes.

The purpose of frmBase is to provide the interface design, that is the names of the methods and the parameters that they accept. By designing the class structure this way you insure that all forms will have the same set of methods so that your buttons and other controls can be coded to interact with the frmBase interface and they will then work in any form you put them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform