What is domain logic?

后端 未结 9 1749
时光取名叫无心
时光取名叫无心 2021-01-30 09:03

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?

相关标签:
9条回答
  • 2021-01-30 09:08

    Let's cover a scenario.

    You have a client for XYZ restraint and he wants you to make his system online.
    Where user can place an order online, track them, make payment etc.

    For a client point of view this system would be called Business Idea while "place order online" said to be one of the business process and if user place order online, client wants each detail of user, want to display it on screen etc said to be Business logic.

    Now you will model his business idea into your point of view in a way that your system can accomplish his all business process or his complete business idea said to be Problem Domain or Application Domain or Domain of your Application.

    Now you will first identify all the business processes. And identify entities or object to accomlish business processes. Those object said to be Business Obect or Domain Object and method or logic that implement business process like placeOrder said to be Domain Logic.

    So business logic is what client wants because its in client business domain and domain logic is how you implement it. because it's in your application domain.

    0 讨论(0)
  • 2021-01-30 09:10

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

    0 讨论(0)
  • 2021-01-30 09:11
    • Business logic is concerned with coordinating valid interactions between view and model (ui and data).
    • Domain Logic is about keeping an internally consistent model representation on both sides of the app (client and server).
    0 讨论(0)
  • 2021-01-30 09:14

    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)

    0 讨论(0)
  • 2021-01-30 09:16

    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 section of code built to perform one specific business process. So you would have business logic to take a reservation. Another bit of business logic would be code to refund cancelled tickets.

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

    0 讨论(0)
  • 2021-01-30 09:22

    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).

    0 讨论(0)
提交回复
热议问题