12-19-2010 1:59 AM
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]
12-29-2010 8:18 AM
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
12-29-2010 4:13 PM
Hello Francois,
thanks for your answer!
I read through the book:
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