Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Saurabh Sharma
Saurabh Sharma

Posted on

     

Explain business logic like i'm 5

Top comments(4)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
nestedsoftware profile image
Nested Software
Simple things should be simple, complex things should be possible -- Alan Kay
• Edited on• Edited

Business logic is the code that implements the business rules for an application.

I tend to think of it as the "core" logic of an application. If you remove the code that is about how the user interacts with the application, (presentation logic), and you remove the code that has to do with I/O more generally (like persistence logic for example), the business logic is what is left over.

I use the term business logic even for non-business software. For instance, let's say you're building a video game, like pacman. The business logic would include things like the hunting strategies that the different ghosts use; how they behave when pacman activates a power pellet, or when they get eaten by pacman; the basic layout of each maze expressed as a data structure; score tracking; how many lives pacman starts with; what it takes to get an extra life, etc.

The business logic would not include the code that actually handles the joystick input, nor would it include the code that actually displays and animates the game.

In the original pacman game code from the 1980s, I suspect that the business logic code and all of the other code was probably mixed together, because computers in those days had very little memory and cpu. Nowadays, maintainability is more important, so we usually try to create separate modules of code across different concerns. So we'd have a module just for the business logic, then we'd have a separate module that handles the input, graphics, and animation.

CollapseExpand
 
steelwolf180 profile image
Max Ong Zong Bao
Max is a startup software engineer. He seeks to use what he has learnt as a startup founder and tech community leader to solves hard problems with innovate products or services.
  • Email
  • Location
    Singapore
  • Education
    Graduate student in Computer Science at Georgia Institution of Technology
  • Joined
• Edited on• Edited

"There is only one valid definition of business purpose: to
create a customer" Peter F Drucker

Everything surrounds it is to create a customer or maintain a great relationship with your customers who use your product or services.

It is the people who pay you directly or indirectly.

CollapseExpand
 
michaeltd profile image
michaeltd
Hey, I like computers and bikes.
  • Location
    Earth
  • Joined

You run a financial institution which issues bonds to investors.

The formula: assets / bonds = price is your business logic.

CollapseExpand
 
rhymes profile image
rhymes
Such software as dreams are made on.I mostly rant about performance, unnecessary complexity, privacy and data collection.
  • Joined

Everything that makes you, you

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Fullstack Web developer.
  • Location
    Delhi, India
  • Work
    Fullstack Web Developer at Codeword Tech
  • Joined

More fromSaurabh Sharma

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp