Tag Archive 'valueobject'

This anti-pattern is about Using String instances all the time instead of more powerful objects. This is a special case of primitive obsession.
Examples
Here are some flavours of this anti-pattern:

String as keys in a Map: I have seen calls to toString() on objects just to use their String representation as a key in a Map: [...]

Many concepts look obvious because they are used often, not because they are really simple.
Small quantities that we encounter all the time in most projects, such as date, time, price, quantity of items, a min and a max… hardly are a subject of interest from developers “as it is obvious that we can represent them [...]