we are building a custom component which generates postings that are later dispatched to FI.
The component's customizing defines Posting Activities in different variants/versions that create those postings.
Every Posting-Activity-Variant is implemented by a dedicated class, all implementing a common Posting-Activity interface.
Usually I would use the BAdI-technique to register the classes for each Posting-Activity-Variant using BAdI-Filters.
However, in this case I have a certain aversion to BAdI-usage:
- 100s Posting-Activity-Variants, means 100s BAdI-Implementations and Filter-Definitions
*additionally* to the customizing of all these Posting-Activity-Variants
- There is customizing for every Posting-Activity-Variant, it is very tempting to add a classname-column and be done with it.
The customizing would be concise & understandable, I don't have to deep-dive into SE80/SE19 to check registered BAdI-classes and their filter-values to guess which BAdI would be called. I immediately see if the Posting-Activity-Variant is bound to an implementing class.
- We use OO extensively and defined interfaces irrespective of any BAdI-usage, so we don't really benefit from the BAdI's OO-approach.
Furthermore we would actually hide the BAdI-mechanism since BAdI-references are not normal pass-around OO-references.
So from a design perspective it doesn't matter if we use BAdI or customizing, it's hidden in some Factory anyways.
- We lose the static-registration and where-used functionality of BAdI-classes,
but I think that would be a price I am willing to pay to get a manageable & concise customizing.
We would work-around that with a dedicated report that lists all used classes etc.
- If using an old-school classname-column in the customizing, we would build a report that checks that customizing for sanity and checks the classes for the presence of certain interfaces/constructors/etc. Things which would otherwise be statically handled by the BAdI itself of course..
So what do you think, would you really *always* use the BAdI-technique to register classes?
Thanks for any advice.