What is domain logic? The Wikipedia page for domain logic redirects to business logic. Are they the same thing, and, if not, how do they differ?
The main difference between them is that domain services hold domain logic whereas application services don't. As we discussed in a previous post, domain logic is everything that is related to business decisions.
Domain-Driven Design(DDD) is a collection of principles and patterns that help developers craft elegant object systems. Properly applied it can lead to software abstractions called domain models. These models encapsulate complex business logic, closing the gap between business reality and code.
Business logic is the programming that manages communication between an end user interface and a database. The main components of business logic are business rules and workflows.
If you were a professional graphic designer, there certainly would be business involved with using your imaging application - your job is your business! So "business logic" refers to the parts of the code that define how the user conducts his business (in this case, manipulating images).
The domain is what you are modelling.
If you are modelling a business problem, they are the same thing.
If you are modelling something else, physics for instance, there is probably no business logic in your system, but the physics parts are still domain logic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With