application logic vs business logic
Asked Answered
A

3

6

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.

Anlage answered 17/8, 2015 at 11:16 Comment(2)
This might be better suited for programmers.stackexchange.com (you should do a search there first, though, to make sure what you're about to ask hasn't already been explained in one or more existing answers).Lumbricoid
@Lumbricoid thanks a lot, I made a lot if search, but there is a contradiction among the answersAnlage
R
5

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.

Rockefeller answered 17/8, 2015 at 11:56 Comment(0)
J
1

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.

Jarrad answered 25/6, 2020 at 17:44 Comment(0)
I
0

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

Example 1

You have a deck of cards. Your business logic may contain a step like "sort the cards", focusing on the desired outcome, as in, "whatever you do at this point, the cards need to end up sorted". This makes sense from a business point of view.

Your application logic, on the other hand, will contain something like "use a distribution sort here", which is completely off topic for the business side (it only cares about the output), OR, your code may even do no sorting at all, for example because you store your cards with a bitfield where it's "already sorted". So the point is, a step on the business side don't necessarily correspond to a step in the app logic.

Example 2

You have an elevator. Business rules are like "if we're going downwards and someone below us presses the down button, we stop there". This is an algorithmic step, but from a human perspective. Your application gets this need as a requirement, and... well, in the case of an elevator, you'll need to know the speed, maximum deceleration, distance from caller floor, priorities, other elevator cars' position and a bunch of other factors, and you get a pretty complex app logic just to deliver that simple requirement. And still, both are algorithms. One for the purpose of elevators, and another for the horrible mess beneath. (I'm absolutely amazed by elevators and their software, btw.)

Inhabiter answered 19/10, 2021 at 8:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.