Contents > C: List of Design Rules > C.2 Interface Rules

C.2 Interface Rules

Rule: UnnamedCategory: Completeness
Severity: 1-highApplies to: all areas
Interface has no name.

Rule: UnusedCategory: Completeness
Severity: 1-highApplies to: all areas
The interface is not used anywhere.

The interface is not implemented anywhere, has no associations, and is not used as parameter or attribute type.

  • See also rule Unused for classes.


Rule: NotCapitalizedCategory: Naming
Severity: 3-lowApplies to: all areas
Interface names should start with a capital letter.


Rule: KeywordCategory: Naming
Severity: 2-medApplies to: design
Interface name is a Java or C++ keyword; find another name for it.


Rule: PubOpsOnlyCategory: Correctness
Severity: 1-highApplies to: all areas
The interface has operations that are not public.

All operations in interfaces must have public visibility.

  • This is a WFR of the UML.
  • Value returned: number of non-public operations.


Rule: PubAttrOnlyCategory: Correctness
Severity: 1-highApplies to: all areas
The interface has attributes that are not public.

All attributes in interfaces must have public visibility.

  • This is a WFR of the UML2.
  • Value returned: number of non-public attributes.


Rule: AttrOnIFCategory: Style
Severity: 3-lowApplies to: all areas
The interface has attributes or outgoing associations.

Interfaces can have attributes and outgoing associations since UML2.0. This rather appears to be a concession to certain component technologies, and should otherwise be avoided.

  • Suggested in [Oes04].
  • Value returned: number of attributes of the interface.