Backend developer with special interest in software design, architecture and system modelling. Trying to stay in a continuous learning mindset. Enjoy refactoring, clean code, DDD philosophy and TDD approach.
Nothing here yet.
My recommendations are: application services in Domain Driven Design: https://enterprisecraftsmanship.com/posts/domain-vs-application-services/ clean architecture in python: https://github.com/cosmicpython/book/blob/master/chapter_04_service_layer.asciidoc I have written also about a codebase structure and what is the application layer (service layer) here: https://jorzel.hashnode.dev/how-codebase-structure-shapes-system-predictability. Here is also code example how to implement it: https://github.com/jorzel/opentable
Thanks for your comment. I think that could be set of proper references to dive deep into the topic: "Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation" by Jez Humble and David Farley. This book covers various techniques for safely introducing changes, including gradual rollout, feature flags, and canary releases. "Release It!: Design and Deploy Production-Ready Software" by Michael T. Nygard. This book provides practical advice on how to design and deploy reliable and resilient software, including techniques for gradually introducing changes and mitigating risks. "Deploying Machine Learning Models: A Practical Guide to Building, Testing, and Managing Production-Ready Models" by Sayak Paul and Amit Chaudhary. This book focuses specifically on the deployment of machine learning models and covers techniques such as canary releases and A/B testing. "Testing in Production" by Cindy Sridharan. This article provides an in-depth exploration of the concept of testing in production, including the use of feature flags and canary releases. "Feature Toggles (aka Feature Flags)" by Martin Fowler. This article provides an overview of the concept of feature toggles and how they can be used to safely introduce changes
Maybe I have a useful example: https://github.com/jorzel/recruitment/blob/main/src/infrastructure/db/sqlalchemy/orm.py. This data field under StoredEvent could be a dataclass. Instead of using a mapper (and ORM), you can exploit raw SQL (or document insert/update procedure) within infrastructure repository implementation.
Hey Piotr, great stuff! However, I would like to disagree with some points of your article and maybe start a discussion :) In my opinion what is presented as a Domain Service is actually an Application Service. It is true that when you have logic corresponding to more than one aggregate you should have a Domain Service. But it only refers to domain logic. Using repositories, making external calls, and dispatching events are rather application logic where you orchestrate your business process (I have written about it here https://jorzel.hashnode.dev/different-types-of-application-logic if you are interested, also recommend this nice article: https://enterprisecraftsmanship.com/posts/domain-vs-application-services/). I think that your example of aggregate can be a little bit misleading. The purpose of the aggregate is to perform a change preserving consistency. However, in your example, there is no rule that is forcing you to put add_order logic into Customer . What invariants relating to Customer are protected by this aggregate?