Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to handeled cross-cutting concern in ABAP applicaton?

Former Member
0 Kudos

Hello,

I want to discuss how to handeled cross cutting concern like logging, authorisation and in some case persistence in an ABAP application.

In ABAP I see currenlty two approaches:

I. interface-based cross-cutting concerns resolution

Encapulate cross-cutting concerns via a interface and having a configuration manager which delivers a singleton on your cross cutting conerns aspect (-> authorisation)

II. event-based cross-cutting concerns resolution

Having an interace with an event and dynamically assign a event handler (-> logging)

In order to handeled cross-cutting I see two main factors which improve your code:

A. Business logic is free from cross-cutting concerns beside hocks to them

B. Depend on your deployment phase you adopt the application behaviour

Are the idea valid on handeling cross-custing concerns? Are there are other apporaches? Do you have concerns about cross-cutting conerns?

All the best,

Guido

reference: [http://en.wikipedia.org/wiki/Cross-cutting_concern]

2 REPLIES 2

franois_henrotte
Active Contributor
0 Kudos

the two approaches you talk about are related to Object Oriented ABAP

there are also the good old ways to handle cross-cutting concerns:

- using INCLUDE statement to reuse complete parts of code by inserting it in the program

- using subroutine pools

- calling generic function modules

- using logical databases

about the OO there are also

- calling global methods of generic classes, this avoids the need for a singleton

- calling methods of other objects passing "me" as parameter

0 Kudos

Hello Francois,

thanks for your answer!

I read through the book:

http://www.amazon.de/Official-ABAP-Programming-Guidelines-PRESS/dp/1592292909/ref=sr_1_1?ie=UTF8&s=b...

The first and very basic rule is:

+ Separation of concerns

Most of your prosposal are fully complaint to this rule.

I would you to recommed to buy this book.

It is not about naming conventions. It is about good ABAP.

All the best,

Guido