Entitlements and balancing
-
Upload
abdulla-alshourbagy -
Category
Business
-
view
58 -
download
0
Transcript of Entitlements and balancing
ENTITLEMENTS AND BALANCING MANAGEMENT SYSTEM
ENTITLEMENTS AND BALANCING MANAGEMENT SYSTEM
1 | P a g e
Entitlements and Balancing
Management System
2 | P a g e
Contents ACKNOWLEDGMENT ................................................................................................................................... 4
Abstract ....................................................................................................................................................... 5
Introduction................................................................................................................................................. 6
The system business value ..............................................................6
The technologies we used are .........................................................6
Programming languages: Java ........................................................................................................... 6
Database programming: Oracle 11g ................................................................................................... 7
Oracle JDeveloper 12c and Oracle ADF ............................................................................................... 9
Oracle SQL DEVELOPER Data Modeler .............................................................................................. 10
The systems development life cycle (SDLC) ................................... 10
P A R T_O N E ............................................................................................................................................. 11
PLANNING PHASE ......................................................................... 11
Identify the project ....................................................................... 12
System Request ............................................................................ 12
Elements of the System Request Form .............................................................................................. 12
Feasibility analysis ........................................................................ 13
CREATING THE PROJECT PLAN ...................................................... 13
PROJECT SELECTION ................................................................................................................... 13
The Project Work Plan ...................................................................................................................... 14
Managing and Controlling the Project .............................................................................................. 14
SUMMARY ................................................................................... 15
P A R T_T W O ............................................................................................................................................ 16
ANALYSIS PHASE .......................................................................... 16
Requirements determination ........................................................ 17
The as-is system: ............................................................................................................................... 17
Requirements for the new system: ............................................... 17
The-to-be system: .............................................................................................................................. 17
Requirements Elicitation Techniques ............................................ 18
Interviews .................................................................................... 18
Interviewee: Eng. Walaa. .................................................................................................................. 18
Interviewee: Eng. Osama .................................................................................................................. 23
3 | P a g e
USE CASE ANALYSIS ...................................................................... 24
PROCESS MODELING .................................................................... 33
Data Flow Diagram ........................................................................................................................... 33
DATA MODELING.......................................................................... 34
Entity relationship diagram (ERD) .................................................................................................... 34
SUMMARY ................................................................................... 35
P A R T_T H R E E........................................................................................................................................ 36
DESIGN PHASE .............................................................................. 36
Moving into design ....................................................................... 37
Architecture design............................................................................................................................ 37
User interface design ......................................................................................................................... 39
Program design ............................................................................ 43
MOVING FROM LOGICAL TO PHYSICAL PROCESS MODELS ............................................. 43
The Physical Data Flow Diagram ..................................................................................................... 44
Data storage design ...................................................................... 44
SUMMARY ................................................................................... 74
P A R T_F O U R .......................................................................................................................................... 75
IMPLEMENTATION PHASE ............................................................ 75
Moving into Implementation ........................................................ 76
Introduction to Development Cycle .................................................................................................. 76
3-Build Application Business Services (Create Model step in MVC) .............................................. 77
4. Design Application Flow (Create Control step in MVC) .............................................................. 88
5. Design Pages ................................................................................................................................. 89
6. Implement Business Logic (Validation Rules) .............................................................................. 93
Transition to the New System ....................................................... 94
System Interface ................................................................................................................................ 94
System outputs ................................................................................................................................ 105
System Security ............................................................................................................................... 110
SUMMARY ................................................................................. 124
4 | P a g e
ACKNOWLEDGMENT
At the outset we thank ALLAH, Almighty God, who helps us in the preparation of this project, wishing to be a valuable project in the process of the management of Entitlements and Balancing department. Our thanks and appreciation for: Dr. Nissreen El-Saber Our thanks and appreciation for: Eng. Mahmoud Mahdy Teaching assistant in Faculty of Computers and Informatics Our thanks and appreciation for: Eng. Samar Lotfy Teaching assistant in Faculty of Computers and Informatics Zagazig University, for providing us support for the success of this project.
Special thanks to Our Parents for the good sponsorship paying us all their
attention and all means of comfort. May Allah blessing them and provide them
with health and wellness.
5 | P a g e
Abstract In many organizations there're a lot of mistakes that happen in financial processes
(e.g. Differences in lows that used to calculate the salaries of employees and the
processes that the salary pass to calculate the final salary of an employee)
And for employees (e.g. adding new employees, calculate salaries, assign them to
absence, insurances, get the job state of each employee, produce reports, archive
data) are still done in manual way between employees which take large time.
Roles of employees and procedures that they are following in doing the work
changes to far dimension so The procedures need to develop to finish the work
with minimum time.
With evolution in information, manual work becomes outside the control and
environment of work today changes from the past. Manual work has many
disadvantages.
So Entitlements and Balancing system is appearing which helps employees in
many things. Its Goal is to store information, make it available to doing difficult
work with higher speed, retrieve information at any time.
Results show that a consistently better efficiency can be achieved in the following
benefits Eliminating the need for a larger staff, less storage space is required for
data, Copies of data can be easily transferred for safekeeping in case of fire or
other emergency, Multiple people can be updated simultaneously in the event of
schedule changes, save time and effort that wasted in doing routine operations,
Increase performance of organization.
6 | P a g e
Introduction Entitlements and Balancing is considered an essential part of the Administrative
Affairs and Financial Affairs for all employees in any organization regardless of
their function.
The system business value Facilitate the work with the Administrative Affairs.
Facilitate the work with the Financial Affairs.
Organize the data of all employees.
The technologies we used are Programming languages: Java
It is a programming language and computing platform first released by
Sun Microsystems in 1995.Java is a programming language expressly
designed for use in the distributed environment of the Internet. It was
designed to have the "look and feel" of the C++ language, but it is simpler
to use than C++ and enforces an object-oriented programming model.
Java can be used to create complete applications that may run on a single
computer or be distributed among servers and clients in a network. It can
also be used to build a small application module or applet for use as part
of a Web page. Applets make it possible for a Web page user to interact
with the page.
Why java?
Because Java™ has significant advantages over other languages and
environments that make it suitable for just about any programming task.
The advantages of Java are as follows:
1. Java is easy to learn.
Java was designed to be easy to use and is therefore easy to write,
compile, debug, and learn than other programming languages.
2. Java is object-oriented.
This allows you to create modular programs and reusable code.
3. Java is platform-independent.
One of the most significant advantages of Java is its ability to move
easily from one computer system to another. The ability to run the
same program on many different systems is crucial to World Wide
Web software, and Java succeeds at this by being platform-
independent at both the source and binary levels.
Because of Java's robustness, ease of use, cross-platform capabilities and
security features, it has become a language of choice for providing
worldwide Internet solutions.
7 | P a g e
Database programming: Oracle 11g
- (Commonly referred to as Oracle RDBMS or simply as Oracle) is an
object-relational database management system or ORDBMS (ORDBMS
is a database management system (DBMS) similar to a relational
database, but with an object-oriented database model: objects, classes and
inheritance are directly supported in database schemas and in the query
language) produced and marketed by Oracle Corporation.
Why Oracle 11g? Because it has a lot of features rather than previous versions. This features
are:
Database Replay
Explore Database Replay, the new tool that
captures SQL statements and lets you replay them
at will.
Partitioning
Learn about Referential, Internal, and
Virtual Column partitioning; new sub-
partitioning options; and more.
Edition-Based Redefinition
It's revolutionary: Patch or update your
application's data objects while the application
remains in uninterrupted use (in Release 2 only).
Schema Management
Add columns with a default value easily
and explore invisible indexes, virtual
columns, and read only tables.
Patching and Upgrades, RAC One Node, and Cluster ware
Learn how to enable a single name for the cluster,
enable HA for a single-instance database, place
OCR and voting disks on ASM, and more (in
Release 2 only).
Data Warehousing and OLAP
Get a tour of new features in these areas,
including Cube Organized MVs, a new
Analytic Workspace Manager, Query
Rewrite extended to subqueries and
remote tables, and more.
PL/SQL Performance
Explore in-lining of code, "real" native
compilation, PLS timer, use of simple integer, and
more.
PL/SQL: Efficient Coding
Triggers that fire several times at
different events and ability to force
triggers of the same type to follow a
sequence are some new gems.
Transaction Management
Get an introduction to Flashback Data Archive and
explore Enterprise Manager's LogMiner interface.
Security
Learn about Tablespace Encryption,
case-sensitive passwords, data masking,
and other features.
8 | P a g e
SQL Performance Analyzer & Real-Time SQL Monitoring
Learn how to accurately predict changes on the
actual SQL statements issued against your
database - plus, monitor SQL performance in real
time.
Oracle Exadata Simulator
Predict how your statements will behave
in Oracle Exadata Database Machine
using any Oracle Database 11g Release 2
EE database (using SQL Performance
Analyzer).
SQL Plan Management
Use bind variables that pick the right plan every
time and ensure a new execution plan is perfect
before it's used.
Manageability
Explore automatic memory management,
multicolumn statistics, online patching,
and more features.
SQL Access Advisor
Get advice about optimal table design based on
actual use of the table, not just data.
SQL Operations: Pivot and Unpivot
Present information in a spreadsheet-
type crosstab report from any relational
table using simple SQL, and store any
data from a crosstab table to a relational
table.
Backup and Recovery
Explore Data Recovery Advisor, do parallel
backup of the same file, create and manage virtual
catalogs, and un drop tables paces.
Resiliency
Explore Automatic Health Monitor,
Automatic Diagnostic Repository, and
other new resiliency features.
Automatic Storage Management
Learn about new SYSASM role, variable extent
sizes, and other ASM improvements.
Compression
Support for data compression is nothing
new in Oracle Database, but 11g takes the
concept to a new level with Advanced and
Hybrid Columnar Compression.
Caching and Pooling
Explore SQL Result Cache, PL/SQL Function
Cache, and Database Resident Connection
Pooling.
Data Guard
Query the physical standby database in
real time without shutting down recovery,
just for starters.
Secure Files
Explore next-generation LOBs: LOB encryption,
compression, deduplication, and a synchronicity.
And Don't Forget...
COPY command, Export/Imports, Data
Pump and SQL*Plus improvements,
Scheduler email notification, and more.
9 | P a g e
Oracle JDeveloper 12c and Oracle ADF
- Oracle JDeveloper is a free integrated development environment that
simplifies the development of Java-based applications addressing every
step of the application lifecycle. JDeveloper offers complete end-to-end
development for Oracle's platform and Oracle's applications.
- Oracle ADF is an end-to-end Java EE framework that simplifies
application development by providing out-of-the-box infrastructure
services and a visual and declarative development experience.
Why JDeveloper and Oracle ADF?
1. JDeveloper has a lot of features and benefits. We will present the
key features and benefits:
KEY FEATURES
i. Cover full development life cycle
ii. Visual and declarative development
iii. Create Applications based on standards
iv. Integrated development framework
v. Choice of development style
K EY BENEFITS
vi. Increase developers' productivity
vii. Create better applications
viii. Simplify your tooling portfolio
ix. Create open and standard based applications
2. Oracle ADF has a lot of features and benefits. We will present the
key features and benefits:
KEY FEATURES
• Based on industry standards
• Full model-view-controller implementation
• Rich web, mobile and desktop UIs
• Focus on reusability
• Visual and declarative development
• Integrated security and customization
KEY BENEFITS
• Speeds up application development
• Protects from technology shifts
• Increase reusability across applications
• Create open and standard based applications
10 | P a g e
Oracle SQL DEVELOPER Data Modeler
- Oracle SQL Developer Data Modeler is a free graphical tool that enhances
productivity and simplifies data modeling tasks. Using Oracle SQL
Developer Data Modeler users can create, browse and edit, logical,
relational, physical, multi-dimensional, and data type models.
- Why Data Modeler?
Because it provides forward and reverse engineering capabilities and
supports collaborative development through integrated source code
control. The Data Modeler can be used in both traditional and in Cloud
environments.
In the next parts we will introduce the phases of our system which divided into
four phases
Planning phase
Analysis phase
Design phase
Implementation Phase
Which also consider the system development life cycle.
The systems development life cycle (SDLC) System development life cycle is the process of determining how an information
system (IS) can support business needs, designing the system, building it, and
delivering it to users.
Planning Focus: Why build this system? And How to structure the project?
Primary outputs: System request with feasibility study and Project plan
Analysis
Focus: Who, what, where and when for this system?
Primary output: System proposal
Design
Focus: How will this system work?
Primary output: System specification
Implementation Focus: Delivery and support of completed system
Primary output: Installed system
11 | P a g e
P A R T_O N E
PLANNING PHASE
Is the fundamental two-step process of understanding why an information
system should be developed and creating a plan for how the project team will
develop it ?The deliverables from both steps are combined into the project
plan, which is presented to the project sponsor and approval committee at the
end of the Planning Phase. They decide whether it is advisable to proceed with
the system development project.
OBJECTIVES
Identify project.
Develop systems request.
Analyze technical feasibility.
Analyze economic feasibility.
Analyze organizational feasibility
Creating the project plan
12 | P a g e
Identify the project Entitlements and Balancing is considered with the Administrative Affairs and
Financial Affairs for all employees in the Organization regardless of his/her
function.
System Request Is a document that describes the business reasons for building a system and the
value that the system is expected to provide. Elements of the System Request Form Project Sponsor
Faculty of Computers and Informatics-Zagazig University.
Department of Entitlements and Balancing.
Business Need Improve access to information.
Streamline supply acquisition processes.
Reduce the wasted power in writing.
Replace the paper system into an information system.
Business Requirements Produce management reports.
Produce reports about Administrative and Financial Affairs for all
employee in the organization.
It's a web based system.
Include data search capabilities.
Include reports generate capabilities.
Business Value Facilitate the work with the Administrative Affairs.
Facilitate the work with the Financial Affairs.
Organize the data of all employees.
Special Issues or Constraints Meetings will not available permanently because the team isn't
from one department.
This a graduation project and we have a deadline to finish it.
The system lower costs The old system that used right now is a paper written system.
The old system waste money and human power in written.
The new system will be computer digital system that will lower
costs and decrease human power.
The system increases revenues System will facilitate the working, so the consumers will be
encouraged to use it.
13 | P a g e
Feasibility analysis
The technical feasibility (The technologies will be used are)
Programming languages: Java
Database programming: Oracle 11g
Java framework: Oracle ADF 12c
Oracle SQL DEVELOPER Data Modeler
The economic feasibility
Don’t interest in our system because it is a Graduation Project
without money.
The organization feasibility (If we build it, will it be used?)
From an organization perspective, the system has low risk and the
project team is a respected and knowledgeable developers.
The users of the system are expected to appreciate the system and
the data easily.
The organization users are needed to get reports and all data in
formal sheet.
This system will provide a digital data storage that can be backup
at any time.
CREATING THE PROJECT PLAN
PROJECT SELECTION
Classify Project
Size: Most of employees in this department wanted this project.
Cost: This is a free project.
Purpose: Improve access to information and replace the paper
system into an information system.
Length: It'll take 5 months before values delivered to the business.
Risk: there's a little risk as this project will cost nothing and the
team is good.
Scope: The department and the organization will work better.
Economic Value: This Entire project will affect only performance.
Project Methodology: System prototyping
14 | P a g e
The Project Work Plan
The project work plan is the mechanism used to manage the tasks that are listed in
the work breakdown structure. It is the project manager’s primary tool for managing
the project. Using it, the project manager can tell whether the project is ahead of or
behind schedule, how well the project was estimated, and what changes need to be
made to meet the project deadline.
Managing and Controlling the Project As the project progresses, the project manager collects status reports from the team
members and updates the work plan. Graphical tools such as Gantt and PERT charts
help depict progress on tasks and clarify critical task dependencies.
15 | P a g e
SUMMARY
We finished the first phase of our system and our project plan ready now. We can
go to the analysis phase that focus on who, where, what and when for the system
and give us our system proposal.
16 | P a g e
P A R T_T W O
ANALYSIS PHASE
The analysis phase answers the questions of who will use the system, what the
system will do and where and when it will be used.
All of the deliverables are combined into a system proposal which is presented to
management, who decides whether the project should continue to move forward.
OBJECTIVES
REQUIREMENTS DETERMINATION
USE CASE ANALYSIS
PROCESS MODELING
DATA MODELING
17 | P a g e
Requirements determination Is performed to transform the system request’s high level statement of business
requirements into a more detailed, precise list of what the new system must do to
provide the needed value to the business.
The as-is system: It is a manual system that depend on the user to calculate the employee salary
(manual). That cost more time and efforts. More employee to do one job.
Requirements for the new system: 1. Business requirements: less time and effort.
2. User requirements: need the system more fixable, simple and easy to use.
3. Function requirements:
Process-oriented: Calculate the employee salary.
Information-oriented: The employee information (name, address,
telephone number, start date of work…).
4. Non function requirements:
Operational: the system will work in desktop computer.
Performance: high speed, with big space to store data.
Security: The system user who can only access this system is
employee.
Cultural and political: Depend on the company policy.
The-to-be system:
User will use a computer in simple way to get the salary of the employee and get
reports.
The as-is system
RequirmentsThe-to-be
system
18 | P a g e
Requirements Elicitation Techniques Interviews
Joint Application Development (JAD)
Questionnaires
Document Analysis
Observation
We are Selecting the most appropriate way to collect information is Interviews
Interviews Is the most commonly used requirements elicitation technique. After all, it is
natural—usually, if you need to know something, you ask someone. We created
interview with expert people that use the old system after asking the department
chef.
Interviewee: Eng. Walaa. She explains that system is divided into three parts Affairs employees, Members
of the faculty and Full-time. Every part has its calculations to get the salary.
There is two type of laws to calculate the salary of employee the first one number
18 in 30/6/2015 and other one before 30/6.
First affairs employee: they use the new one which include 4 type of variables
Basic wage, wage job, wage CMOS and Countervailing incentive that merit to
employee.
Wage job and Basic wage = you take it as constant number
Wage CMOS and Countervailing incentive = it is constant else depend on the
old law and equal 0 for new employee after 30/6/2015
Entitments and Balancing
Affairs employees Members of the faculty Full-time
19 | P a g e
The employee of the department uses the previous input to calculate the employee
salary.
First you should get two values constant and variable wage. Constant wage equal
Basic wage plus 9% of Basic wage. Variable wage equal wage job plus wage
CMOS plus countervailing incentive minus Basic wage.
Second start to calculate the money eligible for the employee and they are:
15% for old age and disability insurance, 3% for illness insurance, 2%
reward system and 1% work injury insurance from constant wage.
15% for old age and disability insurance and 1% work injury insurance
from variable wage.
Third calculate the money eligible for the government and they are (Deductions):
25% for old age and disability insurance, 6% for illness insurance, 2%
reward system and 1% work injury insurance from constant wage. 25% for
old age and disability insurance and 1% work injury insurance from
variable wage.
Note that: there is maximum value for the ratio you take in variable wage
equal 2110.
There is two type of Deductions specified and fixed.
In fixed type you do not take taxes. Otherwise specified one Fourth
calculate stamp to do that you should calculate the variable that you will
calculate stamp from it.
Suppose that variable name is S_Temp.
S_Temp equal wage job plus wage CMOS plus countervailing incentive minus the
value of 14% of Basic wage plus 10% of variable wage.
Calculate S_Temp^ equal S_Temp minus 50 then calculate S_Temp
according to the following diagram.
Tota
l sal
ary Wage job
Wage CMOS
Countervailing incentive
Basic wage
20 | P a g e
How to calculate the S_Temp
Fifth the taxes: you should calculate the variable that you cut taxes from suppose
it T_Temp: T_Temp equal S_Temp minus S_Temp. Calculate Taxes according to
the following diagram.
21 | P a g e
Note that:
In case of chronic disease. In this case there is no taxes.
In some cases, you calculate the salary depend on percent of attendance but
deductions 100% (option (.
In illness case we calculate all depend on percent of attendance. Sixth
calculate fixed deductions and its represent in Participation in club and
other things that has fixed value.
Example:
Employee x has Basic salary equal 659.7 pound, Wage job equal 1891.81 pound,
CMOS equal 954.57 and countervailing incentive equal 99.63. Calculate the
salary of the employee.
Constant wage = 659.7 + 659.7 * 0.09 = 719.073
Variable wage = 1891.81 + 954.57 + 99.63 – 659.7 = 2286.31
15% for old age and disability insurance from constant wage = 107.86095
3% for illness insurance from constant wage = 21.57219
2% reward system from constant wage = 14.38146
1% work injury insurance from constant wage = 7.19073
15% for old age and disability insurance from variable wage = 316.5
1% work injury insurance from variable wage = 21.1
Total of entitlement = 1891.81 + 954.57 + 99.63 + 107.86095 + 21.57219 +
14.38146 + 7.19073 + 316.5 + 21.1 = 3434.61533
10% for old age and disability insurance from constant wage = 71.9073
3% for illness insurance from constant wage = 21.57219
10 = 211
S_Temp = 1891.81 + 954.57 + 99.63 – (659.7 * 0.14 + 2110 * 0.1) = 2642.652
S_Temp^ = 2642.652 – 50 = 2592.652
Stamp = 2592.652 * .0075 = 19.4
T_Temp = 2642.652 – 19.4 = 2623.252
T_Temp^ = 2623.252 – 1125 = 1498.252
Tax = 1498.252 * 0.1 = 149.8252
Total of deduction = 149.8252 + 19.4 + 211 + 21.57219 + 71.9073 + 7.19073 +
316.5 + 21.1 962.41002
22 | P a g e
Salary = 3434.61533 – 962.412001 = 2472.20531
You should make reports for every part alone for employees and laborers separately.
For example:
23 | P a g e
Interviewee: Eng. Osama He explains that system is divided into three parts Members of the faculty, Affairs
employees and Full-time.
Faculty member
First: Administrative affairs
Important data: The date of receipt of the work and the date of retirement (30 years
increase from the date of receipt)
Name The scientific degree The date of obtaining Degree User code Section belonging to him
Secondary data:
National ID Birthday Telephone number Personal photo Address Teaching Assistant Assistant teacher Teacher Assistant Professor Professor Professor Emeritus
Each employee vacation in college but they vary from one to another employee.
Types of vacations
Care for a child Accompany the pair Vacation patients Opposed Maternity leave There are other types Vacation leave factors Salary or without Duration of vacation Start Date Expiry date No. appointment decision
24 | P a g e
Second: Financial affairs: There is example form:
USE CASE ANALYSIS Is used to explain and document the interaction that is required between
the user and the system to accomplish the user’s task. Use cases are
created to help the development team understand more fully the steps
that are involved in accomplishing the user’s goals.
Priority: High ID: UC-1 Use Case Name: Calculate salary Actor: Employee
Description: Employee's Salary divides into two type (Entitlements and Deductions) and they have
same parameters to calculate.
Parameters are wage job, complementary wage, countervailing incentive and the Basic Salary.
Trigger: The employee calculates the employee's salary.
Type: External Temporal Internal
Preconditions:
Add 15% from basic salary on the salary as The government's share in the disability insurance and aging.
Add 3% from basic salary on the salary as The government's share in illness insurance.
Add 2% from basic salary on the salary as The government's share in reward system.
Add 1% from basic salary on the salary as The government's share in work injury insurance.
25 | P a g e
Then cut from the salary 15% from basic salary on the salary as The government's share the disability
insurance and aging.
Cut from the salary 10% from basic salary on the salary as The employee's share the disability insurance
and aging.
Cut 3% from basic salary on the salary as The government's share in illness insurance.
Cut 2% from basic salary on the salary as The government's share in reward system.
Cut 1% from basic salary on the salary as The government's share in work injury insurance.
Cut from the salary 15% from variable salary on the salary as The government's share the disability
insurance and aging.
Cut from the salary 10% from variable salary on the salary as The employee's share the disability
insurance and aging.
Cut 1% from variable salary on the salary as The government's share in work injury insurance.
Cut from the salary 4% from basic salary on the salary as The employee's share treatment
Insurance.
Cut Subscriptions unions.
Cut Installment money.
Information for steps:
Normal Course:
1. Sum the parameters of Entitlements.
2. Sum the parameters of Deductions.
3. Cut Sum the parameters of Deductions from Sum
the parameters of Entitlements.
Alternative Course:
Postconditions:
1. Calculate Entitlements.
2. Calculate Deductions.
26 | P a g e
3. Give every organization its owing.
Exceptions:
1. Wrong calculations.
Summary
Inputs Source Outputs Destination
Employee
Unions
Companies
Banks
Insurance and Pensions
Salary/injury
insurance/ disability
insurance and aging/
treatment
Insurance/
Installment
/Subscriptions
Entitlements department
1. wage job
2. complementary
wage
3. countervailing
incentive
4. basic salary
Priority: High ID: uc-2 Use Case Name: access the system Actor: employee
Description: It is explaining how user will access the system using his/her name and password.
Trigger: The employee access the system throw username and password.
Type: External Temporal Internal
Preconditions:
Insert username and password.
Check if it is true.
Access the system.
Information for steps:
Normal Course:
User insert the username.
User insert the password.
27 | P a g e
The system checks them.
The user inserts the system.
Alternative Course:
The powers that gives to the user depend on the
type of user.
Postconditions:
1. The user access the system.
2. The user start to use the system.
Exceptions:
1. Wrong username or password.
2. Hacking the system.
Summary
Inputs Source Outputs Destination
system Access the system Employee 1. username
2. password
Priority: High ID: uc-3 Use Case Name: calculate employee taxes Actor: employee
Description: It is talk about the way of calculating taxes and when it cut of salary and how?
Trigger: The employee calculate taxes depend on some laws.
Type: External Temporal Internal
Preconditions:
No taxes for salary less than 1125.
Take 10% from the salary more than 1125 and less than 1985.
Take 15% from the salary more than 1985 and less than 3333.33.
28 | P a g e
Take 20% from the salary more than 3333.33.
Then in Ordinary stamp:
From 1 to 250.
From 250 to 500.
From 500 to 1000.
From 1000 to 5000.
Information for steps:
Take care of the rate.
Take care of the rate.
Normal Course:
1. Calculate the taxes.
2. Calculate the Ordinary stamp.
3. Cut the sum of them from the total salary.
Alternative Course:
Postconditions:
1. Calculate taxes and ordinary stamp.
2. Cut them from total salary.
3. Get final salary.
4. Give the government the taxes of the employee.
Exceptions:
1. Wrong calculations.
Summary
Inputs Source Outputs Destination
Government Taxes Entitlements department Salary
Priority: High ID: uc-4 Use Case Name: define start and end of employee work Actor: employee
Description: It talk about when the employees started to work and when they leave it.
Trigger: The employee record when employees started their work and when they will leave.
29 | P a g e
Type: External Temporal Internal
Preconditions:
Record start date.
When employee leave record end date.
Information for steps:
Record there is difference between date of
appointment and date of starting the work.
Normal Course:
1. Record start date.
2. Record end date.
Alternative Course:
Postconditions:
1. Define start and end day.
2. Identify when to upgrade to high level.
3. Calculate the new salary depend on the new level.
Exceptions:
1. Store wrong information about date.
Summary
Inputs Source Outputs Destination
Entitlements department job level Employee's affairs
1. start date
2. end date
Priority: High ID: uc-5 Use Case Name: calculate the budget of salary Actor: employee of Entitlements
Description: It about calculating the total salary of all employees then they get the money from
Zagazig University.
Trigger: The employee defines the budget depend on some calculation.
Type: External Temporal Internal
30 | P a g e
Preconditions:
Calculate the total salary of all employees.
Send the information to Zagazig University.
Information for steps:
Normal Course:
1. Calculate the total salary of employees.
2. Send the information to Zagazig University.
3. Receive the money from them.
Alternative Course:
Postconditions:
1. Identify the total salary to employees.
2. Give each employee his/her salary.
Exceptions:
1. The budget more or less than the total salaries.
Summary
Inputs Source Outputs Destination
Zagazig University budget Entitlements department 1. Salary of employees
Priority: High ID: uc-6 Use Case Name: record employee information Actor: employee
Description: It contain employee's information like name, address and other information.
Trigger: The employee record employees' information.
Type: External Temporal Internal
Preconditions:
Insert employee's information into the system.
Confirm the information.
31 | P a g e
Information for steps:
Record there is difference between date of
appointment and date of starting the work.
Normal Course:
1. The employee of Entitlements take information
from employee's affairs.
2. He record the information in the system.
3. Start to do salary's calculation of the employee.
Alternative Course:
Postconditions:
1. Store employee information in database.
2. Start to do operation on employee's salary.
Exceptions:
1. Store wrong information.
Summary
Inputs Source Outputs Destination
Entitlements department
Salary
Employee's affairs
1. Employee name
2. Address
3. Degree
4. Telephone number
Priority: law ID: uc-7 Use Case Name: make a report Actor: employee
Description: It contains report about total of entitlements and balances for each department alone.
Trigger: The employee makes a report.
Type: External Temporal Internal
Preconditions:
Calculate total of each depart alone.
32 | P a g e
Define when report will exit and how.
Information for steps:
Normal Course:
1. Calculate total calculation of each depart.
2. Define the time report will exit.
3. Show reports.
Alternative Course:
Postconditions:
1. Calculate total calculation of each depart.
2. Define when report will exit and how.
3. Show reports.
Exceptions:
1. Wrong calculations.
Summary
Inputs Source Outputs Destination
Manager Reports Entitlements
department
1. Total calculation of each depart
Deductions االستقطاعات
Wage Job االجر الوظيفى
complementary wage االجر المكمل
countervailing incentive الحافز التعويضى
Basic Salary االجر االساسى
Unions النق ابات
Insurance and Pensions التامينات والمعاشات
Subscriptions االشتراكات
Installment التقسيط
Aging الشيخوخة
Disability العجز
ordinary stamp دمغة عادية
33 | P a g e
PROCESS MODELING A process model is a graphical way of representing how a business system should operate. It illustrates the processes or activities that are performed and how data move among them. A process model can be used to document the current system (i.e., as-is system) or the new system being developed (i.e., to-be system), whether computerized or not.
We focus on one of the most commonly used techniques data flow diagram (DFD) is a technique that diagrams the business processes and the data that pass among them.
Data Flow Diagram As show in the figure the user is an agent use to create other users or access the
system and his/her data is stored in user store. There is group of input that user use to
get the salary of employee by calculating the entitlement and deductions and taxes to
give the user in the last the salary.
34 | P a g e
DATA MODELING Is a formal way of representing the data that are used and created by a business system; it illustrates people, places, or things about which information is captured and how they are related to each other. The data model is drawn by an iterative process in which the model becomes more detailed and less conceptual over time.
Entity relationship diagram (ERD) Is the most common technique for drawing a data model, a formal way of representing the data that are used and created by a business system.
35 | P a g e
SUMMARY
We finished the second phase of our system and our project proposal ready now.
We can go to the design phase that focus on how the system will operate.
36 | P a g e
P A R T_T H R E E
DESIGN PHASE The design phase decides how the system will operate. This collection of deliverables
is the system specification that is handed to the programming team for
implementation.
At the end of the design phase, the feasibility analysis and project plan are
reexamined and revised, and another decision is made by the project sponsor and
approval committee about whether to terminate the project or continue.
OBJECTIVES Moving into design
Architecture design
User interface design
Program design
Data storage design
37 | P a g e
Moving into design The design phase of the SDLC uses the requirements that were gathered
during analysis to create a blueprint for the future system. A successful
design builds on what was learned in earlier phases and leads to a smooth
implementation by creating a clear, accurate plan of what needs to be done.
Needs are the elements and key inputs to the design phase and output is to
be system characterization and all its needs and its features and what the
individual needs to build in all respects and often
Confined in
Physical process.
Architecture Design.
Hard/Soft Ware.
Interface Design.
Data Storage.
Inputs and outputs to system are determined from the Hard / Soft Ware &
People & communications among them.
At this stage, be converted to practical requirements system requirements.
The focus is on system requirements to try to have full access through the
system design.
Architecture design
The objective of architecture design is to determine how the software
components of the information system will be assigned to the hardware
devices of the system.
The software is divided into
Data Storage
Data Access Logic (SQL)
Application Logic (code)
Presentation Logic (UI)
And Hardware is divided into
Clients
Servers
Networks Client–Server Architectures
In these architectures, the client is responsible for the presentation logic,
whereas the server is responsible for the data access logic and data storage.
The application logic may reside on the client, reside on the server, or be
split between both. If the client contained all or most of the application
logic, it is called a thick or fat client.
38 | P a g e
Client–server architectures have four important benefits
Scalable That means it is easy to increase or decrease the storage and processing capabilities of the servers.
Each of the computing architectures discussed earlier has its strengths and
weaknesses. Most organizations are moving to client–server architectures
for cost and scalability reasons, so, in the event that there is no reason other
than cost, client–server is generally used today.
Creating an architecture design begins with the nonfunctional
requirements. The first step is to refine the nonfunctional requirements into
more detailed requirements that are then employed to help select the
architecture to be used (server-based, client-based, or client–server) and the
software components to be placed on each device. In a client–server
architecture, one also has to decide whether to use a two-tier, three-tier, or
n-tier architecture. Then the nonfunctional requirements and the
architecture design are used to develop the hardware and software
specification.
TO Make Architecture Design we need:
Nonfunctional Requirements
1. Operational Requirements: Technical environment Requirements
System Integration Requirements
Portability Requirements
Maintainability Requirements
2. Performance Requirements: speed Requirements
Response & Request Time
Capacity Requirements
Availability & Reliability
3. Security Requirements: System Value
Access Control Requirements
Virus Control
Encryption & Authentication Requirements
4. Cultural & Political: Multilingual Requirements
Customization Requirements
Legal Requirements
Making Unstated Norms Explicit
39 | P a g e
User interface design
User interface is the part of the system with which the users interact. It
includes the screen displays that provide navigation through the system, the
screens and forms that capture data, and the reports that the system
produces (whether on paper, on the Web, or via some other media).
Principals for user interface design
User interface design is an art. The goal is to make the interface pleasing to
the eye and simple to use, while minimizing the effort users expend to
accomplish their work. These principals are: Layout
Content awareness
Aesthetics
User experience
Consistency
Minimize user effort
User interface design process
Is a five-step process Use scenarios
Interface structure diagram
Interface standards
Interface design prototype
Interface evaluation
Navigation design
The navigation component of the interface enables the user to enter
commands to navigate through the system and perform actions to enter and
review information it contains.
Basic Principles: Prevent Mistakes.
Simplify Recovery from Mistakes.
Use Consistent Grammar Order
Types of Navigation Controls: Languages.
Menus.
Direct Manipulation.
Messages: error messages
confirmation messages
acknowledgment messages
delay messages,
and help messages
40 | P a g e
Input design The goal of input design is to simply and easily capture accurate
information for the system, typically by using online or batch processing,
capturing data at the source, and minimizing keystrokes. Input design
includes both the design of input screens and all preprinted forms that are
used to collect data before they are entered into the information system.
Types of Inputs Text.
Numbers.
Selection Box.
Input Validation All data entered into the system must be validated in order to ensure
accuracy. Input validation (also called edit checks) can take many forms.
Ideally, to prevent invalid information from entering the system, computer
systems should not accept data that fail any important validation check. Completeness check
Ensures that all required data have been entered. Format check
Ensures that data are of the right type (e.g., numeric) and in the right format (e.g., month, day, year).
Range check Ensures that numeric data are within correct minimum and max values.
Check digit check Check digits are added to numeric codes.
Consistency checks Ensure that combinations of data are valid.
Database checks Compare data against a database (or file) to ensure that they are correct.
Examples of Inputs:
41 | P a g e
Examples of inputs validation:
Output design
The goal of output design is to present information to users so that they can
accurately understand it with the least effort, usually by understanding how
reports will be used and designing them to minimize information overload
and bias. Output design means designing both screens and reports in other
media, such as paper and the Web. There are many types of reports,
including detail reports, summary reports, exception reports, turnaround
documents, and graphs.
Types of outputs Detail reports
Summary reports
Exception reports
Turnaround documents
Graphs
42 | P a g e
Examples:
43 | P a g e
Program design Another important activity of the design phase is designing the programs that will
perform the system’s application logic. Programs can be quite complex, so
analysts must create instructions and guidelines for programmers that clearly
describe what the program must do.
Some people may think that program design is becoming less important, as project
teams rely increasingly on packaged software or libraries of preprogrammed code
to build systems. Program design techniques are still very important, however, for
two reasons. First, even preexisting code needs to be understood, organized, and
pieced together. Second, it is still common for the project team to have to write
some (if not all) code and produce original programs that support the application
logic of the system.
MOVING FROM LOGICAL TO PHYSICAL PROCESS MODELS During design, physical process models are created to show implementation
details and explain how the final system will work. These details can include
references to actual technology, the format of information moving through
processes, and the human interaction that is involved. In some cases, most often
when packages are used, the use cases may need to be revised as well. These to-be
44 | P a g e
models describe characteristics of the system that will be created, communicating
the “systems view” of the new system.
The Physical Data Flow Diagram The physical DFD contains the same components as the logical DFD (e.g., data
stores, data flows), and the same rules apply (e.g., balancing, decomposition). The
basic difference between the two models is that a physical DFD contains
additional details that describe how the system will be built. There are five steps
to perform to make the transition to the physical DFD.
Data storage design Another important activity of the design phase is designing the data storage
component of the system.
Data storage formats There are two main types of data storage formats: files and databases. Files are
electronic lists of data that have been optimized to perform a particular
transaction.
A data file contains an electronic list of information that is formatted for a
particular transaction, and the information is changed and manipulated by
programs that are written for those purposes.
A database is a collection of groupings of information that are related to each
other in some way.
We use database Database design include data flow diagram (DFD), context free diagram, ER-
diagram (ERD). ERD contains tables for each entity like employee, department,
bank, impulse and for related entity like bank branch, degree and for relation
entity like emp_impulse. ERD also contains relationship between tables like
many-to-many and these show as foreign key. After DFD we now present ERD:
45 | P a g e
46 | P a g e
Now we convert our project from the level of analysis to ERD, we have the main tables:
1. Employee 2. Department 3. Degree 4. Bank 5. Absent 6. INSURANCE_DEDUCTION 7. LIMILTED_DEDUCTION 8. STATIC_DEDUCTION 9. STATE 10. Impulse 11. MONTHLYSALARY 12. YEARLYSALARY 13. YEARLYSALARY_ARCHIVE
These is our main tables that have relationship between them and the core table
that has relation with the most table is employee.
In this step we define each table and explore each column in them.
For employee has the main columns ID to store record number and it is unique,
Name to store employee name, Birth Date to store his/her birthdate, Hire Date to
store the date of acceptance to work in organization , Work Receiving Date to
store the date in which employee receive the job , Livelihood Date to store the
date in which employee has retired, Telephone Number to store his/her phone
number, Address to store employee address, Code to store the employee code that
taken from organization , Snn Number to store the national id and has the salary
information columns Basic Salary, Wage job, Complementary Wage,
Countervaling Inceltive and has five columns for each relation with different
Department ID for relation with department table.
Degree ID for relation with Degree table.
Bank ID for relation with Bank table.
Branch ID for relation with Bank_Branch table.
Manager ID for relation with employee table.
Then this table has five relations with five tables and every column for each
relation is foreign Key. We want to have at least one primary Key for this table
we select ID.
The Department Table has three columns ID to store record number and it is
unique, Name to store Department name, Location to store department location.
We want to have at least one primary Key for this table we select ID.
The Degree Table has two columns ID to store record number and it is unique,
Name to store the degree level. We want to have at least one primary Key for this
table we select ID.
47 | P a g e
The Bank Table has two columns ID to store record number and it is unique,
Name to store bank name. We want to have at least one primary Key for this table
we select ID.
The Absent table has ID to store record number and it is unique, absent number to
store the number of days in which the employee is absented, Month Days number
to store the number of month days, Payment Value to store the value that will be
deducted from salary and has column for relation with employee table called
Employee ID (Emp ID). & we want to have at least one primary Key for this table
we select ID.
The INSURANCE_DEDUCTION table has two columns ID to store record
number and it is unique, Name to store the name of deduction. We want to have at
least one primary Key for this table we select ID.
The LIMILTED_DEDUCTION table has two columns ID to store record
number and it is unique, Name to store the name of deduction. We want to have at
least one primary Key for this table we select ID.
The STATIC_DEDUCTION table has two columns ID to store record number
and it is unique, Name to store the name of deduction. We want to have at least
one primary Key for this table we select ID.
The State table has two columns ID to store record number and it is unique, Type
to store the name of employee state like working, absent with salary. We want to
have at least one primary Key for this table we select ID.
The Impulse table has two columns ID to store record number and it is unique,
Name to store the name of impulse, we want to have at least one primary Key for
this table we select ID.
The Monthly salary table has more columns ID to store record number and it is
unique, the salary information columns Basic Salary, Wage job, Complementary
Wage, Countervaling Inceltive, values generated automatically through procedure
for adding to salary BSSDeath to store 15% of Basic Salary , BworkAccidient to
store 1% of Basic Salary, BEndGift to store 2% of Basic Salary, BInsurance to
store 3% of Basic Salary, TssDeath to store 15% of changed salary that is
calculated from this formula (wage job + Complementary Wage + Countervaling
Inceltive - Basic Salary), TworkAccidient to store 1% of changed salary,
ImpADD to store the sum of values for this employee in Emp_impulse table, and
Govern Total to store the total of all above without salary information and
ImpADD , then add to this value ImpADD and the salary information columns
without basic salary and store this final value in Ent total.
The values generated automatically through procedure for subtracting
48 | P a g e
from salary BSSDeath to store 15% of Basic Salary, BworkAccidient to store 1%
of Basic Salary, BEndGift to store 2% of Basic Salary, BInsurance to store 3% of
Basic Salary, BsavSSDeath to store 10% of basic salary, BsavGiftSys to store 3%
of basic salary, BSavAgainstSick to store 1% of basic salary, and their total
storing it on job total column and TssDeath to store 15% of changed salary,
TworkAccidient to store 1% of changed salary, TSavssDeath to store 10% of
changed salary, and their total to store on COM total. And another deduction to
subtract from the salary total limitDED to store the sum of values for this
employee in Emp_limitDEduction, InsDED to store the sum of values for this
employee in Emp_InsuranceDeduction, StaticDED to store the sum of values for
this employee in Emp_SataicDeduction, SanctionDed to store the sum of values
for this employee in Absent, Taxes, Stamp and these deductions to job total and
com total and store this final value in Ded total. Subtract the Ded total from Ent
total and store the value on salary column.
We have another two columns MonDate for storing date of current Month and
column for relation with employee table called Employee ID (EmpID) {this is
foreign Key}. We want to have at least one primary Key for this table we select
ID.
The Yearly salary table has more columns ID to store record number and it is
unique, the salary information columns Basic Salary, Wage job, Complementary
Wage, Countervaling Inceltive, values generated automatically through procedure
for adding to salary BSSDeath to store 15% of Basic Salary , BworkAccidient to
store 1% of Basic Salary, BEndGift to store 2% of Basic Salary, BInsurance to
store 3% of Basic Salary, TssDeath to store 15% of changed salary that is
calculated from this formula (wage job + Complementary Wage + Countervaling
Inceltive - Basic Salary), TworkAccidient to store 1% of changed salary,
ImpADD to store the sum of values for this employee in Emp_impulse table, and
Govern Total to store the total of all above without salary information and
ImpADD , then add to this value ImpADD and the salary information columns
without basic salary and store this final value in Ent total.
The values generated automatically through procedure for subtracting from salary
BSSDeath to store 15% of Basic Salary, BworkAccidient to store 1% of Basic
Salary, BEndGift to store 2% of Basic Salary, BInsurance to store 3% of Basic
Salary, BsavSSDeath to store 10% of basic salary, BsavGiftSys to store 3% of
basic salary, BSavAgainstSick to store 1% of basic salary, and their total storing it
on job total column and TssDeath to store 15% of changed salary,
TworkAccidient to store 1% of changed salary, TSavssDeath to store 10% of
changed salary, and their total to store on COM total. And another deduction that
are subtracted from the salary total limitDED, InsDED, StaticDED, SanctionDed
49 | P a g e
are equal zero, Taxes, Stamp and these deductions to job total and com total and
store this final value in Ded total. Subtract the Ded total from Ent total and store
the value on salary column.
We have another two columns YDate for storing date of current Year and column
for relation with employee table called Employee ID (EmpID) {this is foreign
Key}. We want to have at least one primary Key for this table we select ID. This
table is affected by employee any change in employee lead to change in data in
Yearly salary.
The Yearly Salary Archive table has the same columns that exist in Yearly salary
and before delete the data in Yearly salary the data is stored in Yearly Salary
Archive as a backup
In this next step we define the relations and generate tables from many-to-many
relation.
Then we discuss Relations:
Table 1 Table 2 Relation
Department Employee One-to-many
Degree Employee One-to-many
Bank Employee One-to-many
Bank Branch Employee One-to-many
Employee Employee One-to-many
Impulse Employee Many-to-many
Monthly Salary Employee Many-to-one
Yearly Salary Employee Many-to-one
Yearly Salary Archive Employee Many-to-one
Absent Employee Many-to-one
State Employee Many-to-many
Static Deduction Employee Many-to-many
Limited Deduction Employee Many-to-many
Insurance Deduction Employee Many-to-many
Bank Bank Branch One-to-many
50 | P a g e
Every many-to-many relation is broken to two relations one-to-many and the
tables which relation between them are connected to third table and each one of
these two table has relation one-to-many to this third. So
Table 1 Table 2 Relation
Employee EMP_Impulse One-to-many
Impulse EMP_Impulse One-to-many
Employee EMP_STATE One-to-many
State EMP_STATE One-to-many
Employee EMP_STATICDEDuction One-to-many
Static_Deduction EMP_STATICDEDuction One-to-many
Employee EMP_INSURANCEDEDuction One-to-many
Insurance_Deduction EMP_INSURANCEDEDuction One-to-many
Employee EMP_LIMITCDEDuction One-to-many
Limit_Deduction EMP_LIMITDEDuction One-to-many
The EMP_Impulse table has columns ID to store record number and it is unique,
Imp Value to store the value of impulse. We want to have at least one primary
Key for this table we select ID. Then we have two foreign key one for Employee
(EMPID) to store the employee id that sign to who employee take this value and
one for Impulse (IMPID) to store the impulse id that sign to which impulse type
the employee is taken.
The EMP_State table has columns ID to store record number and it is unique,
Decision number to store the number of file that contain the order, with salary to
store that order is with salary or not (True or False). We want to have at least one
primary Key for this table we select ID. Then we have two foreign key one for
Employee (EMPID) to store the employee id that sign to who employee has this
order or this state and one for state (STATEID) to store the state id that sign to
which state type the employee is assigned to.
The EMP_StaticDeduction table has columns ID to store record number and it is
unique, Value to store the value of this deduction. We want to have at least one
primary Key for this table we select ID. Then we have two foreign key one for
Employee (EMPID) to store the employee id that sign to who employee will be
deduct this value from him/her and one for static deduction (static ID) to store the
deduction id that sign to which deduction type the employee is deducted from.
51 | P a g e
The EMP_LimitedDeduction table has columns ID to store record number and it
is unique, Value. We want to have at least one primary Key for this table we select
ID. Then we have two foreign key one for Employee (EMPID) to store the
employee id that sign to who employee will be deduct this value from him/her and
one for limit deduction (limit ID) to store the deduction id that sign to which
deduction type the employee is deducted from.
The EMP_InsuranceDeduction table has columns ID to store record number and it
is unique, Value. We want to have at least one primary Key for this table we select
ID. Then we have two foreign key one for Employee (EMPID) to store the
employee id that sign to who employee will be deduct this value from him/her and
one for Insurance deduction (INS ID) to store the deduction id that sign to which
deduction type the employee is deducted from.
Then in this next step we define each column's type for each table:
ABSENT
Columns: No Column Name PK FK M Data Type
1 AbsentID P Y NUMERIC - AI
2 AbsentNum NUMERIC
3 DaysNum NUMERIC
4 PaymentValue NUMERIC
5 EmpID F Y NUMERIC
Foreign Keys (referring to):
Name Referring To Mandatory Transferable Column
Name
ABSENT_EMPLOYEE_FK EMPLOYEE Y Y EmpID
52 | P a g e
BANK
Columns:
No Column Name PK FK M Data Type
1 BankID P Y NUMERIC – AI
2 BankName VARCHAR (1000 BYTE)
Foreign Keys (referred from):
BANK_BRANCHES
Columns:
No Column Name PK FK M Data Type
1 BranchID P Y NUMERIC – AI
2 BranchName VARCHAR (1000 BYTE)
3 Address VARCHAR (1000 BYTE)
4 BankID F Y NUMERIC
Foreign Keys (referring to & referred from):
Name Referred From Mandatory Transferable Column Name
BANK_FK BANK_BRANCHES Y Y BankID
EMPLOYEE_BANK_FK EMPLOYEE Y BankID
Name Refering To Mandatory Transferable Column Name
BANK_FK BANK Y Y BankID
Name Referred
From Mandatory Transferable Column Name
EMPLOYEE_BRANCHES_FK EMPLOYEE Y Y BranchID
53 | P a g e
Degree
Columns:
No Column Name PK FK M Data Type
1 DegreeId P Y NUMERIC – AI
2 DegreeName VARCHAR (100 BYTE)
Foreign Keys (referred from):
DEPARTMENT Columns:
No Column Name PK FK M Data Type
1 DepartmentID P Y NUMERIC – AI
2 DepartmentLoc VARCHAR (100 BYTE)
3 DepartmentName Y VARCHAR (100 BYTE)
Foreign Keys (referred from):
EMPLOYEE
Columns:
No Column Name PK FK M Data Type
1 EmpID P Y NUMERIC – AI
2 EmpName Y VARCHAR (100 BYTE)
3 BirthDate Date
Name Referred
From Mandatory Transferable Column Name
EMPLOYEE_DEGREE_FK EMPLOYEE Y Y DegreeId
Name Referred
From Mandatory Transferable Column Name
EMPLOYEE_DEPARTMENT_FK EMPLOYEE Y Y DepartmentID
54 | P a g e
No Column Name PK FK M Data Type
4 HireDate Y Date
5 WorkReceivingDate Y Date
6 TelephoneNo Y NUMERIC
7 Address Y VARCHAR (1000 BYTE)
8 EmployeeCode Y VARCHAR (100 BYTE)
9 LivelihoodDate Y Date
10 SnnNumber Y NUMERIC
11 DepartmentID F Y NUMERIC
12 ManagerID F NUMERIC
13 BasicSalary Y NUMERIC
14 WageJob NUMERIC
15 ComplementaryWage NUMERIC
16 CountervalingInceltive NUMERIC
17 DegreeID F Y NUMERIC
18 BRANCHID F Y NUMERIC
19 BANK_ID F NUMERIC
Foreign Keys (referring to & referred from):
Name Refering To Manda
tory Transfe
rable Column Name
EMPLOYEE_BANK_FK BANK Y BankID
EMPLOYEE_BRANCHES_FK BANK_BRANCHES Y Y BranchID
EMPLOYEE_DEGREE_FK DEGREE Y Y DegreeId
EMPLOYEE_DEPARTMENT_FK DEPARTMENT Y Y DepartmentID
55 | P a g e
Name Refering To Manda
tory Transfe
rable Column Name
EMPLOYEE_EMPLOYEE_FK EMPLOYEE Y EmpID
Name Referred From Manda
tory Transfe
rable Column Name
ABSENT_EMPLOYEE_FK ABSENT Y Y EmpID
EMPID EMP_IMPULSE Y Y EmpID
EMPLOYEE_EMPLOYEE_FK EMPLOYEE Y EmpID
EMP_INSURANCEDEDUCTION_E
MP_FK EMP_INSURANCEDE
DUCTION Y Y EmpID
EMP_LIMILTEDDEDUCTION_EM
P_FK EMP_LIMILTEDDEDU
CTION Y Y EmpID
EMP_STATICDEDUCTION_EMP_
FK EMP_STATICDEDUCT
ION Y Y EmpID
YEARLYSALARY_EMPLOYEE_FK YEARLYSALARY Y Y EmpID
SALARY_ARCHIVE_EMPLOYEE_F
K YEARLYSALARY_ARC
HIVE Y Y EmpID
STATE_EMPLOEE_EMPLOYEE_F
K EMP_STATE Y Y EmpID
EMP_IMPULSE Columns:
No Column Name PK FK M Data Type
1 EmpImpID P Y NUMERIC – AI
2 ImpID F Y NUMERIC
3 EmpID F Y NUMERIC
4 ImpValue NUMERIC
Foreign Keys (referring to):
Name Refering To Mandatory Transferable Column Name
EMPID EMPLOYEE Y Y EmpID
IMPLID IMPULSE Y Y ImpID
56 | P a g e
IMPULSE Columns:
No Column Name PK FK M Data Type
1 ImpID P Y NUMERIC – AI
2 ImpName VARCHAR (200 BYTE)
Foreign Keys (referred from):
EMP_INSURANCEDEDUCTION Columns:
No Column Name PK FK M Data Type
1 EmpInsID P Y NUMERIC – AI
2 EmpID F Y NUMERIC
3 InsID F Y NUMERIC
4 InsValue NUMERIC
Foreign Keys (referring to):
Name Referred From Mandatory Transferable Column Name
IMPLID EMP_IMPULSE Y Y ImpID
Name Refering To Mandat
ory Transf
erable Column
Name
EMP_INSURANCEDEDUCTION_E
MP_FK EMPLOYEE Y Y EmpID
EMP_INSURANCEDEDUCTION_IN
S_FK INSURANCE_DEDUCTI
ON Y Y InsuranceI
D
57 | P a g e
INSURANCE_DEDUCTION Columns:
No Column Name PK FK M Data Type
1 InsuranceID P Y NUMERIC - AI
2 InsuranceName VARCHAR (100 BYTE)
Foreign Keys (referred from):
EMP_LIMILTEDDEDUCTION Columns:
No Column Name PK FK M Data Type
1 EmpLimitID P Y NUMERIC - AI
2 EmpID F Y NUMERIC
3 LimitID F Y NUMERIC
4 DedValue NUMERIC
Foreign Keys (referring to):
Name Referred From Mandat
ory Transfer
able Column
Name
EMP_INSURANCEDEDUCTION_I
NS_FK EMP_INSURANCEDEDU
CTION Y Y Insuranc
eID
Name Refering To Mandatory Transferable Column
Name
EMP_LIMILTEDDEDUCTION_EMP_FK EMPLOYEE Y Y EmpID
EMP_LIMILTEDDEDUCTION_LIM_FK LIMITED_DEDUCTION Y Y LimitID
58 | P a g e
LIMITED_DEDUCTION Columns:
No Column Name PK FK M Data Type
1 LimitID P Y NUMERIC – AI
2 LimitName Y VARCHAR (200 BYTE)
Foreign Keys (referred from):
EMP_STATE Columns:
No Column Name PK FK M Data Type
1 EmpStateID P Y NUMERIC - AI
2 EmpID F Y NUMERIC
3 StateID F Y NUMERIC
4 DecisionID NUMERIC
5 WithSalary Y CHAR (1)
Foreign Keys (referring to):
Name Referred From Mandatory Transferable Column
Name
EMP_LIMILTEDDEDUCTION_LIM_FK EMP_LIMILTEDDEDUCTION Y Y LimitID
Name Refering
To Mandatory Transferable Column Name
STATE_EMPLOEE_EMPLOYEE_FK EMPLOYEE Y Y EmpID
STATE_EMPLOEE_STATE_FK STATE Y Y StateID
59 | P a g e
STATE
Columns:
No Column Name PK FK M Data Type
1 StateID P Y NUMERIC - AI
2 StateType VARCHAR (200 BYTE)
Foreign Keys (referred from):
EMP_STATICDEDUCTION Columns:
No Column Name PK FK M Data Type
1 EmpStaticID P Y NUMERIC – AI
2 EmpID F Y NUMERIC
3 StateID F Y NUMERIC
4 StaticValue Y NUMERIC
Foreign Keys (referring to):
Name Referred
From Mandatory Transferable Column Name
STATE_EMPLOEE_STATE_FK EMP_STATE Y Y StateID
Name Refering To Mandatory Transferable Column
Name
EMP_STATICDEDUCTION_EMP_FK EMPLOYEE Y Y EmpID
EMP_STATICDEDUCTION_STATIC_FK STATIC_DEDUCTION Y Y StaticID
60 | P a g e
STATIC_DEDUCTION Columns:
No Column Name PK FK M Data Type
1 StaticID P Y NUMERIC - AI
2 StaticName VARCHAR (100 BYTE)
Foreign Keys (referred from):
MONTHLYSALARY
Columns: No Column Name PK FK M Data Type
1 MSalID P Y NUMERIC – AI
2 EmpID F Y NUMERIC
3 BasicSalary Y NUMERIC
4 WageJob NUMERIC
5 ComplementaryWage NUMERIC
6 CountervalingInceltive NUMERIC
7 BssDeath NUMERIC
8 BworkAccidient NUMERIC
9 BEndGift NUMERIC
10 BInsurance NUMERIC
11 TssDeath NUMERIC
12 TworkAccidient NUMERIC
Name Referred From Mandatory Transferable Column
Name
EMP_STATICDEDUCTION_STATIC_FK EMP_STATICDEDUCTION Y Y StaticID
61 | P a g e
No Column Name PK FK M Data Type
13 ImpADD NUMERIC
14 GovernTotal NUMERIC
15 BssDeath1 NUMERIC
16 BWorkAccidient1 NUMERIC
17 BEndGift1 NUMERIC
18 BInsurance1 NUMERIC
19 BSavssDeath NUMERIC
20 BsavGiftSys NUMERIC
21 BSavAgainstSick NUMERIC
22 JobTotal NUMERIC
23 TssDeath1 NUMERIC
24 TWorkAccidient1 NUMERIC
25 TSavssDeath NUMERIC
26 ComTotal NUMERIC
27 LimitDED NUMERIC
28 InsDED NUMERIC
29 StaticDED NUMERIC
30 SanctionDed NUMERIC
31 Taxes NUMERIC
32 Stamp NUMERIC
33 DedTotal NUMERIC
34 EntTotal NUMERIC
62 | P a g e
No Column Name PK FK M Data Type
35 Salary NUMERIC
36 MonDate Date
Foreign Keys (referring to):
YEARLYSALARY Columns:
No Column Name PK FK M Data Type
1 YSalID P Y NUMERIC - AI
2 EmpID F Y NUMERIC
3 BasicSalary Y NUMERIC
4 WageJob NUMERIC
5 ComplementaryWage NUMERIC
6 CountervalingInceltive NUMERIC
7 BssDeath NUMERIC
8 BWorkAccidient NUMERIC
9 BEndGift NUMERIC
10 BInsurance NUMERIC
11 TssDeath NUMERIC
12 TWorkAccidient NUMERIC
13 ImpADD NUMERIC
14 GovernTotal NUMERIC
Name Refering To Mandatory Transferable Column Name
SALARY_EMPLOYEE_FK EMPLOYEE Y Y EmpID
63 | P a g e
No Column Name PK FK M Data Type
15 BssDeath1 NUMERIC
16 BWorkAccidient1 NUMERIC
17 BEndGift1 NUMERIC
18 BInsurance1 NUMERIC
19 BSavssDeath NUMERIC
20 BSavGiftSys NUMERIC
21 BSavAgainstSick NUMERIC
22 JobTotal NUMERIC
23 TssDeath1 NUMERIC
24 TWorkAccidient1 NUMERIC
25 TSavssDeath NUMERIC
26 ComTotal NUMERIC
27 LimitDED NUMERIC
28 InsDED NUMERIC
29 StaticDED NUMERIC
30 SanctionDed NUMERIC
31 Taxes NUMERIC
32 Stamp NUMERIC
33 DedTotal NUMERIC
34 EntTotal NUMERIC
35 Salary NUMERIC
36 YDate Date
64 | P a g e
Foreign Keys (referring to): Name Refering To Mandatory Transferable Column Name
YEARLYSALARY_EMPLOYEE_FK EMPLOYEE Y Y EmpID
YEARLYSALARY_ARCHIVE Columns:
No Column Name PK FK M Data Type
1 ArSalID P Y NUMERIC - AI
2 EmpID F Y NUMERIC
3 BasicSalary Y NUMERIC
4 WageJob NUMERIC
5 ComplementaryWage NUMERIC
6 CountervalingInceltive NUMERIC
7 BssDeath NUMERIC
8 BWorkAccidient NUMERIC
9 BEndGift NUMERIC
10 BInsurance NUMERIC
11 TssDeath NUMERIC
12 TWorkAccidient NUMERIC
13 ImpADD NUMERIC
14 GovernTotal NUMERIC
15 BssDeath1 NUMERIC
16 BWorkAccidient1 NUMERIC
17 BEndGift1 NUMERIC
65 | P a g e
No Column Name PK FK M Data Type
18 BInsurance1 NUMERIC
19 BSavssDeath NUMERIC
20 BSavGiftSys NUMERIC
21 BSavAgainstSick NUMERIC
22 JobTotal NUMERIC
23 TssDeath1 NUMERIC
24 TWorkAccidient1 NUMERIC
25 TSavssDeath NUMERIC
26 ComTotal NUMERIC
27 LimitDED NUMERIC
28 InsDED NUMERIC
29 StaticDED NUMERIC
30 SanctionDed NUMERIC
31 Taxes NUMERIC
32 Stamp NUMERIC
33 DedTotal NUMERIC
34 EntTotal NUMERIC
35 Salary NUMERIC
36 ARDate Date
Foreign Keys (referring to): Name Refering To Mandatory Transferable Column Name
SALARY_ARCHIVE_EMPLOYEE_FK EMPLOYEE Y Y EmpID
66 | P a g e
Then is this next step we generate the sql code to create our database.
For table employee:
CREATE TABLE EMPLOYEE
(
EmpID NUMBER NOT NULL ,
EmpName VARCHAR2 (100 BYTE) NOT NULL ,
BirthDate DATE ,
HireDate DATE NOT NULL ,
WorkReceivingDate DATE NOT NULL ,
TelephoneNo NUMBER NOT NULL ,
Address VARCHAR2 (1000 BYTE) NOT NULL ,
EmployeeCode VARCHAR2 (100 BYTE) NOT NULL ,
LivelihoodDate DATE NOT NULL ,
SnnNumber NUMBER NOT NULL ,
DepartmentID NUMBER NOT NULL ,
ManagerID NUMBER ,
BasicSalary NUMBER NOT NULL ,
WageJob NUMBER ,
ComplementaryWage NUMBER ,
CountervalingInceltive NUMBER ,
DegreeID NUMBER NOT NULL ,
BRANCHID NUMBER NOT NULL ,
BANK_ID NUMBER
) ;
Alter statement to define which primary key and foreign key. Employee primary key:
ALTER TABLE EMPLOYEE ADD CONSTRAINT EMPLOYEE_PK
PRIMARY KEY (EmpID);
Employee Foreign Keys:
For Bank table:
ALTER TABLE EMPLOYEE ADD CONSTRAINT
EMPLOYEE_BANK_FK FOREIGN KEY (BANK_ID) REFERENCES BANK
(BANKID) ON DELETE CASCADE NOT DEFERRABLE;
67 | P a g e
For Bank_Branch table:
ALTER TABLE EMPLOYEE ADD CONSTRAINT
EMPLOYEE_BRANCHES_FK FOREIGN KEY (BRANCHID)
REFERENCES BANK_BRANCHES (BranchID) ON DELETE CASCADE
NOT DEFERRABLE;
For Degree table:
ALTER TABLE EMPLOYEE ADD CONSTRAINT
EMPLOYEE_DEGREE_FK FOREIGN KEY (DegreeID) REFERENCES
DEGREE (DegreeId) ON DELETE CASCADE NOT DEFERRABLE;
For Department table:
ALTER TABLE EMPLOYEE ADD CONSTRAINT
EMPLOYEE_DEPARTMENT_FK FOREIGN KEY (DepartmentID)
REFERENCES DEPARTMENT (DepartmentID) ON DELETE CASCADE
NOT DEFERRABLE;
For employee itself table:
ALTER TABLE EMPLOYEE ADD CONSTRAINT
EMPLOYEE_EMPLOYEE_FK FOREIGN KEY (ManagerID)
REFERENCES EMPLOYEE (EmpID) ON DELETE CASCADE NOT
DEFERRABLE;
Then go to the plsql level. We want to create sequences to apply auto increment for id in each table.
Sequence for employee table:
CREATE SEQUENCE "EMPLOYEE_ID_SEQ" MINVALUE 1
MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START
WITH 1 NOCACHE ORDER NOCYCLE;
Then create trigger to apply this sequence: create or replace TRIGGER "EMPLOYEE_ID_INC_TRG" BEFORE
INSERT ON "EMPLOYEE" FOR EACH ROW WHEN (NEW.empid IS
NULL)
BEGIN
:NEW.empid := EMPLOYEE_ID_SEQ.NEXTVAL;
END;
We want procedure to calculate the data of Monthly salary as follow:
68 | P a g e
This procedure take employee id as an input and select salary information
(BasicSalary, WageJob, ComplementaryWage, CountervalingInceltive)
and select sum of values from deduction tables, payment value from
Absent to deduct from salary as deduction and select employee's state
(with salary) if is N or Y and if no data found in deduction tables then they
equal zero and select impulse addition for this employee.
And then compute some formula:
ConSal = BasicSalary + (BasicSalary * 0.09)
TempSal = WageJob + ComplementaryWage + CountervalingInceltive -
BasicSalary
If tempsal is more than 2110 then tempsal is equal 2110
If employee state(with salary [WS]) is equal N , there is no salary for this
employee.
If employee state(with salary [WS]) is equal Y, now we can ready to
calculate the salary:
b_ssdeath =( ConSal *15)/100
b_workacc =( ConSal *1)/100
b_endgift =( ConSal *2)/100
b_insur =( ConSal *3)/100
t_ssdeath =( TempSal *15)/100
t_workacc =( TempSal *1)/100
govern total = b_ssdeath + b_workacc + b_endgift + b_insur + t_ssdeath
+ t_workacc
entitlements total= govern total + impulse add + wage + com + counter
b_sav_ssdeath =(bas *10)/100
b_sav_giftsys =(bas *3)/100
b_sav_against =(bas *1)/100
t_sav_ssdeath = (10 *temp)/100
job Total = b_ssdeath + b_workacc + b_endgift + b_insur +
b_sav_against + b_sav_giftsys + b _sav_ssdeath
complementary total = t_ssdeath + t_workacc + t_sav_ssdeath
stamp Temp = WageJob + ComplementaryWage + CountervalingInceltive-
((ConSal *14/100)+
(TempSal *10/100))
Tax temp = WageJob + ComplementaryWage + CountervalingInceltive-
((ConSal *14/100)+( TempSal *10/100))
- stamp
Stamp and tax calculations is defined in analysis steps.
69 | P a g e
Deduction total = job total + complementary total + stamp + Tax + Insded
+Limded+ Sanctinded+Staticded
Salary = entitlements total - Deduction total
Then Insert them into Monthly salary Table.
Monthly Salary Procedure:
create or replace PROCEDURE MONTHLY_INSERT_PRO (
EMP_ID Employee.Empid%type )
AS
B_ssDeath NUMBER ;
B_WorkACC NUMBER ;
B_EndGift NUMBER;
B_insur NUMBER;
T_ssDeath NUMBER;
T_WorkACC NUMBER;
Govern_Tot NUMBER;
B_Sav_ssDeath NUMBER;
B_Sav_GiftSys NUMBER;
B_Sav_Against NUMBER;
Job_Tot NUMBER;
T_Sav_ssDeath NUMBER;
Com_Tot NUMBER;
impadd number;
limded number;
sanctinded number;
insded number;
staticded number;
taxes number;
stamp number;
DED_TOT NUMBER;
ENT_TOT NUMBER;
SAL NUMBER;
SsDate DATE;
Temp NUMBER;
stemp number;
xtemp number;
BASE number;
WAGE number;
COM number;
70 | P a g e
COUNTER number;
BAS Number;
ws char;
BEGIN
Ssdate := Sysdate ;
SELECT
BASICSALARY,WAGEJOB,COMPLEMENTARYWAGE,COUNTERVALIN
GINCELTIVE
into base,wage,com,counter FROM EMPLOYEE where EMPID=emp_ID;
----------------------- temporary Sal-------------------------------------
temp := wage + com + counter - base;
if temp >2110 then
temp:=2110;
end if;
------------------------ select all values-------------------------------
Select Sum(Insvalue)Into insded From Emp_Insurancededuction
Where Empid= Emp_Id;
if insded is not null then
insded:=insded;
else
insded:=0;
end if;
---------------------------------------------
Select Sum(staticvalue)Into staticded From Emp_Staticdeduction
Where Empid= Emp_Id;
if staticded is not null then
staticded:=staticded;
else
staticded:=0;
end if;
---------------------------------------------
Select Sum(dedvalue)Into limded From Emp_Limilteddeduction
Where Empid= Emp_Id;
if limded is not null then
limded:=limded;
else
limded:=0;
end if;
71 | P a g e
-----------------------------------------------
Begin
Select Paymentvalue Into sanctinded From Absent
Where Empid= Emp_Id;
EXCEPTION
when no_data_found then
sanctinded:=0;
End;
------------------------------------
begin
Select withsalary Into WS From EMP_STATE
Where Empid= Emp_Id;
EXCEPTION
when no_data_found then
ws:='N';
end;
-------------------------------------------
Select Sum(impvalue)Into impadd From Emp_Impulse
Where Empid= Emp_Id;
if impadd is not null then
impadd:=impadd;
else
impadd:=0;
end if;
------------------------------------------
if ws='N' then
DBMS_OUTPUT.PUT_LINE('hhh');
ELSE
Bas:= base+(base*9/100);
---------------------right calc for entitilements--------------------------
b_ssdeath :=(bas *15)/100;
b_workacc :=(bas *1)/100;
b_endgift :=(bas *2)/100;
b_insur :=(bas *3)/100;
t_ssdeath :=(temp *15)/100;
t_workacc :=(temp *1)/100;
govern_tot := b_ssdeath + b_workacc + b_endgift + b_insur + t_ssdeath
+ t_workacc ;
72 | P a g e
-------------------Entitelmenties Calc--------------------------
ent_tot := govern_tot + Impadd + wage + com + counter;
-----------------------left calc for deductions-------------------
b_sav_ssdeath :=(bas *10)/100;
b_sav_giftsys :=(bas *3)/100;
b_sav_against :=(bas *1)/100;
t_sav_ssdeath := (10 *temp)/100;
job_tot := b_ssdeath + b_workacc + b_endgift + b_insur + b_sav_against
+ b_sav_giftsys + b_sav_ssdeath;
com_tot := t_ssdeath + t_workacc + t_sav_ssdeath;
------------------------stamp calc---------------------------
stemp := Wage + Com + Counter - ((Base*14/100)+(Temp*10/100));
stemp:= stemp-50;
If stemp <=250 and stemp>50 Then
stamp :=stemp*6/1000;
else If stemp <=500 and stemp>250 Then
stamp :=stemp*65/10000;
else If stemp <=1000 and stemp>500 Then
stamp :=stemp*7/1000;
else If stemp > 1000 Then
stamp :=stemp*75/10000;
End If;
End If;
End If;
End If;
---------------------- taxes calc-------------------------------
xtemp := Wage + Com + Counter - ((Base*14/100)+(Temp*10/100)) -
Stamp;
If xtemp <= 1125 Then
Taxes := 0;
Else
xtemp:=xtemp-1125;
If xtemp <=1985 and xtemp>1125 Then
taxes:=xtemp*10/100;
else
xtemp:=xtemp-1958;
taxes:=1958*10/100;
If xtemp <=3208 and xtemp>1958 Then
taxes:= taxes+(xtemp*15/100);
73 | P a g e
else
xtemp:=xtemp-3208;
taxes:=taxes+(3208*15/100)+(xtemp*20/100);
end if;
end if;
end if;
---------------------------deuction calc------------------------------
ded_tot := job_tot + com_tot + stamp + Taxes + Insded +Limded+
Sanctinded+Staticded;
------------------------------ sal calc-------------------------
sal := ent_tot - ded_tot ;
----------------------- insert in Monthly---------------------------------
INSERT INTO MONTHLYSALARY
(MSALID, EMPID, BASICSALARY, WAGEJOB,
COMPLEMENTARYWAGE, COUNTERVALINGINCELTIVE,
BSSDEATH, BWORKACCIDIENT, BENDGIFT, BINSURANCE,
TSSDEATH, TWORKACCIDIENT, IMPADD, GOVERNTOTAL,
BSSDEATH1, BWORKACCIDIENT1, BENDGIFT1, BINSURANCE1,
BSAVSSDEATH, BSAVGIFTSYS, BSAVAGAINSTSICK, JOBTOTAL,
TSSDEATH1, TWORKACCIDIENT1, TSAVSSDEATH, COMTOTAL,
LIMITDED, INSDED, STATICDED, SANCTIONDED, TAXES, STAMP,
DEDTOTAL, ENTTOTAL, SALARY, MONDATE
)
VALUES
(null, Emp_Id , Base , Wage , Com , Counter ,
B_Ssdeath , B_Workacc , B_Endgift , B_Insur , T_Ssdeath ,T_Workacc
, Impadd , Govern_Tot ,
B_Ssdeath , B_Workacc , B_Endgift , B_Insur , B_Sav_Ssdeath ,
B_Sav_Giftsys , B_Sav_Against , Job_Tot ,
T_Ssdeath , T_Workacc , T_Sav_Ssdeath , Com_Tot ,
Limded , insded , Staticded , Sanctinded , Taxes , Stamp ,
Ded_Tot , Ent_Tot , Sal , Ssdate );
end if;
END MONTHLY_INSERT_PRO;
/
74 | P a g e
SUMMARY
We finished the third phase of our system and our project specification ready now.
We can go to the implementation phase that focus on delivery and support of
completed system.
75 | P a g e
P A R T_F O U R
IMPLEMENTATION PHASE
The final phase in the SDLC is the implementation phase, during which the
system is actually built (or purchased, in the case of a packaged software design).
At the end of implementation, the final system is put into operation and supported
and maintained.
OBJECTIVES
Moving into Implementation
Transition to the New System
76 | P a g e
Moving into Implementation
Introduction to Development Cycle
Oracle ADF is an end-to-end development framework, built on top of the
Enterprise Java platform.
The framework provides integrated infrastructure solutions for the various
layers of the application and an easy way to develop on top of them.
Why we use Oracle Application Development Frameworks in our
Information System?
Provide Simple User interface design We use Alta UI Skinning interface that helps to get more easily User
Interface for end users.
Speeds up application development Oracle ADF reduces time and cost for end users by rapid development
depend on MVC Design Pattern.
MVC Design Pattern Oracle ADF implements the Model-View-Controller design pattern and
offers an integrated
solution that covers all the layers of this architecture.
Integrated Security Security can be implemented at various layers within the application to
achieve the desired security goals.
Rich web based interface Oracle ADF components provide data interaction, data visualization.
Enhanced reusability
allow you to package up and share various framework artifacts and
business components into simple distributable archives.
Data Binding ADF provides a data-binding framework that simplifies binding UI to
business services through
a simple drag and drop operations in the IDE. This is done while still
keeping the independence of business services
77 | P a g e
1.How to connect to Database in Oracle ADF?
First, we choose the desired application to connect from applications
menu. Then we
You must know the following information: hostname, port, and SID or service name
2.Username and password. There is advantage for database connection in Oracle ADF that is you can
create it directly in the application or create it is an IDE resource and then
copy it to your application, you can change the details of your application
database connection at any time.
3-Build Application Business Services (Create Model step in MVC)
3.1 Create Entity Objects and Associations We have our database schema and have identified the tables that will be
used inside our application
78 | P a g e
What are the Entity Objects Advantages?
Handle data modification and encapsulate business logic, must
create entity object for each database table that application will use.
Represents a database table such as “employee” or other data
source.
Contains attributes representing the database columns.
Can contain custom business methods.
What are The supporting Java Classes in Entity object?
EntityImpl
1. The entity class
2. Represents a row of data
3. Provide getter and setter methods
EntityDefImpl
1) The entity definition class
2) Represents the whole entity
3) Can be used to modify the entity definition
EntityCollImpl
1. It is not necessary to modify or override this class
79 | P a g e
What are the two files generated for the entity object?
Entity.xml: Metadata
1- Obtains all of its information from this file.
EntityImpl.java: Entity Object Class
1) extends the entityImpl class
2) Includes setter and getter methods for attributes
How to Control Hints and Validation?
Declarative validation rules for data controls and bindings:
1. extensible for complex application validation
2. Metadata based.
Control hints for data controls and binding including:
1. Labels.
2. Date, phone number and currency format.
80 | P a g e
Where to Put Validation?
There are a number of places you can put validation:
Custom method validators
Setter methods
Call the EntityImpl Methods
For example: doDML() – log changes in another entity
Defined Validation Error massage:
81 | P a g e
Associations are relationship between entity objects which reflect the
foreign key in the database.
• Facilitate access to data in related entity objects
• May be based on database constraints
• May be independent of database constraints
• Consist of a source (master) and a destination (detail) entity
3.2 Create View Objects and View links We create Entity objects and association before this step because view
objects may depend on entity objects
View object represents SQL query; a view object should query the data
needed for UI screen.
82 | P a g e
What are the advantages of View objects?
• Present a view or slice of business data
• Are used for joining, filtering, projecting, and sorting your
business data
• Can be based on any number of entity objects
• Can also be constructed from a SQL statement
What are the Classes Related to View Objects?
• ViewObjectImpl
– This is the view object class.
– It represents a view object.
– Use this class to add or override behaviors that apply to
the view object.
• ViewRowImpl
– It represents a row in a view object.
– Use this class to add or override behaviors that apply to
a row within the view object.
View link is used to join two views that used to relate data in UI screens.
• A view link is an active link between view objects.
• You can create view links by providing the following:
– Source and destination views
– Source and destination attributes
83 | P a g e
3.3 Create Application Module Application Modules are for packaging and deploying the view objects
and business services of an application and it’s used in transaction
management.
View Objects in the Application Module
• Consists of the set of views and view links in
the application
• Can contain unrestricted (master) views and restricted (detail)
views
84 | P a g e
What are the Application Module Files?
• <AppMod>.xml: Includes detailed metadata about the View
Objects included
• <AppMod>Impl.java: Contains all the methods and behaviors
• <AppMod>.java: Declares all custom methods
• bc4j.xcfg: Contains all the configuration and connection details
What are Application Module Transactions?
• Transactions manage database interaction.
• Transactions are treated as an atomic unit
• Validation occurs when the transaction state changes or just
before posting.
85 | P a g e
Data Binding First there are some information should be known about Oracle ADF
Model
ADF Model:
• Provides a wrapper and abstraction for business services
• Enables you to work the same way with any UI and any
business service
• Decouples UI from back-end business services
• Provides drag-and-drop data binding
Data Control Palette
• It is a visual representation of your business services that
contain:
– View Objects
– Methods
– Parameters and results
– Attributes
– Built-in operations
• Enables drag and drop to the UI
86 | P a g e
Bindings • Define the interaction between a view or controller component
and the data control
• Are created automatically when you drag a component from
the Data Control Palette onto a page or panel
• Can also be created in the Structure window
What are the Generated Files in the View Project?
When data bindings are created, two files are generated in the UI
project:
• Binding context definition file
– DataBindings.cpx
– Maps pages to page definitions, declares data control
usages.
87 | P a g e
• Page definition file
– xxxPageDef.xml
– Defines all the bindings for a page
– Created automatically when you add a data-bound
component to a page.
Expression Language (EL) and Bindings
• Databinding expressions are written using EL.
• Makes it possible to easily access application data stored in
JavaBeans components
• EL is evaluated at run time to determine what data to display.
• ADF EL expressions typically have the form:
#{bindingVariable.BindingObject.propertyName}.
• Example of an input Text component in a JSF page:
88 | P a g e
4. Design Application Flow (Create Control step in MVC)
4.1 create task flow A task flow defines the control flow in application, an application contains
one unbounded task flow called “adfc-config.xml”, which defines the
high level flow of application, each task flow may be composed of pages or
page fragments, choose pages if the task flow will be run standalone or
choose page fragments if a task flow will be embedded in a JSF page as a
region.
In our application we create one unbounded task flow called ADF_menu
that contains our pages
And backing bean for each page
89 | P a g e
5. Design Pages
5.1 Create Page Template (is optional) Page templates contain layouts and components that will be used by any
pages that consumes the template. In template you should define the skin
for your application and modify the layout.
To facilitate the UI to end user should have menu with the most used
pages in Application
90 | P a g e
ADF Faces Skins
• Alta UI (default), Minimal, and Simple
• CSS file using CSS 3.0 syntax
• Defined in trindad-config.xml
Note that to appear our application from “right to left”
Because it depends on Bidirectional language “Arabic”
We add this code at line 5.
5.2 Create Pages After creating task flow and page template, you should create your pages
In ADF Fusion web application, pages are built using Java Server Faces
(JSF) technology.
To create the page correctly, this information should complete
-Specify name and directory location.
-Decide whether backing bean is needed or not.
-Decide which template is used to the page.
91 | P a g e
5.3 Add components to pages When you begin adding JSF components to your page, you use the
components palette and Data control panel, you use the Data Control
panel to create data bound components directly.
One of most important things is List of Values (LOV)
Two types of select lists:
• Dynamic
– Based on SQL query
– Requires supporting view object
• Static: Hard-coded values
92 | P a g e
Edit to specify
• Attribute
• its name
• List Data Source
• List Attribute
• List return values.
This screen appears how end user will see the attribute?
At this example, choose to see it in “Choice list” Type.
Add Navigation Buttons to Page.
93 | P a g e
6. Implement Business Logic (Validation Rules)
Oracle ADF Validation Rules are created on entity objects. There are a
number of validation rules that you create declaratively, you can create
validation rules using Java code or base validation on a Groovy
expression, when we create validation rule you can provide a custom error
massage.
94 | P a g e
Transition to the New System From the previous phases and the introduction of development cycle
we now will present our system we here will present the system
interface, outputs and security.
System Interface
1. Template Design This our template which all the views will used its style to
run only the content will change.
2. Employee Views Here we will list the views that belong to the employees
in organization and their data.
o The table of employee date
95 | P a g e
o Popup menu to add data for an employee
o Popup menu to list additional data for an employee
96 | P a g e
o To add a new employee
o To add absent days and payment value for an
employee
97 | P a g e
o To add impulse value for an employee
o To add insurance deduction value for an employee
98 | P a g e
o To add static deduction value for an employee
o To add limited deduction value for an employee
99 | P a g e
o List of all states that can be assigned to employees
o List of all degrees in organization
100 | P a g e
o List of all departments in organization
3. Deduction Views Here we will list the views that belong to the deductions
and impulse related to organization and their data.
o List of all insurance deduction in organization
101 | P a g e
o List of all static deduction in organization
o List of all limited deduction in organization
102 | P a g e
o List of all impulse in organization
4. Bank Views Here we will list the views that belong to the banks and
their branches related to organization and their data.
o List of all banks related to organization
103 | P a g e
o List of all banks branches related to organization
5. Salary Views Here we will list the views that belong to the employees'
salaries.
o List of monthly salaries of employees
104 | P a g e
o Popup menu for details of an employee salary
o List of yearly salaries of employees
The same view of monthly salary except data
o Archive of yearly salaries of employees
The same view of yearly salary except data
6. Quick Links This links to help user to move quickly between views.
105 | P a g e
System outputs
Reports 1. Introduction to our tool
In this chapter we will cover the process of generating system's
reports like Monthly Salary as an example, and we will cover
the used tools in this process like itext for pdf reports.
2. ITEXT TOOL: The itext is a jar file (library) that used to generate PDF reports
in somehow, itext is simple to be used and simple to be
compiled as you don't have to install another program to run or
generate the reports, just create your custom code and then
run it in your environment by java, In itext you can easily add
images, tables, and other components that are used in reports.
In itext you can add sql statements and you are able to use
Java variables and parameters , and only programmers are
able to modify and customizes its code , this is why we are
using itext.
3. USING ITEXT: First, you have to add some jar files shown below to be able to
use itext:
Second step you have to make some imports in the project like
those shown below:
Third step is starting to design your report and its fonts … etc.
This is an example for a report we made using itext: (Monthly
Report) the final structure of our report:
106 | P a g e
The head of the page used a code shown below to generate it:
then
107 | P a g e
We used the next code to make the first table and add it to the
pdf:
We used the next code to make the second table and add it to
the pdf:
We used the next code to make the third table and add it to the
pdf:
108 | P a g e
AND SO ON to reach the final shape
On other example is The bank salaries Report:
By the same way we designed this report and other reports.
ITEXT is a simple art and easy tool.
4. Our system output:
109 | P a g e
110 | P a g e
System Security
The final step in development is Application security:
This chapter describes how you can enable ADF Security in the
Fusion web application to define resource grants for Oracle
Application Development Framework (Oracle ADF) resources and to
restrict the user's ability to view web pages associated those
resources.
The ADF Security framework is the preferred technology to provide
authentication and authorization services to the Fusion web
application. ADF Security is built on top of the Oracle Platform
Security Services (OPSS) architecture, which itself is well-integrated
with Oracle WebLogic Server that is used to deploy the application.
While other security-aware models exist that can handle user login
and resource protection, ADF Security is ideally suited to provide
declarative, permission-based protection for ADF bounded task flows,
for top-level web pages that use ADF bindings (pages that are not
contained in a bounded task flow), and at the lowest level of
granularity, for rows of data defined by ADF entity objects and their
attributes.
You enable ADF Security for Fusion web applications when you run the Configure ADF Security wizard. The wizard configures ADF Security for the entire Fusion web application, so that any web page associated with an ADF security-aware resource is protected by default. This means that after you enable ADF Security, your application is locked down so that the pages are considered secure by default. After you enable ADF Security you must grant users access rights so that they may view the web pages of the Fusion web application. Access rights that you grant users are known as a security policy that you specify for the page's corresponding ADF security-aware resource. Ultimately, it is the security policy on the ADF resource that controls the user's ability to enter a task flow or view a web page. Because ADF Security is based on Java Authentication and Authorization Service (JAAS), security policies identify the principal (the user or application role), the ADF resource, and the permission (an operation defined by the resource's ADF permission class).
Specifically, you will define security policies in the Fusion web application for the following ADF security-aware resources to make web pages accessible to users:
1 - ADF bounded task flow protects the entry point to the task flow, which in turn controls the user's access to the pages contained by the flow.
111 | P a g e
2 - ADF page definition files associated with web pages.
3 - ADF entity objects and attributes of entity objects that reference rows of data and help define collections for display in the user interface.
The ADF Security model for securing Fusion web application resources is not based on the URL mapping of a security constraint as exemplified by the Java EE security model. In actual practice, security constraints are not feasible for securing a Java Server Faces (JSF) web application. Instead, ADF Security implements a Java Authentication and Authorization Service (JAAS) security model. The JAAS model is policy-based since JAAS is built on the existing Java security model and integrates with any JAAS implementation, including the Oracle Platform Security Services (OPSS) implementation of the JAAS service. Whereas applications that utilize URL security constraints are security-unaware because they rely on the Java EE container to manage security, Fusion web applications require an explicit call to the ADF Security framework to authorize access to resources based on user-defined policies.
ADF Security simplifies the implementation of a JAAS authorization model. This implementation minimizes the work needed to create a security-aware application by exposing security policies on ADF resources in a declarative fashion and performing permission checks on these resources at runtime.
ADF Security Process Overview:
As you create the user interface for your application, you may run the Configure ADF Security wizard at any time. You may choose to:
Iterate between creating web pages in the UI project and defining security policies on their associated ADF resources
Complete all of the web pages in the UI project and then define security policies on their associated ADF resources
Design Phase
To enable ADF Security and set up the policy store in JDeveloper:
1. Enable ADF Security for the application by running the Configure ADF Security wizard. The wizard configures files that integrate the security framework with OPSS on Oracle WebLogic Server.
112 | P a g e
2. Create an ADF security-aware resource, such as a bounded task flow with constituent web pages (or regions) or a top-level web page (or region) that is designed using ADF bindings.
Note: After you run the Configure ADF Security wizard, any web page associated with an ADF security-aware resource will be protected. This means that you must define security policies to make the web pages accessible before you can run the application and test security.
3. Associate the ADF security-aware resource with one or more application roles that you create. Application roles you create are specific to the application and let you confer the same level of access to a set of users (also known as member users). In the test phase you will create some users and add them as members to the application roles you created.
113 | P a g e
4. Grant view permission to the ADF security-aware resource and each of its associated application roles. The grant confers access rights to the application role's member users. Without the grant, the user would not be able to access the ADF security-aware resource. In the test phase, you will create some users and add them to your application roles.
Testing Phase
To provision the identity, store and test security using Integrated WebLogic Server:
1. Create some users and, optionally, create their enterprise roles.
You will log in to the application using the user ID and password you define. An enterprise role is a logical role that lets you group users and associate these groups with application roles. The enterprise role is not needed for testing. To create users.
114 | P a g e
Create enterprise roles and assign members.
2. Associate the users you created and, optionally, the enterprise roles, with one or more application roles. A member user may belong to more than one application role when you wish to confer the access right granted to multiple application roles.
3. Optionally, replace the default login page with a custom login page. The default login page generated by the Configure ADF Security wizard cannot utilize ADF Faces components. It is provided only as a convenience for testing ADF security policies.
4. Run the application in JDeveloper and access any ADF security-aware resource. The first time you attempt to access an ADF security-aware resource, the security framework will prompt you to log in.
5. Log in and check that you are able to access the page and its resources as you intended. After you log in, the security framework checks the user's right to access the resource. For example, if you receive an unexpected 401 unauthorized user error, verify that you have created grants as suggested.
Difference between enterprise and application roles:
An enterprise role is a role that is maintained in the domain policy store (as opposed to an application policy store). Enterprise roles are available to every application deployed in the domain and defined in the domain identity store, typically represented by an ordered list of authenticators configured in the domain. An application role is a role used by a Fusion web application. It is specific to the application, defined by the application policy, and not necessarily known to the Java EE container. Application roles are scoped in the sense that they can contain only users and roles defined in the application. Application roles must be mapped to enterprise roles.
115 | P a g e
Preparation for Staging
To prepare the secure application for deployment to Oracle WebLogic Server in a staging or production environment:
1. Remove any grants to the test all role for all ADF security-aware resources and replace with grants that you define. Because ADF resources are secure by default, developers testing the application will be granted view access only after security policies are defined. The Configure ADF Security wizard gives you the option to generate grants to the test all role that will make all ADF resources accessible. To avoid compromising enterprise security, you must eventually replace all temporary grants to the test all role with explicit grants that you define.
2. Confirm that the application roles shown in the policy store are the ones that you want an administrator to eventually map to domain-level groups.
3. Migrate the finalized policy store and credentials store to the target server. Application policies and credentials can be automatically migrated to the domain policy store when the application is deployed to a server in the Oracle WebLogic environment. Support to automatically migrate these stores is controlled by the target server's configuration. If Oracle Enterprise Manager is used to perform the deployment outside of JDeveloper, then the migration configuration settings can be specified in that tool.
How to enable ADF SECURITY?
The Configure ADF Security wizard allows you to choose to enable authentication and authorization separately. You may choose to:
Enable only user authentication.
Although ADF Security leverages Java EE container-managed security for authentication, enabling authentication means that you want to use the ADF authentication servlet to support user login and logout, but that you intend to define container-managed security constraints to secure web pages.
Enable user authentication and also enable authorization.
Enabling authorization means you intend to control access to the Fusion web application by creating security policies on ADF resources and maintain right access.
116 | P a g e
1. From the Application menu, choose Secure, Configure ADF Security.
2. In the ADF Security page, leave the default ADF Authentication and Authorization option selected. Click Next.
In this page we have three options.
ADF Authentication and Authorization (default) enables the ADF authentication servlet so that you can redirect to a configured web page when the user logs in and logs out. This option also enables ADF authorization to enforce permission checking against security policies that you define for ADF resources. This option assumes that you will define application roles and assign explicit grants to those roles to manage access to ADF security-aware resources.
ADF Authentication enables the ADF authentication servlet to require the user to log in the first time a page in the application is accessed and supports page redirect by mapping the Java EE application root "/" to a Java EE security constraint that will trigger user authentication.
Remove ADF Security Configuration disables the ADF authentication servlet and prevents ADF Security from checking policy grants without altering the existing policy store.
117 | P a g e
3. In the Authentication Type page, select the authentication type that you want your application to use when the user submits their login information. Click Next. select Form-based Authentication, you can also select Generate Default Pages to allow the wizard to generate a default login and error page.
4. In the Automatic Policy Grants page, leave the default No Automatic Grants option selected. Click Next When you select No Automatic Grants, you must define explicit grants that are specific to your application. The test all application role provides a convenient way to run and test application resources without the restricted access that ADF authorization enforces. However, it increases the risk that your application may leave some resources unprotected.
118 | P a g e
5. the Authenticated Welcome page, select Redirect Upon Successful Authentication to direct the user to a specific web page after they log in. Click Next.
6. In the Summary page, review your selections and click Finish.
After you run the Configure ADF Security wizard with the default ADF Authentication and Authorization option selected in the ADF Security page, you will have:
Enabled ADF authentication to prompt the user to log in and to allow page redirects
Enabled ADF permission checking so that only authorized users will have access to ADF resources
The wizard updates all security-related configuration files and ensures that ADF resources are secure by default. These files the Configure ADF Security wizard updates.
Web.xml Adf-config.xml Jps-config.xml Weblogic.xml Jazn-data.xml
119 | P a g e
7. Creating application roles:
You create application roles to represent the policy requirements of the application and to define groups of users with the same view permission rights. The application roles that you create in the application policy store are specific to your application.
8. Grant permissions to the application roles. 9. Associate test users with each application role. 10. Test.
How Granting resources?
1. From the Application menu, choose Secure > Resource Grants. 2. In the Resource Grants page of the jazn-data.xml file overview
editor, select one of the following resources from the Resource Types dropdown list:
Task Flow, web page, ADF Method, ADF entity object, ADF entity object attribute, ADF Rest Resource
3. In the Resources column, select the ADF resource for which you want to grant access rights.
4. In the Granted to column, click the Add Grantee icon and choose Add Application Role.
5. In the Select Application Roles dialog, select one of application role.
Application roles have built in role
anonymous-role means the resource will be accessible to anyone who visits the site.
authenticated-role means the resource will be accessible only to authenticated users (ones who visit the site and log in)
6. In the Select Application Roles dialog, click OK. 7. In the Resource Grants page of the overview editor, in
the Actions column, leave the View action selected.
By default, the overview editor shows view selected. The view action is the only action implemented for Fusion web applications. The actions customize, grant, or personalize are implemented for page definition security in Oracle Web Center Portal: Framework applications or custom applications that are enabled to use Oracle Web Center Portal's Composer
120 | P a g e
How ADF handle authentication?
the authentication process when users attempt to access an ADF bounded task flow or any web page containing ADF bindings (such as mypage.jspx) without first logging in. Authentication is initiated implicitly because the user does not begin login by clicking a login link on a public page. In the case of the secured page, no grants have been made to the anonymous user.
the implicit authentication process assumes that the resource does not have a grant to anonymous-role, that the user is not already authenticated, and that the authentication method is Form-based authentication. In this case, the process is as follows:
1. When the bounded task flow or web page (with ADF bindings) is requested, the ADF bindings servlet filter redirects the request to the ADF authentication servlet (in the figure, Step 1), storing the logical operation that triggered the login.
2. The ADF authentication servlet has a Java EE security constraint set on it, which results in the Java EE container invoking the configured login mechanism (in the figure, Step 2). Based on the container's login configuration, the user is prompted to authenticate:
a. The appropriate login form is displayed for form-based authentication (in the figure, Step 2a).
121 | P a g e
b. The user enters his credentials in the displayed login form (in the figure, Step 2b).
c. The user posts the form back to the container's j-security-checks() method (in the figure, Step 2c).
d. The Java EE container authenticates the user, using the configured pluggable authentication module (in the figure, Step 2d).
3. Upon successful authentication, the container redirects the user back to the servlet that initiated the authentication challenge, in this case, the ADF authentication servlet (in the figure, Step 3).
4. On returning to the ADF authentication servlet, the servlet subsequently redirects to the originally requested resource (in the figure, Step 4).
How ADF Security Handles Authorization? When ADF authorization is enabled, the ADF bounded task flows and web
pages outside of a task flow that have an ADF page definition will be
secure by default. When a user attempts to access these web pages, ADF
Security checks to determine whether the user has been granted access in
the policy store. If the user is not yet authenticated, and the page is not
granted to the anonymous-role, then the application displays the login
page or form. If the user has been authenticated, but does not have
permission, a security error is displayed. If you do not configure the policy
store with appropriate grants, the pages will remain protected and
therefore stay unavailable to the authenticated user.
The user is a member of the application role staff defined in the policy store. Because the user has not yet logged in, the security context does not have a subject (a container object that represents the user). Instead, Oracle Platform Security Services provides ADF Security with a subject
122 | P a g e
with the anonymous user principal (a unique definition of the user) and the anonymous -role principal.
When the user tries to access a web page defined by an ADF resource, the ADF Security enforcement logic intercepts the request and because all ADF resources are secured by default, the user is automatically challenged to authenticate
After successful authentication, the user will have a specific subject. The security enforcement logic now checks the policy store to determine which role is allowed to view page and whether the user is a member of that role.
Similarly, when the user tries to access page, another page defined by ADF resources, for which the user does not have the necessary view privilege, access is denied.
Users and roles are those already defined in the identity store of the resource provider. Application roles are defined in the policy store of the jazn-data.xml file.
Practical example on our application
Firstly, configure ADF security wizard. Select ADF Authentication and Authorization option, then select form-based authentication and mark generate default pages (login and error), select No Automatic Grants, don't select redirect page and finish.
Secondly, Create Application roles to deal with resources and assigning these roles to these resources and select action for every role.
Create application roles:
Assign roles to resources and define actions:
123 | P a g e
Thirdly, create enterprise roles and mapping them to application roles and create users and associated them to enterprise roles.
Enterprise roles
Users
We can map users to application roles directly, but we want to follow the logic steps.
124 | P a g e
SUMMARY
We finished the last phase of our system and our system is installed now. We now
have to support our system, solve our user problem with the system in the future
and work on develop the project by adding new features to it.