Overview of Object-Oriented Modeling
The basic concept of object-oriented modeling is to be able to combine data and functions that can be applied to this data into a so-called object; this is then globally encapsulated so that methods of foreign objects cannot intentionally manipulate this data. Object-oriented modeling uses the concept of classes to manage objects of the same type.
What Does Object Orientation Mean?
For the object-oriented consideration, the objects of the real world are objects that have an inner data structure and display a certain outward behavior. Software is no longer considered a group of functions that work on data structures, but instead as a collection of discrete objects that unify both the data structure and behavior in themselves.
Four properties characterize object orientation:
- Abstraction
- Encapsulation
- Polymorphism
- Inheritance
What is an Object?
Objects are things with a clearly defined data structure and a clearly defined behavior. Here we consider the unimportant properties abstractly and limit ourselves to what is important.
For example, if a money posting is to be shown as an object, then its characteristics (amount, type (external or internal) and its behavior (is made, is canceled) are described. In the object-oriented terminology, its characteristics are called "attributes" and the behaviors "methods". Objects can always be clearly differentiated, even with identical properties.
Communication between Objects
Objects can act on each other. So that they can act on each other, they exchange messages with each other. To process a message, an object can provide a corresponding operation. If an object cannot process a message, this is passed on to the super object.
Objects and Classes
A class combines objects with the same data structure and the same behavior. For example, all account objects can be combined to form an "account" class. A class is a template for describing objects with the same attributes and methods. A single account is one account from the group of accounts. In the object-oriented terminology, this is referred to as an instance of the "account" class.
Encapsulation
Encapsulation is understood as the hiding of implementation-related details of a class (how something was realized). Only the logical behavior of a class should be relevant. As a result, the realization of a class can be changed without having to modify the other classes.
Class Hierarchies
The defining of class hierarchies is one of the main advantages of the object-oriented procedure. In the process, complex facts are broken down into simpler ones, whereby higher-level structures are sought for different objects with common properties.
Two types of descriptions are available for describing the structure relationship between classes:
- Generalization (inheritance)
- Aggregation
Inheritance
Inheritance means that attributes and methods can be defined in classes on a higher level and inherited and used by classes on a subordinate level.
You can e.g. define a "posting" class with the subclasses "external posting" and "internal posting". Here the subclasses inherit the basic properties and the behaviors of their superclass (e.g. the attribute "amount" and the method "cancel"). However, they can also define additional ones, e.g. "bank code" for external postings.
Aggregation
Classes can have a "whole-part" relationship to each other. The whole (here an account) consists of the parts "account holder" and "bank account". This relationship between classes is referred to in object orientation as "aggregation" (a "consists of" relationship).
Object-Oriented Software Development
With the object-oriented approach, there is no clear separation between the analysis and the design phase.
In the course of a project frequent changes are made between the analysis, design and implementation phases. It is not mandatory to develop from the top down. This is called an iterative incremental procedure.
