You are on page 1of 9

Granby Colleges of Science & Technology

Ibayo Silangan
Naic, Cavite

BUSINESS LOGIC

College Department
ERRATA

Typo errors on the spelling and some addition/omission of words made by the
typist had been discovered after this booklet/module has been released.

Should you have any question, doubt, confusion; or if you need clarification on
any section/article /item, please feel free to see the Registrar’s Office.

Thank you.

DR. MERCURIO G. VILLANUEVA

Granby President
LESSON 1
I – READING

Business logic
is the programming that manages communication between an end user interface and a
database. The main components of business logic are business rules and workflows. A
business rule describes a specific procedure; a workflow consists of the tasks, procedural
steps, required input and output information, and tools needed for each step of that
procedure. Business logic describes the sequence of operations associated with data in a
database to carry out the business rule.
Business logic is a method of implementing a company's guidelines in their database
systems, allowing employees the ability to perform important work actions using a
computer.

Example
Business logic for a retail store might contain inventory information and can help track how
many products you sell in a specific timeframe. Business logic can also determine how to
calculate numerical data for varied purposes, including sales and tax information.

In computer software, business logic or domain logic is the part of the program that encodes


the real-world business rules that determine how data can be created, stored, and changed.
It is contrasted with the remainder of the software that might be concerned with lower-level
details of managing a database or displaying the user interface, system infrastructure, or
generally connecting various parts of the program.

LESSON 2
I – READING

Business logic:
 Prescribes how business objects interact with one another
 Enforces the routes and the methods by which business objects are accessed and updated
Business rules:
 Model real-life business objects (such as accounts, loans, itineraries, and inventories)
Business logic comprises:
 Workflows that are the ordered tasks of passing documents or data from one participant (a
person or a software system) to another.

 Business logic should be distinguished from business rules.


 Business logic is the portion of an enterprise system which determines how data is
transformed or calculated, and how it is routed to people or software (workflow).
 Business rules are formal expressions of business policy. Anything that is a process or
procedure is business logic, and anything that is neither a process nor a procedure is a
business rule. Welcoming a new visitor is a process (workflow) consisting of steps to be
taken, whereas saying every new visitor must be welcomed is a business rule. Further,
business logic is procedural whereas business rules are declarative.

Example:

An e-commerce website might allow visitors to add items to a shopping cart, specify a


shipping address, and supply payment information. The business logic of the website might
include a workflow such as:

 The sequence of events that happens during checkout, for example a multi-page form which
first asks for the shipping address, then for the billing address, next page will contain the
payment method, and last page will show congratulations.

There will also be business rules of the website:


 Adding an item more than once from the item description page increments the quantity for
that item.

 Specific formats that the visitor's address, email address, and credit card information must
follow.

 A specific communication protocol for talking to the credit card network


The web site software also contains other code which is not considered part of business
logic nor business rules:

 Peripheral content not related to the core business data, such as the HTML that defines the
colors, appearance, background image, and navigational structure of the site

 Generic error-handling code (e.g., which displays the HTTP Error Code 500 page)
 Initialization code that runs when the web server starts up the site, which sets up the system

 Monitoring infrastructure to make sure all the parts of the site are working properly (e.g., the
billing system is available)

 Generic code for making network connections, transmitting objects to the database, parsing
user input via HTTP POST events, etc.

LESSON 3
I – READING

Business logic could be anywhere in a program.


For example, given a certain format for an address, a database table could be created
which has columns that correspond exactly to the fields specified in the business logic, and
type checks added to make sure that no invalid data is added.

Business logic often changes.


For example, the set of allowable address formats might change when an online retailer
starts shipping products to a new country. Thus it is often seen as desirable to make the
code that implements the business logic relatively isolated, or loosely coupled.

This makes it more likely that changes to business logic will require a small set of code
changes, in only one part of the code. Distant but strongly coupled code also creates more
of a risk that the programmer will only make some of the necessary changes and miss part
of the system, leading to incorrect operation.

Tools and techniques


