-1

I had go through Jason Taylor's link. He mentioned that

The Domain layer contains enterprise logic and types and the Application layer contains business logic and types. The difference is that enterprise logic could be shared across many systems, whereas the business logic will typically only be used within this system.

So what is the difference between enterprise logic and business logic?

5
  • The quote you reference explains the key difference. Enterprise logic can be shared across systems while business logic is that which typically resides in a single system. Think logging (enterprise) versus order management (business).
    – Dan Wilson
    Jul 20 '20 at 17:57
  • Thanks @DanWilson, kindly specifiy what are the samples for enterprise logic and business logic
    – Nest
    Jul 20 '20 at 18:01
  • 2
    My interpretation of clean architecture is that the domain layer contains all the business rules and the application service layer orchestrates the incoming command by fetching the relevant aggregate, invoking the correct method and persisting the new state. Uncle Bob talks about ‘enterprise wide business rules’ vs ‘application specific business rules’. I haven’t found a need for this distinction yet, maybe someone here has a good example.
    – Rik D
    Jul 20 '20 at 21:28
  • 1
    var loadedData = LoadDataFromDatabase() - Code calling this method and everything inside this method is enterprise logic. var price = CalculatePrice(loadedData) - code inside this method is business logic
    – Fabio
    Sep 17 at 4:30
3

Keep in mind that these terms are somewhat subjectively defined and can mean different things in a different context. This answer only applies to the current question's context.


Business logic is the catch-all term for logic that is part of the application's non-technical purpose, i.e. logic that exists not for a technical reason, but because it's part of the functional requirements. For example, if you refuse user access to your website if the user is under 18.

There is no technical reason why you ban people under 18. The reason this is done is due to "business reasons", i.e. it's something we want the application to do, because "the business" (which tends to mean the product owner and/or company) has asked you to do so.

Enterprise logic is much of the same thing, except that it is expected to be reusable across the company's many applications.

For example, if you're a bank, you might want to reuse the verification logic for credit card numbers across several of your applications. In that case, the credit card verification logic is enterprise logic.

Your bank might also have one application (no more) that generates loan contracts. therefore, the loan contract generation logic is not expected to be shared across applications, and therefore it is business logic, not enterprise logic.

0

Business logic leads to programming for a particular (business) application. It is "logic" that is peculiar to one business or company, and cannot be used by others (at least not without modification).

Enterprise logic pertains to how (computer) systems (as opposed to applications) work. Because of that fact, it can be shared by different businesses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.