I got tired of writing "the domain layer must not import infrastructure" in a CONTRIBUTING file a...I got tired of writing "the domain layer must not import infrastructure" in a CONTRIBUTING file a...
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
I got tired of writing "the domain layer must not import infrastructure" in a CONTRIBUTING file and watching it get violated three sprints later.
So on my current backend the rule is a test. There is a whole tier of them - they scan the import graph and fail the build if the domain grows a dependency, if a layer reaches past its boundary, or if the planner gains the ability to execute anything.
The detail that took me longest to get right: each guard also fails if it scans nothing. A guard that silently matches zero files is worse than no guard, because it reports green forever.
Documentation describes intent. Tests enforce it. Only one of those survives a deadline.
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started