Skip to content

Commit

Permalink
rem implicit interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
zakirullin committed Oct 16, 2024
1 parent 2bccfb8 commit 3418bbd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,7 @@ This architecture was something that made intuitive sense at first, but every ti

> Do not add layers of abstractions for the sake of an architecture. Add them whenever you need an extension point that is justified for practical reasons. **[Layers of abstraction aren't free of charge](https://blog.jooq.org/why-you-should-not-implement-layered-architecture), they are to be held in our working memory**.
If you think that such layering will allow you to quickly replace a database or other dependencies, you're mistaken. Changing the storage causes lots of problems, and believe us, having some abstractions for the data access layer is the least of your worries. At best, abstractions can save somewhat 10% of your migration time (if any), the real pain is in data model incompatibilities, communication protocols, distributed systems challenges, and implicit interfaces.

> With a sufficient number of users of an API,
> it does not matter what you promise in the contract:
> all observable behaviors of your system
> will be depended on by somebody.
> [The law of implicit interfaces](https://www.hyrumslaw.com/).
**So, why pay the price of high cognitive load for such an architecture, if it doesn't pay off in the future?** Plus, in most cases, that future of replacing some core component never happens.
If you think that such layering will allow you to quickly replace a database or other dependencies, you're mistaken. Changing the storage causes lots of problems, and believe us, having some abstractions for the data access layer is the least of your worries. At best, abstractions can save somewhat 10% of your migration time (if any), the real pain is in data model incompatibilities, communication protocols, distributed systems challenges, and [implicit interfaces](https://www.hyrumslaw.com/). **So, why pay the price of high cognitive load for such an architecture, if it doesn't pay off in the future?** Plus, in most cases, that future of replacing some core component never happens.

Even though these layered architectures have accelerated an important shift from traditional database-centric applications to a somewhat infrastructure-independent approach, where the core business logic is independent of anything external, the idea is by no means novel.

Expand Down

0 comments on commit 3418bbd

Please sign in to comment.