Compare
Symptom
Human

A class that holds fields with getters and setters but no behavior — and consumers do all the operations on it externally.

Agent

A class whose surface is only getters and setters; all real behavior lives in consumers, scattered across files the agent must locate to reason about anything domain-meaningful.

Goal
Human

Behavior that belongs with the data lives on the class; the class becomes a real domain object.

Agent

Behavior that belongs with the data lives on the class; the agent loading the class finds the operations and invariants it expects, in one place.

Smellier version

class Address { street; city; zip; }
function format(a) {
return `${a.street}, ${a.city} ${a.zip}`;
}

Fresher version

class Address {
format() {
return `${this.street}, ${this.city} ${this.zip}`;
}
}
Example source: Illustrative example written for this site, not a quotation from any source.
Pressure
Human

Domain logic gets scattered to consumers; the class's data invariants aren't enforced; encapsulation is theater.

Agent

Domain logic scatters across consumers; the agent must search the codebase to find any operation; class invariants aren't enforced so the agent must defensively check them at every consumer.

Tradeoff
Human

Pulling behavior onto the data class can create circular dependencies (the class now needs collaborators the original consumers had); the migration touches every consumer that did the work externally.

Agent

Migrating behavior onto the class can pull new collaborators into its definition; consumers shrink but the class's surface grows and its dependencies multiply.

Relief
Human

Invariants are enforceable; consumers write less domain plumbing; tests target the class itself.

Agent

Invariants are enforceable in one place; the agent reasons about the class as a real domain object instead of chasing operations across consumers.

Trap
Human

Attaching every operation that touches the class onto the class — including operations that genuinely belong to a use case, a service, or a different domain — turns the data class into a god object.

Agent

Attaching every operation that touches the data — including ones that belong to use cases or services — turns the data class into a god object the agent must load to reason about anything in the surrounding domain.