views:

586

answers:

12

I'm going through all sorts of WPF documentation, and I'm feeling unnecessarily confused. The term 'business logic' is scattered throughout it, as if everyone should know what it is.

I can see what business logic is, according to this question here: http://stackoverflow.com/questions/39288/what-exactly-consists-of-business-logic-in-an-application

But where did the term come from? Why is it called 'business logic' and not, say, 'core logic' or 'main algorithms' or any other more generic terms? Very few of the programs I write have anything to do with 'business logic', and when I think of 'business logic' I think of things handling credit card transactions, customer database maintenance, and the like. In other words, things that relate to a fraction of the entirety of computer science. When I write an imaging application, there is no 'business' involved, no customers, no money-based transactions, nothing of the sort. So saying that I have 'business logic' really confuses me, since I'm not conducting business, I'm processing images.

+15  A: 

For the same reason that the end of a gun which the bullets come out of is called the “business end”. It's where the primary action happens.

Jonathan Patt
Interesting interpretation. Very clever.
S.Lott
Yes, I like this interpretation.
mmr
Inspired by guns or ... man, I am on the wrong web site http://www.youtube.com/user/hotforwords#p/search/0/D3_h8eNgYrU
Hamish Grubijan
+12  A: 

If you were a professional graphic designer, there certainly would be business involved with using your imaging application - your job is your business!

So "business logic" refers to the parts of the code that define how the user conducts his business (in this case, manipulating images).

Don't forget that back in the day, all software was "business software" - no-one could afford the expensive equipment and skills required to write software for anything other than business purposes. It if didn't make money or save money for a business, it didn't get written.

RichieHindle
+1 for your second paragraph.
strager
by that definition, then the 'business logic' would be how the designer designs graphics, ie, the UI of how s/he manipulates images on the screen, rather than the actual implementation of, say, a noise reduction algorithm, or the logic that binds the algorithm to the interface. Is that what the term means? It's not the same answer that @Jonathan Patt gave or the answer marked as correct in the question I referenced.
mmr
@mmr: No, I don't think so. The UI is a largely unwanted abstraction between the user and the image. It's what happens to the image that the user cares about, not the UI.
RichieHindle
@RichieHindle-- saying that the UI is an 'unwanted abstraction' is like saying that using hands to paint a painting is an 'unwanted abstraction' from the final production of a painting. The UI defines how the user will use the program, especially in imaging, so it would seem to be extremely key to 'conducting business.'
mmr
@mmr: Absolutely, using your hands to paint is an unwanted abstraction, if you're painting for money. If a professional painter could make the painting appear on the canvas by an act of will, and save all that tedious messing about with brushes, he would. The key point about business logic vs. UI is that it's the end result that makes the money, not the UI mechanism by which you achieved that result. The UI is very important, because its job is to make the end result quick and easy to achieve, but it's not the "business", it's a means to an end.
RichieHindle
@RichieHindle: I guess this is where my confusion comes from. I'm not coding for the sake of 'business', but for 'results'-- in that sense, to me, 'results logic' would be a much better term.
mmr
@mmr: Sure. See my third paragraph - we're still using terms that were coined a long time ago.
RichieHindle
@RichieHindle: As I said below to @Simeon Pilgrim, to me, 'back in the day' in computing means 'space shuttle' and 'winning world war 2 with codebreaking'-- neither of which involve business, and when it was suspected that only the five richest kings of Europe could afford a computer (Simpsons reference). Almost all of my coding has been science related, even if it's the business of science, and never just for business' sake. That's why the term seems so limited to me.
mmr
@mmr: Fair point. I guess the accepted nomenclature of computing grew out of the business world rather than the scientific world.
RichieHindle
A: 

It is a term used mainly for Line of business applications & one more way people know of it is CRUD app (create, read, update, delete).

I think it means the class(es) contain the logic of how the business process works for given business process(es).

shahkalpesh
+1  A: 

