This blog entry is about architecture of ABAP applications. You can see it as part of my series about the ABAP package concept. The topic of this blog series is the following: How can we add new features like UIs to existing ABAP applications? How can we establish interfaces and make them explicit? From an abstract point of view it is about software structure. In my last blog I showed that SAP introduced new features that we can use to obtain a better software structure and refactor the package structure of old code. Now I discuss aspects of decoupling and an apropriate interface stategy for structure packages and the types of interfaces of structure packages: virtual default packages, filter packages and default interfaces (now called standard interfaces) with focus on the latter ones. The blog may be interesting for software architects of ABAP architectures who are familiar with ABAP package concept and want to take it to a new level: how can we develop little applications (think of Fiori-like apps) on top of an existing ABAP application (called “core”) considering following restrictions:
A typical example of those AddOns are Fiori Apps that SAP delivers as additional software components. Those software components are installable on top of the SAP software components like SAP_APPL for example. But you can also use those techniques for larger development task like Enterprise Extensions SAP developed in the past. I stole this picture from the SAP AAK documentation since it shows the principle of layered architectures very well. Please be aware that architectures with too many layers are very problematic in terms of software development, deployment and test. If I understand the slides from SAP, shown at DSAG events, describing the new digital core correctly, But I think the best solution is a low number of layers: take as much as necessary but not too much. If it is possible then you should try to get rid of not necessary layers because it is positive in terms of TCO.
Before I want to go into details I have to define the scope of this blog entry. Here I only want to discuss one aspect: How you define packages interfaces to define a proper API for the core development.
I am well aware of the fact the overall problem is far from being trivial. Just let me mention additional aspects that are crucial for AddOn development for the sake of completion:
Let’s get now back to the original topic of this blog entry. One major challenge is to define an API for the core. Those API should have following properties:
When I tried out encapsulation I encountered some challenges. The first one is easy: usually the core doesn’t have an explicit API consisting of packages interfaces, so you have to create one. But you also have to lock up the core against violations of the package interfaces and exactly therefore “default” package interface of structure packages can help you.
But at first I have to explain the challenge. Large ABAP development will consist of many ABAP packages in a hierarchy with a structure package at the top. The existence of structure packages is necessary for check mode R3ENTERPRISE (look at transparent table PAKPARAM). With this mode you can properly control dependencies to other structure packages and structure packages of SAP like SAP_ABA or SAP_BASIS f.e.
When introducing the package concept most people will start it in an evolutionary way. Therefore the development classes will be grouped into package hierarchies with structure packages at the top. Because usually there are many dependencies between packages of different structure packages most ABAP architects define so called virtual default and filter interfaces of structure packages. Those interfaces define a “carte blanche” for access unless there are restrictions defined by encapsulated packages. The following diagram makes this point hopefully easier to understand.
Virtual default interfaces are very useful if you start with the package concept. You don’t need to define interfaces in a “bing bang”-style and encapsulate everything and have the choice to encapsulate more and more development packages. The result of this is usually the following: especially older parts of your code will consist of not encapsulated packages. Newly created packages will be usually encapsulated and have proper interfaces.
The challenge is that you need to be able to encapsulate the core without introducing a proper encapsulation of all packages. The latter is often a very costly and an obstacle when building extensions. This is possible in above mentioned scenario. Just create a “standard package interface” of each structure package of the core like it is shown here:
The cool thing is that you can define a package interface of the structure package containing package interfaces, development objects from packages that are not encapsulated, but objects also from encapsulated that are not yet contained in package interface. The latter sounds weird, but it comes very handy if you start encapsulating ABAP core applications to establish a digital core with extensions built on top of it. You can just define a proper standard interfaces and reuse already existing interfaces, but you can also add single elements to them if you should need them. This is shown in the following picture.
So the mechanism of standard interfaces (in former times called default interfaces) allows you to establish quickly interfaces if you want to develop small AddOns like Fiori-apps (especially their OData services) and restrict the access to defined interfaces.
Please be aware of the following. Quickly providing and extending standard interfaces of structure packages for AddOns may leads to confusing and not to well-designed interfaces. So I recommend a governance process and to restructure those interfaces when it comes to a next major release. In my opinion you should not forget that the most important aspects:
In this blog you learned about the different types of interfaces of structure packages. As one application I mentioned the challenge of modern ABAP development:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |