Reputation: 4286
While I am trying to discerned the difference between the application logic and business logic I have found set of articles but unfortunately there is a contradiction between them.
Here they say that they are the same but the answer here is totally different.
For me I understand it in the following way:
If we look up for the definition of the Logic
word in Google we will get
system or set of principles underlying the arrangements of elements in a computer or electronic device so as to perform a specified task.
So if the logic is set of principles underlying the arrangements of elements
then the business logic should be set of principles underlying the arrangements of the business rules
, in other words it means the rules the should be followed to get a system reflects your business needs.
And for me the application logic is the principles that the application based on
, in other words, how to apply these rules to get a system reflects your business needs, for example should I use MVC or should not I use?, should I use SQL or MSSQL?, should I handle errors using exception handling or if statment?.
So please could anybody help me to get rid of confusion.
Upvotes: 6
Views: 3603
Reputation: 9966
"Application logic" (sometimes referred to as "work logic" in older literature), is the abstract of your source. It's closely tied to the implementation, and not necessarily to the real world problem it solves. "Business logic", on the other hand, is a higher level requirement list of what needs to be done.
For example:
Situation
You have a deck of cards and you want them in order.
Business logic step
"Sort the cards"
(As in, "we don't care how you achieve this, get it done")
Application logic steps
- Get the list of cards
- Apply a distribution sort
- Store results
Business logic tells you what needs to happen from an outcome point of view. "We need this and this". It's what you typically see in a specification document.
Application logic tells you what the program should be doing, from a data- and algorithm-oriented view. Business guys don't care about this, they need your cards sorted, don't bother them with details. But you need to plan how data arrives, what you do with it and how you pass it on. Application logic is what you see in code comments or dev documentations.
Upvotes: 1
Reputation: 197
Application Logic tells how an application is designed and developed. How you have maintained the standards through out the application. Usability, UI, Functionality etc are maintained throughout the application.
Business Logic is how a business is designed and implemented. What are the Business rules, Business Workflows.
Now a days, sometimes Business logic is adjusted as per application logic. And sometimes application logic is injected in Business logic to streamline each other.
SalesForce is an example.
Upvotes: 1
Reputation: 5697
Well there's going to be a few interpretations of this one, but here's mine.
Business logic is the rules that are in place whether your business is computerized or not.
Application logic is how a particular slice of that business is realised.
Take for example an insurance business offering multiple and complex policies. All the conditions, calculations, payment schemes, conditions of offer etc. are 'business rules'. A website that says "enter dob and income to get an instant estimate on our most popular products" would contain application logic as would a back office report for "top 500 earners that didn't buy". Each is an example of a specific use. Business rules apply but they are constrained and supplemented by other rules (like just these policies).
So typically business rules are rules, application rules are a subset selected and packaged for a purpose.
Upvotes: 5