The origin of the term is in business software, where business specific rules were separated in their own modules. That merely got transferred to all the other software.

DVK
Yeah, but why? There is a lot more to coding than business-specific rules.
mmr
The vast majority of pracising professional programmers are either writing software for a business, or, writing software which will be sold to a business.These may be highly technical programs but the end goal is to support a bisiness process. Even in the world of PCs there are far more Wintel machines owned and deployed by businesses than there are 'home' PCs.
James Anderson
+1  A: 

Thinking about early computer systems, like credit card processing, there are two large parts to the code, the parts doing the io, talking to the back-ends, tape, etc, and the parts doing the logic of the business, rules like, is the card valid, has the limit been exceeded.

Another way to think about it, it's the things a business person would say are the 'rules' to capture.

Simeon Pilgrim
When I think 'early computer systems', I think ENIAC, codebreaking, and the Space Shuttle being the 'perfect codebase' from a software engineering standpoint. Hardly anything to do with credit card transactions, except inasmuch as those transactions should be encrypted.
mmr
ENIAC is ancient, nearly pre-computing, when you consider what the word "computer" means today.
jmucchiello
But that's when Turing and the like were defining modern computing-- hence why that's why I think about those systems as 'early computer systems'
mmr
I think of those as first, precursor or calculation machines, for this answer I'm meaning early DEC,VAX, DP-x deployments type thing.
Simeon Pilgrim
+8  A: 

Not sure, but I think the term should be replaced with domain logic instead.

rick schott
+1  A: 

Business logic is that part of an application where "how" is should work is determined by someone other than the programming team. Usually it is the code that does what the customer wants to get done. The term generally only applies to in house software built for a non-IT group.

jmucchiello
Then why do I see it showing up for very generic documentation like for WPF? That's a framework that should be for any kind of app, not just in-house stuff and not just for business work.
mmr
Because obviously the writer of the documentation disagrees with you and think WPF is for business work. That is Microsoft's most common (highest paying) client type, is it not?
jmucchiello
+1  A: 

I think many times its sarcastic, because business logic is not always logical. its done certain way only, because business wants it that way - many times its not the best way. you can fight with them and (if youre lucky) make them see the light or just accept the fact that its business logic and be ready to change it when they realize they made mistake.

01
+2  A: 

You could have called it "core logic", but I believe that the first (well-known) multi-tiered apps were actually written for insurance or banking, hence the term "business logic". From there, the pattern took form, and the naming stuck.

Had the first multi-tiered apps been a research project or something, it probably would have been called "core logic".

Edward Robertson
A: 

I think I agree with DVK - IIRC, at the time, the whole Data->Logic->Presentation layer thing was an "enterprise" (basically: business) software buzzword.

Now that every goddamn web page should be three-tiered, it's much more common.

You also have to remember that while there's a lot of code other than business code, the amount of business code is huge, and a huge business (har har) as well. It's not really surprising that some terms originated there.

Eli Krupitsky
+2  A: 

When I write an imaging application, there is no 'business' involved, no customers, no money-based transactions, nothing of the sort. So saying that I have 'business logic' really confuses me, since I'm not conducting business, I'm processing images.

Furthermore, much of the advice about presentation and data starts going south too, as operations such as effects and filters which would be extras in a 'presentation layer' in a business application are the core of yours.

"Visualisation", "Engine" and "Persistent storage", are quite common names for the layers in the simulations I tend to work on. There's no problem using names meaningful in your domain. But then I get confused about all the job ads for SAS programmers, as that means something else in a UK defence setting; if you want to talk to business people you have to translate for them.

Pete Kirkham
Actually, most of those ads are for what you thought. The ability to successfully debug the firmware of a missile while rappelling from a helicopter is so rare they have to keep advertising them all over the place.
soru
A: 

Just like the pretty you goes to the bathroom to do your business, your pretty GUI goes to the logic to do its business..

(Sorry, couldn't resist :) )

cwap