We see small primitive data everywhere
TL;DR: Don't forget to model the smallest ones
Problems
- Primitive obsession
Solutions
find responsibilities for small objects in the MAPPER
Reify them
Context
Since computing early days we map all we see to the familiar primitive data types: Strings, Integers, Collections, etc.
Mapping to dates violates abstraction and fail-fast principles.
in the Wordle TDD Kata, we describe a Wordle word to be different than a String or Char(5), since they don't have the same responsibilities.
Sample Code
Wrong
public class Person {
private final String name;
public Person(String name) {
this.name = name;
}
}