Overview
A Lazy Element is an element that does not do enough. If a method, variable, or class does not do enough to pay for itself (for increased complexity of the project), it should be combined into another entity.
Causation
This smell can happen due to the aggressive refactorization process in which the functionality of a class was truncated. It can also occur due to the unnecessary pre-planning - Speculative Generality - developer made it in anticipation of a future need that never eventuates.
Problems
Projects complexity increases with the number of entities.
Example
1class Strength:
2 value: int
3
4class Person:
5 health: int
6 intelligence: int
7 strength: StrengthRefactoring
- Inline Class
- Inline Function
- Collapse Hierarchy
Sources
- UPDATE2018 · ISBN 978-0134757681
- ORIGIN1999 · ISBN 978-0201485677