Functional Decomposition
This anti-pattern is about missing definition of object-oriented design. The approach are replaced with a list of functionalities that process data structure as an input. Such anti-pattern is commonly seen in Pascal, Fortran, or C. This is commonly at application level.
Consequences
Consequences
- Large libraries of functions.
- Can be hard to maintain.
Symptoms
Symptoms
- When functions' name starts with a purpose, e.g. calculate_interest, display_table.
- Architecture so decomposed until each class/structure only has 1 function or 1 attributes.
- Did not leverage class/structure's inheritance and polymorphism nature = a lot of duplicated class definition (Very hard to maintain).
- No clear way of documentation.
- Frustration and hopelessness by testers.
Causes
Causes
- Missing proper architecture design / design was done by inexperience architect.
- Lack of object-oriented programming paradigm (technical debt).
- Lack of architectural enforcement.
- Specified disaster.
Fixing Recipes
Fixing Recipes
- Schedule refactoring time.
- Write a test suite to lock the current results and outcome.
- Design object-oriented architecture.
- Refactor source codes. Ensure the test results are consistent.