Recently I am planning an internal training regarding Software engineering concept to my colleagues and one topic is “Interface Segregation”.
The following guideline is quoted from OODesign:
I am very curious whether SAP standard code contains such fat interface or not. So I wrote a small CDS view:
And get all interfaces which contains more than 10 methods:
DATA: lt_int TYPE STANDARD TABLE OF Zfat_Interface.
SELECT * INTO TABLE @lt_int FROM ZFAT_INTERFACE where method_count > 10 ORDER BY method_count DESCENDING.
The result is there are totally 3139 such interfaces in my CRM development system.
I quickly go through the list, most of them are used to build system functionalities and NO application will implement them, so in my opinion the fact is acceptable.
On the other hand there is also another category of interfaces which has NO methods or attributes defined. Refer to this blog Tag(Marker) Interface in ABAP and Java for more detail.