Рет қаралды 4,928
In this video, we will explore the power of domain services in Domain-Driven Design (DDD) and how they can help you tame the complexity of your domain. Domain services are a powerful tool that can be used to encapsulate complex business logic and keep your domain models clean and maintainable. We'll go over real-world examples of how domain services can be used to solve common problems in DDD and show you how to implement them in your own projects. Whether you're new to DDD or an experienced developer looking to improve your approach, this video will provide valuable insights and best practices for using domain services to improve the maintainability and scalability of your domain. We'll even go deeper into concepts like the role of the aggregate root, DDD value objects and much more!
Join this channel to get source code access and other perks:
/ @codewrinkles
Contents:
1. Intro: 00:00
2. App overview: 00:55
3. Challenge: calculating rating: 03:08
4. What about business logic that spans across aggregates? 03:52
5. First idea: squeezing it in the aggregates? 03:59
6. Bad idea: 07:44
7. Second idea: putting it in the handler? 08:25
8. No way! 09:48
9. Drum roll! Domain services FTW: 10:59
10. Implementing a domain service: 13:01
11. Should we add domain services to DI? 14:10
12. Don't use interfaces for domain services! 16:15
13. Transactional consistency: 17:45