Skip to content

Prefer Interface Segregation (Small, Focused Interfaces) ​

WarningClean ABAP & Modern Syntax#EC PREF_INTF_SEGREGRemote Enabled

Overview ​

Prefer interface segregation (small interfaces).

ATC Finding Message: Interface has too many methods; prefer interface segregation

Rationale ​

Fat interfaces force implementers to depend on methods they do not need and make test mock creation cumbersome. Break large interfaces into small, cohesive, role-based contracts adhering to the Interface Segregation Principle (ISP).

Non-Compliant ​

abap
INTERFACE lif_everything.
  METHODS: read, write, print, send_email, archive, validate.
ENDINTERFACE.

Compliant ​

abap
INTERFACE lif_reader.
  METHODS read.
ENDINTERFACE.
INTERFACE lif_writer.
  METHODS write.
ENDINTERFACE.

Configuration & Thresholds ​

This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:

Parameter NameData TypeDefault ValueDescription & Guidance
MAX_METHODSInteger5Maximum number of methods allowed in a single interface (Interface Segregation Principle, default: 5)

Suppression ​

To suppress findings for this rule, append the pseudo-comment to the statement:

abap
" Standard pseudo-comment:
... "#EC PREF_INTF_SEGREG

" SAP CI_ prefix format:
... "#EC CI_PREF_INTF_SEGREG

Technical Details ​

Released under the MIT License.