Chapter 1. ABAP Objects

In this chapter, we start with recipes for ABAP objects. This chapter is designed to provide useful recipes related to the storage of ABAP objects in shared memory and the database (persistent objects), as well as some useful design patterns. In this chapter, we will look at ways of:

  • Creating a shared memory object
  • Creating a persistent object
  • Creating classes based on factory methods
  • Creating classes based on singleton design pattern
  • Creating classes based on adapter pattern

Introduction

This chapter explores recipes related to ABAP objects. Two useful features of the object-oriented ABAP are storage options in the shared memory as shared objects, and in the database as objects of persistent classes. The details about both the prerequisites as well as the necessary steps needed to created shared memory-enabled objects and persistent objects will be discussed later in this chapter.

Moreover, design patterns are very important in object-oriented programming. In this chapter, we will see how to implement three of them using ABAP objects, namely the adapter, singleton, and the factory design. We will create a class with a factory method design. Later, we will show how this class may be modified in order to behave like a singleton class. Finally, we will see how an object of one class may be converted to that of another using an adapter class. The examples are kept simple in order to emphasize on the design pattern concept.

For this chapter, we assume that the reader has basic knowledge of the ABAP objects, and is familiar with the class-builder transaction.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.183.210