![cover-img](https://project-assets.showwcase.com/1420x/16381/1669644911390-1669644910551-robert-bye-BY34glOW7wA-unsplash.jpg?type=webp)
Code Smell 31 - Accidental Methods on Business Objects
28 November, 2022
6
6
0
Contributors
Problems
•
Readability
•
Coupling
•
Maintainability
Solutions
1.
Keep your objects clean.
2.
Decouple business objects.
3.
Separate accidental concerns: Move Persistence, Formatting, Serialization to special objects.
4.
Keep essential protocol using bijection.
Examples
•
Persistence
•
Identifiers
•
Serialization
•
Formatting
Sample Code
Wrong
Right
Detection
Exceptions
•
Tags
•
Conclusion
Credits
Simple things should be simple, complex things should be possible.