← Graph

Eliminate Primitives With Value Types

takeaway 2 connections

Low-hanging fruit of DDD: wherever a primitive data type appears in domain code (string, int, bool with Hungarian notation), replace it with a value type — a shell around the primitive with a constructor that rejects illegal values and a to_string that yields readable output. Makes function signatures tell readers what business concept they expect and produces beautiful test output.

type
recommendation
takeaway Eliminate Primitives With Value Types
about
Value Object concept
Directly about value objects.
takeaway Eliminate Primitives With Value Types
from_talk
Explicit recommendation delivered in the talk's refactoring exercise.

Provenance

Read by
3 extractions