Reputation: 3387
What's the difference between application layer and business logic layer? I kind of understand that business layer provides business specific services and application layer couples business services and provides services to the end user (Web Service, UI, etc). Am I right?
Upvotes: 72
Views: 44131
Reputation: 11
Business logic refers to the rules and procedures that govern a business, including things like pricing, discounts, inventory levels, customer eligibility, etc. Application logic, on the other hand, is the code that implements those business rules within a specific application.
The key difference between business logic and application logic is that business logic is all about the data inputs based on your business, while application logic is all about how the user interacts with the app. For example, business logic is concerned with calculating interest on a loan, whereas application logic is concerned with what happens when the user clicks the "Get pre-approved" button on a website.
Upvotes: 0
Reputation: 1645
In my head, the divide between Business and Application logic is this: Business logic manages data, Application logic manages users
—— from a comment here: https://www.bennadel.com/blog/2436-what-the-heck-is-business-logic-anyway.htm#comments_41200
Upvotes: -2
Reputation: 233237
That sounds about correct.
The business layer implements the Domain Model in a boundary-technology-neutral way. In other words, it doesn't depend on any particular UI or service interface-related technology, such as web libraries or windowing APIs. You should be able to consume the business layer from any type of application - web, rich client, web service, etc.
The application layer bridges the gap between the business layer and the boundary technology.
Upvotes: 76
Reputation: 31
in classic layering in Business Layer we have:
-Business Rules -Security -User Activity Loging -Transaction Management ...
Functional Requierment + NonFunctional Requierment = Business Code
in DDD Functional Requierment Like Business Rules and Business Logic Stay in Domain Layer And NonFunctional Requiement Like Security and User Activity Loging Stay in Application Layer
Upvotes: 3
Reputation: 134217
To summarize:
The application layer consists of those elements that are specific to this application. So that would contain the UI, back-end processing for the UI, and any bindings between the application and your business logic layer. In a perfect world, this layer would not contain any logic of the business domain.
The business logic layer (BLL) contains logic specific to the business domain. Also, if you are going to create a separate BLL, this layer should contain logic that could be used by other applications as well as this one. For example, a set of web services exposing a well-defined API. This de-couples the BLL from your application and allows you the flexibility to build other applications on top of it in the future.
Upvotes: 26
Reputation: 954
I think of it as infrastructure. Depending on the application, it can contain the plumbing for configuration, reporting, the UI shell, etc.
Upvotes: 0
Reputation: 2080
As I understand it the business layer is in charge of the business decisions AKA the logic involving the protocols of the client.
The application layer are the raw processes that have nothing to do with business decisions.
Upvotes: 3