Anyone have experience implementing DDD and Hex architecture with Python enterprise services?<p>I fell in love the abstraction patterns that Hex architecture and DDD provide, especially when upgrading a framework that only affected one layer (REST), or when any outside contract changes you only need to change the adapter or port interface layer since everything depends on Core but core depends on nothing.<p>I love the payoff and risk mitigation of using strong static typed languages for enterprise code and architecture but I recently took over a large Python Flask app. We need to start abstracting layers to replace a 3rd party service with a new one. For hex architecture to work I need to use dependency injection which looks like the main Flask app.py seems the place to wire those up but I don't think it can be enforced without strong PR controls and standards.
I learned a lot from this book:
- <a href="https://www.cosmicpython.com/" rel="nofollow">https://www.cosmicpython.com/</a><p>And was enforcing which layer can do imports from another layer using this tool:
- <a href="https://pypi.org/project/import-linter/" rel="nofollow">https://pypi.org/project/import-linter/</a>