in the discussion design, the professional vocabulary is flying, each person's technical background, the work experience difference will result in the understanding difference. Both the definition of SEI, the definition of OMG UML, and the definition of the great God are the differences from different perspectives. Prepare to pay attention to the differences in these definitions and open them up for discussion.
about ' business logic ', the domestic and foreign debate for many years (this article in 07 said there is no clear definition), a few more detailed discussion see the appendix (Must see the comments). My summary is divided into two main categories: one is the Logic department theory, the other is the data manipulation theory.
Logic Division Theoryfirst, this kind of view, the core is the emphasis on logic. In the business logic, the author defines the business logic in a narrow and broad sense, which is defined as follows:
business logic is a simple encapsulation of data access operations (obviously the second kind of view)The broad definition is as follows:
software products are composed of interface/interaction and business logic. Business logic is the core of a software product, but does not interact with the consumer.
The definition behind this broad sense has strength, a knife from the interface cut, one side of the interface, the other side is the business logic. However, this also echoes the definition of a foreign Daniel (what's business Logic anyway) to the effect that:the most precious core of an application is not dependent on a particular application. This is already a field-driven design perspective. The interface can be understood as the application's presentation layer, and the business logic is the core of the domain model, which represents the process, the public, the algorithm, the decision tree, the various methods, the query and so on.
Data Manipulation theoryThe data manipulation theory, with particular emphasis on operational data, is represented by wikis. First look at the definition of the wiki, a little bit of the taste of the middle route, it is clearly standing in the perspective of enterprise applications to define:manipulate data according to real business rules. (Original: In computer software, business logic or domain logic was the part of the program that encodes the Real-world business R Ules that determine what data can be created, displayed, stored, and changed.)
There is also the view that business logic needs to be understood from the definition of "business". From the requirements, business rules are the basic business requirements, including business management, operations, and processing of data. Implementations can be divided into application logic (application logic) and domain logic, which are business logic. The former is to deal with some non-core logic, such as ERP in the order number generation rules. The following is the core logic, such as the bill of materials to purchase Requisitions processing.
Another variant of this view attempts to correlate the business logic with the model in MVC/MVP. But in fact MVC/MVP's own design for presentation (GUI or console) is narrowly defined in the discussion of business logic. For some large applications, MVC/MVP may only be in the presentation layer.
Finally, there is a level of perspective issues. From the overall perspective of the application, and from a single level of view, so-called "business" is also different. So with the generalized theory, business logic becomes an all-encompassing concept. Then the concept itself becomes synonymous with
internal processing . The concept of business logic itself originates from the architectural design of enterprise applications and may not be suitable for the entire software domain. So, there are also many engineers who never talk about "business logic".
SummaryIt has been said that any universal concept, like nonsense. From the details of the software to the whole, there are countless different perspectives. A smooth discussion should start with a common perspective. Next time, if you are aware of the different understanding of business logic, what is the business and business logic that you define?
Reference:elaborate business logic (uml.org.cn)What's the heck is business logic anyway?What's the difference between application layer and business logic layer? (SO)What is business logic (degree Niang)
Welcome to study and discuss together!
[Architecture design] what is business logic