Introducing:
- Object orientation basics
- Delphi Unit structure and project structure
- Delphis RAD generation: visual objects and events
Object Orientation (OO) can be seen from three different aspects: objects as independent entities, objects as derived entities, and objects as interacting entities.
Objects as independent entities
An object is a separate, self-contained, encapsulated entity, and the term encapsulation is important in OO. This means that an object has data that it can keep private from the outside world and that it has specific behaviour. It manipulates its data and implements its behaviour through its methods.Writing the code that defines an objects methods has many similarities with structured programming, and so uses many structured programming principles such as structured selection (If..then..else, Case) and repetition (While..do and For loops). In this module we assume that students are familiar with these concepts and so concentrate on principles that apply specifically to OO programming.
Objects as derived entities
Reuse is a very important consideration in OO programming. If some required operations or data storage already exist in one class, it is possible for another class to take advantage of these operations and data and so avoid recoding them. OO makes this second aspect, a classs derivation from other classes, possible through subclassing (using inheritance) and through composition, and can significantly reduce the amount of code one needs to write.Objects as interacting entities
The third aspect, the interaction between objects, depends on association and subtyping. If objects could not interact, they could not cooperate with each other to perform the various tasks required in a computer program. So the programmer creates associations (links) between objects to provide pathways for objects to send messages to one another. To allow these interactions to lead to different results under different circumstances, the programmer can use subtyping and polymorphism. Subtyping is when objects within the same hierarchy implement their common interface differently and is an important focus later in this module.There is considerable interleaving between these aspects. Object derivation and object interaction both use inheritance, which is directly supported in the programming language, and forms of object linking (association and composition), which are not directly supported by language constructs.

