Data class smell
From CSSEMediaWiki
Revision as of 10:31, 6 October 2008 by Johannes Pagwiwoko (Talk | contribs)
The data class smell is present where a class has only fields, getters, setters and nothing else.
Refactoring methods
- Encapsulate Field - if there are public fields
- Encapsulate Collection - if there is collections in the class. This is to ensure unmodifiable, read only collections
- Remove Setting Method - for fields whose values should not be changed
- Move Method or Extract Method - move method or extract method to move the behavior from the clients to data class