Sample classes
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
The class-based sample application consists of several class definition files and a procedure file. These files define several classes, an interface, and a procedure that drives the class-based application. The following is a description of the relationships among the classes, interface, and procedure, using unqualified names for the application classes and interface for readability:
|
The descriptions and code listings for these files follow.
CommonObj.cls
This is the top-level user-defined abstract super class that provides a common method and variable for storing time-tracking information. It also provides abstract definitions for a class event and event publishing method, and for a message handler method, all to be implemented by classes that inherit from it:
|
IBusObj.cls
This
interface is implemented by the following class, acme.myObjs.CustObj:
|
CustObj.cls
This
class extends acme.myObjs.Common.CommonObj to provide general
functionality for handling customers and is a super class for the acme.myObjs.NECustObj class,
which handles New England customers:
|
NECustObj.cls
This
class extends acme.myObjs.CustObj to handle New
England customers by overriding GetCustomerName( ) to return
the customer’s E-mail address along with their name:
|
HelperClass.cls
This class provides various support methods for other classes:
|
CreditObj.cls
This class provides a method for notification of customers who have exceeded their credit limit:
|
MsgObj.cls
This
class provides a common mechanism together with the MessageHandler( ) method
in acme.myObjs.Common.CommonObj for other classes to
store and report error information:
|
Main.cls
This is the class that initializes the environment for running all the other sample classes:
|
Driver.p
This
is the procedure that instantiates the sample classes to run with
two different sets of sample data, depending on the constructor
used to instantiate Main:
|