3 ms·
If your message contains framework-dependent data, it wasn’t decoupled. For example, in a typical web API, all the stuff concerning HTTP endpoints, JSON, OpenI
by fuzzy2 4y ago
If your message contains framework-dependent data, it wasn’t decoupled.
For example, in a typical web API, all the stuff concerning HTTP endpoints, JSON, OpenID Connect or whatever should be entirely separate from your domain logic. I’ve been doing this for years and it is very feasible.
Do you still have to write code where the framework dictates its structure? Absolutely. That’s the decoupling layer. Do you have to change this layer if you upgrade or switch frameworks? Also yes. However, you don’t have to touch the application core.
- berkes 4y agoI too have been doing the same. It's surprisingly simple and elegant. I prefer 'ports and adapters, aka hexagonal architecture', but there are many alternatives. This is what prompted me to write this article: the simplicity, elegance and maintainability of those codebases that had domain logic separated from delivery and storage mechanisms.