Primitive obsession smell
From CSSEMediaWiki
(Difference between revisions)
JaninaVoigt (Talk | contribs) (New page: This smell occurs when a programmer uses primitives to represent a concept in the program rather than creating a small class for it instead. Creating a class to represent a concept means t...) |
m (→See also) |
||
(One intermediate revision by one user not shown) | |||
Line 2: | Line 2: | ||
If this occurs, you should [[Replace Data Value with Object]] or if there are several fields that should go together you should use the refactoring [[Extract Class]]. | If this occurs, you should [[Replace Data Value with Object]] or if there are several fields that should go together you should use the refactoring [[Extract Class]]. | ||
+ | |||
+ | == See also == | ||
+ | * [[Code smells]] | ||
+ | |||
+ | {{Template:CodeSmells}} | ||
+ | |||
+ | [[Category:Code smells]] |
Latest revision as of 09:33, 14 October 2009
This smell occurs when a programmer uses primitives to represent a concept in the program rather than creating a small class for it instead. Creating a class to represent a concept means that you can add behavior to it and group several data items together that belong together.
If this occurs, you should Replace Data Value with Object or if there are several fields that should go together you should use the refactoring Extract Class.
See also