developer 5 different company experiences manager of the great team always team member zİkrİye ürkmez linkedin.com/in/zikriye-urkmez-cengiz twitter.com/ZikriyeUrkmez github.com/zikriyeurkmezcengiz
logic that makes business-critical decisions enables a clear separation of concerns separate domain logic from other types of logic as it helps keep the overall code base simpler what is DOMAIN LOGIC APPLICATION LOGIC Resource: What is domain logic? · Enterprise Craftsmanship ** whether or not the code makes decisions that have a business meaning.
operations WHAT IS NOT? but first what Is domaın servıce? Vaughn Vernon, IMPLEMENTING DOMAIN-DRIVEN DESIGN Chapter 5 Implementing Domain-Driven Design : Vernon, Vaughn: Amazon.com.tr: Kitap
is not a natural responsibility of an ENTITY or VALUE OBJECT, add an operation to the model as standalone interface declared as a SERVICE. Define the interface in terms of the language of the model and make sure the operation name is part of the UBIQUITOUS LANGUAGE. Make the SERVICE stateless. Eric Evans Domain-Driven Design Domain-Driven Design: Tackling Complexity in the Heart of Software : Evans, Eric: Amazon.com.tr: Kitap The Ubiquitous Language is a shared language developed by the team—a team composed of both domain experts and software developers.
email Domain rule 1: We can only assign to the user an email that belongs to the corporate domain of that user’s company Domain rule 2: Before changing the user email, the system has to check whether the new email is already taken domain logic fragmentation alert!
user email Domain rule 1: We can only assign to the user an email that belongs to the corporate domain of that user’s company Domain rule 2: Before changing the user email, the system has to check whether the new email is already taken a pure domain model is a model that doesn’t reach out to out-of-process dependencies
user email Domain rule 1: We can only assign to the user an email that belongs to the corporate domain of that user’s company Domain rule 2: Before changing the user email, the system has to check whether the new email is already taken Domain model is pure and it is also complete From performance standpoint it is not practical
and writes to the edges of a business operation without much damage to application performance, choose this option and keep domain pure and complete. Otherwise, choose domain model purity over completeness. Vladimir Khorikov Domain model purity vs. domain model completeness (DDD Trilemma) · Enterprise Craftsmanship
loans To increase the efficiency of loan application processing automate application score calculation Domain rule 3: The loan monthly installment must not exceed 15% of the customer’s monthly income. Use Case: Domain rule 1: The customer age at the day of the last loan installment must not exceed 65 years. Domain rule 2: The property value must not exceed the requested loan amount. Applıcatıon servıce
not naturally belong to any entity or value object we have They are not part of the LoanApplication, nighter Loan, Customer or Property, therefore we created a separate class to represent the concept of rules and score calculation. Any changes here, like adding new rules, won’t require changes in the domain model. It is also an example of applying the single responsibility principle to our codebase. decıdıng domaın servıce
not the responsibility of any existing domain object first class citizen of the domain model choose domain model purity over completeness (there is no doubting that it belongs within the Domain Model) conclusion ** A Domain Service seems like a neat solution to a problem, but you can very quickly find yourself in a situation where you have robbed the domain logic from the very objects that need it most. ** If you see the DRY principle is violated or the application service becomes too complex, you need to probably introduce a domain service.