Business logic can be extracted from procedural code using a business rule management
system (BRMS

The business rules approach of software development uses BRMSs and enforces a very
strong separation of business logic from other code. User interface management
systems are another technology used to enforce a strong separation between business
logic and other code. The magic pushbutton is considered an "anti-pattern": a technique that
in this case creates undesirable constraints which make it difficult to code business logic in
an easy-to-maintain way.

Here are some key terms to learn for business logic:


1. Data Base - This describes categorized sets of data stored on a computer's
hard drive often using specialized software. Employees use databases to
access business logic for work objectives
2. Workflow - A word describing the steps required to complete an action using
data. Business logic workflows allow employees to perform a specific
procedure, like compiling different products a customer purchases.
3. Data Management Software - This describes software you can use to
manage data from multiple databases. It also transforms data into more
accessible formats for non-technical employees to use
4. Trigger - This word describes code in a workflow that generates after one
event in a workflow. For example, clicking on a person's name in payroll
software might trigger their payment information to appear on the screen.

Data validation

Data validation describes a careful process of maintaining accurate and high-quality data.
To use data validation in your business logic, you can create a testing procedure within a
database program to better ensure people can input the right data in the proper location.
For example, data validation can determine whether a person inputs the correct spelling and
format of street address data.

Here are some common types of data validation checks:

 Data Check -Inspects if an inputted line of data reflects a correct classification, like
text versus numerical data
 Length Check - Reviews whether the inputted data has the correct amount of
information, including whether it's too long for a certain bracket
 Range Check - Observes if number data fits within a pre-determined scope of
numbers and integers, like 10 to 100
 Data Order Check - To determine if the inputted data reflects a logical order, like a
package delivery date recorded after a customer ordered the time it carries
 Uniqueness Check - For observing whether a person inputs the same line of data
twice into the same program, which might cause certain errors to appear

ACID and business logic


When describing the properties of database transactions, many people refer to the acronym
ACID. Here are the definitions of each ACID term and how they relate to business logic:

 Atomicity - This property describes how a person changes multiple sections of data
with one action while accounting for all aspects of that data. For example, if a
customer purchases an item, the atomicity property shows that a transaction
removed that item from your inventory.
 Consistency - Like the aforementioned component of business logic, this property
highlights how a person can only change data under certain conditions. It also shows
pre-transaction data reflects an accurate post-transaction state.
 Isolation - This property describes how data used during a transaction is invisible to
some users until you complete it entirely, meaning another person cannot use it for
another transaction at the same time. For example, some banking applications only
allow customers to make one bank transfer per day to incorporate the isolation
property.
 Durability - After you complete a transaction, the durability property describes how
the data effects are permanent, meaning they can remain active if a database ever
malfunctions in the future. Conversely, it highlights how a database can restore itself
to a pre-transaction state if a malfunction occurs during the process.

- End -
BUSINESS LOGIC ACTIVITY SHEET
2021, second semester
Professor: Bernabe A. Vinzon Jr., MBA
Send to: jojo_vinzon@yahoo.com

NAME:________________________________ Course:____________________________

ACTIVITY IN LESSON 1
1. Draw a computer keyboard and try to use it as your 3D keyboard using all your
fingers, type the following:

“THE QUICK BROWN FOX JUMPS OVER THE HEAD OF THE LAZY DOGS!”

a. What finger did you use in typing the letter “A” _____________________
b. What finger did you use in typing the letter “J” _____________________
c. What finger did you use in typing the letter “O”
_____________________
d. What finger did you use in typing the letter “K” _____________________
e. What finger did you use in typing the letter “SPACE BAR” _____________________

ACTIVITY IN LESSON 2
1. If you logging-in using wrong information in an e-commerce website, what did you
notice most? Explain and give me your thoughts.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

2. Give me (5) rules in answering scripted telephone calls

1. _________________________________________________________________

2. _________________________________________________________________

3. _________________________________________________________________

4. _________________________________________________________________

5. _________________________________________________________________
ACTIVITY IN LESSON 3

1. Illustrate/Draw the flow of enrollment in Granby Colleges of Science & Technology.

A. __________________________________________________________________

B. __________________________________________________________________

C. __________________________________________________________________

D. __________________________________________________________________

E. __________________________________________________________________

2. Illustrate/Draw the process of Purchasing in e-commerce.

You might also like