Description

The Functional Decomposition antipattern may occur if experienced procedural developers with little knowledge of object-orientation implement an object-oriented system. Brown describes this antipattern as "a `main' routine that calls for numerous subroutines". The Functional Decomposition design defect consists of a main class, i.e., a class with a procedural name, such as Compute or Display, in which inheritance and polymorphism are scarcely used, that is associated with small classes, which declare many private fields and implement only a few methods.

Detection Rules

RULE_CARD : FunctionalDecomposition {

RULE : FunctionalDecomposition {ASSOC: associated FROM: mainClass ONE TO: aClass MANY };

RULE : mainClass {UNION NoInheritPoly FunctionClass};

RULE : NoInheritPoly {INTER NoInheritance NoPolymorphism};

RULE : NoInheritance {(METRIC: DIT, SUP_EQ, 1, 0) };

RULE : NoPolymorphism { (STRUCT: DIFFERENT_PARAMETER) };

RULE : FunctionClass {(SEMANTIC: CLASSNAME, {Make, Create, Creator, Execute, Exec, Compute, Display, Calculate}) } ;

RULE : aClass {INTER ClassOneMethod FieldPrivate};

RULE : ClassOneMethod {(STRUCT: ONE_METHOD)};

RULE : FieldPrivate {(STRUCT: PRIVATE_FIELD, 100) };

};