Primitive Obsession Does Not Require Primitives

Primitive obsession is a problem because it results in duplicate code, poor cohesion, and poor coupling. What should be well-defined operations on some value become littered through the codebase and inextricably linked with other operations. Although this is commonly the result of using built-in language primitives where a more domain-related type would do, that’s not the only way to get there.

If you’ve got an object (class or struct, yours or from a library) with any of the following characteristics, you probably have a primitive obsesssion problem: Continue reading “Primitive Obsession Does Not Require Primitives”