Skip to content

002_0004 - AvoidInheritanceFromNonSystem

Inherit from non System module is discouraged

Instead of inheritance, just use separate objects which are associated to the main object. As an alternative, you can add the child’s attributes to the super entity and add an ObjectType enumeration.

Metadata

authors:
- Xiwen Cheng <x@cinaq.com>
category: Performance
input: .*/DomainModels\$DomainModel\.yaml
rulename: AvoidInheritanceFromNonSystem
rulenumber: '002_0004'
scope: package
severity: MEDIUM

Description

Inheritance, except from system module, is strongly discouraged because of the negative performance side effects.

Remediation

Instead of inheritance, just use separate objects which are associated to the main object. As an alternative, you can add the child’s attributes to the super entity and add an ObjectType enumeration.

Test cases

# No test file found