






International Sites:
|
|
Abstract Classes
Many classes are defined in OOP only in order to be able to derive other classes from them. Such classes are called „abstract classes".
The main reason for defining abstract classes is the possibility to avoid redundant programming and code by using abstract classes. On the other hand there is often another reason for abstract classes, dispositional in the conception and hierarchy of the classes.
Let us take the objects Puser and Pgroup as an example: Both classes could also be derived directly from the object PObject, but they spring from the common ancestor PObjectUG instead. The abstract class PobjectUG was established, because Puser and Pgroup have several properties and methods in common. Both objects have to check - for instance - if they are allowed at certain times or by certain IP addresses. This common properties are the reason for the abstract class PobjectUG, in which these common properties have been coded. Puser and Pgroup only contain the individual program code to enable the classes’ individual functionality.
In most cases it is not very useful to define an instance of an abstract class. An instance of PobjectUG, called – for instance - myPobjectUG, is not related with real data of the Portalsuite but contains solely general functions like, e. g., such for checking the IP address a. o. Ergo myPobjectUG doesn’t make much sense.
[Back] -
[Bookmark] -
[Optimized for Printing] - [Send by E-mail] - [Contact]
Copyright © 2000-2002 by Portunity GmbH (Germany) - All rights reserved.
|
|


Direct links to the new Portalsuite 2002:
- Productinfos
- Download
- Support overview
- Support forum
|