Code Smell 301 - Database as Parameter
Passing databases creates accidental coupling and breaks business encapsulation
May 25, 20254 min read131

Search for a command to run...
Articles tagged with #databases
Passing databases creates accidental coupling and breaks business encapsulation

Accessing a database in domain objects is a code smell. Doing it in a constructor is a double smell

Primary keys, IDs, references. The first attribute we add to our objects. They don't exist in the real world. TL;DR: Reference objects with objects, not ids. Problems Coupling Accidental Implementation Bijection Principle Violation. Solutio...
