What is domain logic?

后端 未结 9 1765
时光取名叫无心
时光取名叫无心 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: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!

提交回复
热议问题