views:

1719

answers:

8

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?

+2  A: 

Business logic specific to one particular field/area of expertise.

Brian Knoblauch
So is domain logic a subset of business logic? This seems to contradict jakber's answer if so.
Sydius
+8  A: 

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.

jakber
Is business logic a subset of domain logic? This seems to contradict Brian Knoblauch's answer, if so
Sydius
I wouldn't call Brian Knoblauch's answer incorrect, it is just a slightly narrower view of the concept. If you are building a CRM system, then your problem domain is CRM and your domain logic is business logic specific to the area of CRM.
jakber
+3  A: 

Domain is the world your application lives in. So if you are working on say a flight reservation system, the application domain would be flight reservations.

Business Logic on the other hand is a more discrete block of the entire Application Domain. Business Logic is usually a chuck of code built to perform one specific business process. So you would have business logic to take a reservation. An other bit of business logic would be code to refund canceled tickets.

The objects that support your business process then become your business objects!

Agile Noob
A: 

My domain is pharmaceutical. It deals in compartments, doses, differential equations, and statistics. If you want to call that my "business", then I guess it's "business logic".

Mike Dunlavey
+2  A: 

Domain logic applies to the problem domain, e.g. "order processing". Domain logic is about the entities you work with (the object model), and their relationships.

Business logic contains rules specific to your context, e.g. "orders from customers of group X are to be processed using discount Y when exceeding amount Z". Business "logic" is about encoding facts about your business (or the business of the customer who uses the program).

mfx
A: 

I would say the Business Logic is related to:

Any logic or association between entities in the Domain.

So how does a Student relate to a Class or a Student. How is a new Class created and how do you Register a Student for that Class

Anything to do with business rules, determining outcomes, services, events, processes, calculations, transformation and related data manipulations/creation.

I have found it hard to find good books/teachers to help structure domain logic. It's easy to structure the domain. But domain logic seems to me a place no one wants to go.

5x1llz
A: 

Business logic is teleological (concerned with how to achieve an objective) while domain logic is ontological (what exists, or the object model that's used to reason with)

VLostBoy