123
Senior Member
The following video demonstrates how Premise's object-oriented architecture is used to good advantage. The video shows how inheritance and extension are used to enhance the capabilities of an existing Premise class.
Overview
If, at a later date, you enhance the LogMaster class, every class that inherits from it will be automatically enhanced. Neat.
Overview
- Premise contains an existing class called Pump. You can't (or shouldn't) alter its basic definition.
- We define a new custom class called PumpExt that has an extension relationship with Pump. In effect, PumpExt serves to extend the capabilities of the existing Pump class.
- LogMaster is a module that defines a new class called LogMaster. The LogMaster class defines the ability to log events to an MDB file.
- We let PumpExt have an inheritance relationship with the LogMaster class. In effect, PumpExt inherits all of LogMaster's capabilities.
- Pump is extended by PumpExt.
- PumpExt inherits from LogMaster.
- So Pump now has the capabilities of LogMaster.
If, at a later date, you enhance the LogMaster class, every class that inherits from it will be automatically enhanced. Neat.