Advanced Programming Project: Payroll System Design

Verified

Added on  2025/05/02

|27
|3024
|318
AI Summary
Desklib provides solved assignments and past papers to help students succeed.
Document Page
ADVANCED PROGRAMMING
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Contents
Introduction......................................................................................................................................3
LO1 Examine the key components related to the object-orientated programming paradigm,
analysing design pattern types.........................................................................................................4
P1 Examine the characteristics of the Object-orientated paradigm as well as the various class
relationships.................................................................................................................................4
M1 Determine a design pattern from each of the creational, Structural and behavioural pattern
types.............................................................................................................................................5
D1 Analyse the relationship between the object-orientated paradigm and design patterns........6
LO2 Design a series of UML class diagrams..................................................................................7
P2 Design and build class diagrams using a UML tool...............................................................7
M2 Define class diagrams for specific design patterns using a UML tool..................................7
D2 Define/refine class diagrams derived from a given code scenario using a UML tool...........7
LO3 Implement code applying design patterns...............................................................................8
P3 Build an application derived from UML class diagrams........................................................8
M3 Develop code that implements a design pattern for a given purpose....................................8
D3 Evaluate the use of design patterns for the given purpose specified in M3...........................8
LO4 Investigate scenarios with respect to design patterns..............................................................9
P4 Discuss a range of design patterns with relevant examples of creational, structural and
behavioural pattern types.............................................................................................................9
M4 Reconcile the most appropriate design pattern from a range with a series of given
scenarios......................................................................................................................................9
D4 Critically evaluate a range of design patterns against the range of given scenarios with
justification of your choices.........................................................................................................9
Document Page
Figure 1: OOPS................................................................................................................................5
Figure 2: Structural design pattern..................................................................................................7
Figure 3: Class diagram for payroll application..............................................................................9
Figure 4: Example of Class diagram.............................................................................................10
Figure 5: Adapter...........................................................................................................................11
Figure 6: Composite......................................................................................................................12
Figure 7: Façade............................................................................................................................12
Figure 8: Decorator........................................................................................................................13
Figure 9: Proxy..............................................................................................................................14
Figure 10: Homepage of payroll system........................................................................................15
Figure 11: Salaried account...........................................................................................................15
Figure 12: Salaried account details................................................................................................16
Figure 13: Commission based employee.......................................................................................16
Figure 14: Hourly based employee................................................................................................17
Figure 15: Code 1..........................................................................................................................18
Figure 16: Code 2..........................................................................................................................18
Figure 17: Code 3..........................................................................................................................19
Figure 18: Code 4..........................................................................................................................20
Figure 19: Code 5..........................................................................................................................20
Figure 20: Code 6..........................................................................................................................21
Figure 21: Code 7..........................................................................................................................21
Figure 22: Code 8..........................................................................................................................22
Figure 23: Code 9..........................................................................................................................22
Figure 24: Code 10........................................................................................................................23
Document Page
Introduction
The advanced programming is a programming method which contains large varieties of the
programming languages. The object-oriented programming is also advanced programming which
uses the objects and the classes to develop programs by appropriate coding. Object-oriented
programming is widely used for making applications which are serving different purposes. As
stated in the scenario. Automatic calculation of the salaries of the employees is done by making
use if the payroll application which the requirement of the solution to this problem. The salary
will be calculated automatically by the application as per the three categories of the employees.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
LO1 Examine the key components related to the object-orientated
programming paradigm, analysing design pattern types
P1 Examine the characteristics of the Object-orientated paradigm as well as the
various class relationships
Object-oriented programming which is well known by the name of OOPS. It is a programming
language in which both data structures and data types are defined when the function's type is
defined. This programming language is related to objects as well as the class. The program is
developed with objects and classes. There are many properties of object-oriented programming.
The main features of object-oriented programming are polymorphism, abstraction, and
encapsulation. There are many benefits of object-oriented programming. It is very simple and
therefore its concept can be understood in a very easy manner. All the objects in objects oriented
programming are independent which results in improving the modularity of the OOPS program.
By using the object-oriented programming good programs can be developed which is having
very less error. Also, these programs can also become part of the other programs which is
combined with them in order to make a new program (javatpoint, 2019).
Figure 1: OOPS
(Source: Guru99, 2019)
The basic features of this object-oriented programming are explained as:
Encapsulation: It is a technique by using which the data and the code are combined or
wrapped in a single class. In other words, both the data members and functions are
wrapped up. This feature of the object-oriented programming helps in preventing the
showcase of the variables of one class to another one. Only by taking the help of the
Document Page
functions, data can be accessed. It is not possible to use the data without making use of
the functions. The other advantage of this encapsulation is that it assists in data hiding. It
is very essential to make the data members private so as encapsulation can be achieved.
Polymorphism: The basic concept of the polymorphism is that there exist multiple
functions which are having similar names but their functionalities are different or they
work is different. There are two different kinds of polymorphism. The first one is the
static polymorphism and the second one is the dynamic polymorphism. The basic
difference between static and dynamic polymorphism is memory allocation. When the
process of memory allocation is done during the real-time, then it is considered to be the
dynamic polymorphism but when the process of memory allocation is done during the
compile time, then it is said to be the process of static polymorphism (Tutorialdost,
2019).
Abstraction: Abstraction is one of the most essential characteristics of object-oriented
programming. The concept of abstraction speaks that only the important features and the
functionalities of the application is depicted and the details are hidden (javatpoint, 2019).
Inheritance: The process of acquiring the feature and the properties of the other object
(parent). It is very easy to make a new class from the class which is already present in the
program. The class from which the properties have been derived in order to create a new
class is called the parent class. On the other hand, a new class which is generated by
making use of the parent class is termed as the child class. This feature will help in saving
the time of the developer as there is no need to write the code again and again as it can be
reused whenever required. The child class is also called by another name i.e. derived
class. The child class has properties which are present in the base class and thus it can
perform the functions which the base class can (Guru99, 2019).
Class relationships: There are many different kinds of class relationships are there which are
mentioned as follows:
Association: The type of relationship in OOPS which exists between two different
objects is termed as the association. The association relationship can be made either
by one to one strategy or by many to many relationships. The concept of one to many
and many to one can also be utilized to make associations.
Composition: The aggregation when restricted or limited, then it is categorized as the
composition relationship. And this reason it is also considered as the special form of
the relationship called aggregation.
Aggregation: The association which is directional in nature is known as the
association. It is also known by the term: Has-a relationship (GeeksforGeeks, 2019).
M1 Determine a design pattern from each of the creational, Structural and
behavioural pattern types
There are mainly three types of design patterns:
Document Page
1. Structural design pattern
2. Behavioral design pattern
3. Creational design pattern
Structural design pattern: The design pattern in which the lengthy structures are developed by
making use of the individual classes. Various objects, as well as the classes, are developed in
such a manner so that it becomes very easy to make the long structures from them. The most
important feature of object-oriented programming, which is an inheritance, is used to form the
interfaces. Various class libraries can be developed by using the structural design pattern
(Gofpatterns, 2019). The various things which are used to make the structural design pattern:
Composite: The tree-like structure which is made up of composite objects as well as the
simple objects.
Façade: When only one class is used to show the complete subsystem.
Adapter: It is used to interlink the various interfaces of the classes.
Other are Flyweight, Bridge, Proxy, Decorator, etc. (Sourcemaking, 2019).
Figure 2: Structural design pattern
(Source: C-sharpcorner.com, 2019)
Behavioral design pattern: This type of design pattern is used to demonstrate the relationship
between different objects. The basic concept is that’s the way of interaction and the
communication between different objects is targeted. This helps in simplifying the flowcharts
which are very complex and then the relation between the objects is depicted by simple
interconnections. This can also be used to make the algorithms. It does not only contain the
pattern of the objects present in different classes but it also describes the interaction between
them. Therefore, it deals with the communication between objects.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Creational Design pattern: As the name suggests, the creational design pattern is utilized to
create or develop the classes. These classes will be used in the solution. This is also used when
the concept of polymorphism is implemented and one is to be chosen from the compile time and
the run time polymorphism. Objects can be easily created by using this design pattern and the
need to identify the class type is also eliminated and also the complex and the lengthy work of
writing the code again is prevented (Gofpatterns, 2019)
D1 Analyse the relationship between the object-orientated paradigm and design
patterns
An object-oriented paradigm is a form or method of approaching or developing the program. The
object-oriented paradigm in which different objects are used to generate the program. These
objects in the programs consist of various data and the other codes & behaviors which are
sequentially programmed in order to make a program for solving the required problem. On the
other hand, Design patterns are just a solution which is used again and again in the program
where ever the errors are identified. These design patterns cannot be directly implemented in the
codes of the program. It just explains how to approach the problem and its appropriate solution
in the form of templates (Hancock, 2019).
Document Page
LO2 Design a series of UML class diagrams
Figure 3: Class diagram for payroll application
P2 Design and build class diagrams using a UML tool.M2 Define class diagrams for
specific design patterns using a UML tool
The static diagrams and the structure diagrams which contributes to explaining the system.
These also demonstrate the classes present in the system. The relationships between the various
attributes as well as the objects can be defined by using it. It also assists in modeling the objects.
These diagrams show how the application will look when it will be static. The codes which are
implemented can also be generated by using them. Different attributes which the class posses
along with the4 constraints in them is also explained. These diagrams can be used to directly
map the OOPS and its modeling. Thus the static view is represented by it. Also, these are widely
used when the programming or coding is done. Class diagrams for different patterns are depicted
below:
Document Page
Figure 4: Example of Class diagram
(Source: vince, 2019)
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Figure 5: Adapter
(Source: vince, 2019)
Document Page
Figure 6: Composite
(Source: vince, 2019)
Figure 7: Façade
(Source: vince, 2019)
chevron_up_icon
1 out of 27
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]