Introduction to SAP Business Objects
Business object technology and business object programming are based on the concept of "business objects". Real world objects, for example an employee or a sales order, are modeled as business objects in business application systems, such as the R/3 System.
You can visualize the SAP Business Objects as "black boxes" that encapsulate R/3 data and business processes, thus hiding the details of the structure and implementation of the underlying data.
To achieve this encapsulation, the SAP Business Objects are constructed as entities with multiple layers:
Accessing Business Objects
As the graphic shows, the interface layer separates a Business Object's data and the applications and technologies that can be used to access it. To the outside, the SAP Business Objects reveal only their interface, which consists of a set of clearly defined methods. Applications can only access the Business Object data by the object's methods.
An application program that accesses an SAP Business Object and its data only needs the information required to execute the methods. Therefore, an application programmer can work with the SAP Business Objects and invoke their methods without having to know or consider the object's underlying implementation details.
The set of methods that is associated with a Business Object represents the object's behavior. When a method is executed on a Business Object, the method can change the object's internal state, that is, the object's data.
For example, one method that you can use on the Business Object "Employee" is to "check for the employee's existence".
All SAP Business Object types and their methods are identified and described in the Business Object Repository (BOR).
Introduction to the Business Object Repository
Introduction to BAPIs
Object Types and Object Instances
Each individual Business Object belongs to a specific object class, depending on the nature and general characteristics of the object. These object classes are called object types. For example, the individual employees working in an organization are all part of the "Employee" object type.
The object types are descriptions of the actual SAP Business Objects that can exist in R/3; that is, each individual SAP Business Object is a representation, or instance, of its object type. For example, the employee with the name Charles Jones and the employee number 1234 is an instance of the "Employee" object type.
When writing object-oriented application programs, application developers identify the object types that are to be used and operated on by their programs. At runtime, the application program accesses the specific instances of the defined object types.
When an instance of a Business Object is used by an application
program, the object instance responds only to the set of
characteristics and methods defined for its own object type. The
SAP Business Object types are defined by the following:
Inheritance and Polymorphism
One objective and the main benefit of object-oriented technology is software reusability.
The reuse of software code is achieved by deriving new object types from existing ones. When an object type is generated from an existing object type, the new object type is called the subtype and the existing object type is called the supertype. For example, the object type "Employee" is a subtype which has been derived from the supertype "Person". Note that "subtype" and "supertype" are sometimes referred to as "subclass" and "superclass".
A subtype inherits all the properties and methods defined for the supertype from which it descends, but can also have additional properties and methods. A subtype may also implement a different behavior for the methods inherited from the supertype. Polymorphism is the term used to describe when the same method triggers different types of behavior in different Business Object types.