Rule 1 - Adhere to the SoC Principle [Official ABAP Programming Guidelines]

Official ABAP Programming Guidelines by Horst Keller and Wolf Hagen Thümmel

I am reading book “Official ABAP Programming Guidelines” by Horst Keller and Wolf Hagen Thümmel. Let me take some notes here. There are very important rules for your ABAP programs. Here is the fist one:

Rule 1 - Adhere to the SoC Principle

Adhere to the principle SoC. Model your application is a strictly service-oriented manner. Always separate the logic of the application layer from the logic of the presentation layer and the persistence layer and from the logic for the communication with external systems. Encapsulate the repository objects of the individual concerns in separate packages.

What is SoC? SoC means Separation of Concerns.

As it can be seen in the rule that an application has different layers:

  • Application layer (the functional logic)
  • Presentation layer (user interface)
  • Persistence later (database works, etc)
  • Communication with external systems

Basically you need to separate these layers and encapsulate their repository objects in separate packages. If you do that your programs will be:

  • more stable
  • easier to understand
  • easier to use
  • easier to transport
  • easier to maintain
  • easier to test

We are convinced that the quality of such programs cannot be improved just by adhering to naming conventions but that a paradigm shift is actually necessary to approach programming tasks.

Yes, you absolutely need some naming conventions for your programs, but also you need to focus on programming tasks to create excellent programs.

So to do that you can think of using subroutines, local variables etc. in ABAP programs; but it’s better to use local classes instead of subroutines. Even it’s best if you can create global classes instead of local classes. Get advantage of object-oriented approach and reusable philosophy.

Reference:

Tags: , , , , ,

Leave a Reply