SOLID, in plain words
Pinch or Ctrl+scroll to zoom; the text is selectable.
Source
·
TheYard
SOLID in plain words: Single Responsibility, Open / Closed, Liskov Substitution, Interface Segregation and Dependency Inversion, each with where TheYard shows it
SOLID, in plain words
Five habits that let code change without breaking.
S
Single Responsibility
Each class has one job, so it has only one reason to
change.
In TheYard
A bidding rule lives once, in Domain, and Program.cs is a short
list with one call per part.
O
Open / Closed
Add new behaviour by writing new code. Leave the code
that already works alone.
In TheYard
Cosmos DB arrived as new adapter classes behind the same ports
the SQL store uses.
L
Liskov Substitution
Anything that stands in for something else has to behave
the same way.
In TheYard
The same test suite runs against both stores, and a change that
touches either store has to pass on both.
I
Interface Segregation
Keep interfaces small and shaped to the code that calls
them.
In TheYard
The auction uses three small ports, not one repository that does
everything.
D
Dependency Inversion
Important code depends on contracts it owns, never on
the database underneath it.
In TheYard
Application declares IBidStore; each store implements it, and
startup wires the one in use.