ABAP Objects has appeared with the version 4.0. of R/3 and has never stopped maturing since that time. It has now reached a level that makes it a real object oriented programming language that is worth learning.
So if you are ready to see what this great technology is about, take a big breath and go on reading.
What is ABAP Objects
ABAP Objects stands for Object oriented ABAP. Compared to the traditional ABAP programming language, ABAP Objects represents an extension of ABAP that provides the language with the tools to support the object oriented programming paradigm.
What is object oriented programming?
To anyone who doesn�t know what object oriented programming is, the object orientation terminology might sound like it is yet another fancy concept that doesn�t serve any real purpose nor provide any real added value just like too many other concepts in computer sciences.
More recent than the traditional procedural programming model in which the source code is arranged in procedures to help achieve some level of modularity, the object oriented programming builds on the basics of the existing procedural programming model to propose a radically more sophisticated and comprehensive programming model.
This model lets the analyst-programmer implement complex systems made up of numerous objects linked together or not and control the interactions between these objects. This characteristic of the object programming language constitutes a definitive advantage other traditional programming techniques as it becomes much easier to solve complex problems.
As you have already understood, the notion of Object is at the center of the model. It is voluntarily a very general notion as its aim is to describe anything that has properties and functions. In this sense, the terminology object is not yet abstract enough because it bears some idea of concreteness while an object in the sense of object oriented programming might very well represent abstract things. In fact the notion of Object could have been advantageously replaced with the notion of Concept as the programming model we are going to see is able to manipulate any kinds of concepts and to make actual representations of them.
The object oriented programming model has three major characteristics. It assumes support for:
1. Encapsulation
2. Inheritence
3. Polymorphism
We are going to see in more details what these terms mean but keep in mind that these characteristics of object programming represent only the minimum key features that any object oriented programming language must implement. The object oriented programming is not limited to these characteristics. Also we are going to see here what these terms mean in a rather abstract way. We will become more concrete in the next sections of this article when you will have a better understanding of the key concepts of object programming.
1. Encapsulation
Encapsulation is the ability that an object has to contain and restrict the access to its members. We will see later that objects members may be either properties (data) or methods (functions) of the objects.
Encapsulation is a key concept of object programming that ensures the autonomy and integrity of the objects.
2. Inheritance
Inheritance is the ability of an object to inherit the properties and methods of an other object. We will come back to this later as you need to have a good understanding of what an object really is if you want to apprehend this concept. Keep in mind for the moment that inheritence is the ability offered to objects to inherit properties from other objects and to form hierarchies. This characteristic leads to the creation of families of objects (just like families exist for humans) with parent objects and child objects. In this configuration, it is clear that child objects inherit some characteristics from their parent object.
3. Polymorphism
This somewhat barbaric term designates the ability of objects to redefine properties inherited from their parents. In other words, a method of an object may have different implementations (behaviours or forms) depending on the object that implements it. This characteristic of the object oriented languages is an important asset to implement abstract concepts which often make sense only in specific contexts.