Data class smell

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m
m
Line 1: Line 1:
 
The data class smell is present where a class has only fields, getters, setters and nothing else. It lacks the behaviours that make it a proper, stand-alone class (and consequently, the instantiated object).
 
The data class smell is present where a class has only fields, getters, setters and nothing else. It lacks the behaviours that make it a proper, stand-alone class (and consequently, the instantiated object).
  
== Refactoring methods ==
+
== Refactoring techniques ==
 
* [[Encapsulate Field]] - if there are public fields
 
* [[Encapsulate Field]] - if there are public fields
 
* [[Encapsulate Collection]] - if there is collections in the class. This is to ensure unmodifiable, read only collections is returned
 
* [[Encapsulate Collection]] - if there is collections in the class. This is to ensure unmodifiable, read only collections is returned
Line 10: Line 10:
 
* [[Code smells]]
 
* [[Code smells]]
 
* [[Keep related data and behavior in one place]]
 
* [[Keep related data and behavior in one place]]
 +
* [[Refactoring]]

Revision as of 12:22, 6 October 2008

The data class smell is present where a class has only fields, getters, setters and nothing else. It lacks the behaviours that make it a proper, stand-alone class (and consequently, the instantiated object).

Refactoring techniques

See also

Personal tools