Advanced Programming Project: Payroll System Design and Implementation

Verified

Added on  2025/05/02

|37
|2261
|231
AI Summary
Desklib offers solved assignments and past papers to help students succeed.
Document Page
ADVANCED PROGRAMMING
1
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
Table of Contents
Introduction.................................................................................................................................................3
LO1.............................................................................................................................................................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...7
LO2.............................................................................................................................................................9
P2. Design and build class diagrams using a UML tool...........................................................................9
M2. Define class diagrams for specific design patterns using a UML tool............................................11
LO3...........................................................................................................................................................13
P3. Build an application derived from UML class diagrams.................................................................13
M3. Develop code that implements a design pattern for a given purpose..............................................16
LO4...........................................................................................................................................................29
P4. Discuss a range of design patterns with relevant examples of creational, structural and behavioural
pattern types..........................................................................................................................................29
M4. Reconcile the most appropriate design pattern from a range with a series of given scenarios........31
Conclusion.................................................................................................................................................35
References.................................................................................................................................................36
2
Document Page
Introduction
Advanced programming is the programming which uses the concept object-oriented features and
its paradigm. It includes an instruction set that is capable of producing the output for the various
different inputs given by the user. Basically, all the advanced computer languages are the
implementation of the algorithms made for an intended application to implement. The selected
organization for this project is Canonical Ltd. Which is a private company founded by Mark
Shuttleworth. It is situated in London, United Kingdom. The goal of this project is to implement
an application for the calculation of payrolls of the employee in the C# programming language.
For this implementation, one needs to focus the object-oriented features and paradigms. Hence,
these concepts are also been included.
3
Document Page
LO1
P1. Examine the characteristics of the Object-orientated paradigm as well as
the various class relationships.
Object-oriented programming is the type of programming which include the concept of classes
and objects (Sourcemaking, 2019). All the data members and the data functions are enclosed in
the class which is capable to be accessed by the class instance. In simple words, it can be said
that for an object, the class is a blueprint. It needs to be defined by the user (Nirosh, 2015). On
the other hand, a class instance is an object. At the time of the object, creation memory is
allocated.
Figure 1: relationship between class and objects
(Source: net-informations.com)
Some object-oriented features are:
Programming design can be done in the bottom-up approach
Programs are grouped in class
Organization of programs is around an object
Functions are used to interact with objects
Reusability of program design (Baeldung, 2018)
Languages like C++, C#, Java, Ruby, Perl Python, PHP and many more use the concept of
object-oriented programming.
4
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
The paradigm of object-oriented are:
Encapsulation:
Encapsulation means encapsulating of data i.e. wrapping everything in a single unit.
Polymorphism:
Polymorphism means taking multiple forms for a task. It is the ability to have different
internal structure for a single external interface (Narawita and Vidanage, 2018).
Abstraction:
Abstraction means hiding unnecessary details, showing off only significant details.
Inheritance:
It is the mechanism that allows creating new classes with the use of an existing class
(Mulonda, 2018). Inheritance types that exist are:
Single inheritance
Multiple inheritance
Multilevel inheritance
Hybrid inheritance
Hierarchical inheritance
Figure 2: Inheritance type
5
Document Page
(Source: tutorialspoint.com)
Generalization and specialization:
It represents a relationship hierarchy between classes where superclass is used to create a
subclass (Nirosh, 2015).
Figure 3: Generalization & Specialization
(Source: tutorialspoint.com)
6
Document Page
M1. Determine a design pattern from each of the creational, Structural and
behavioural pattern types.
Design Patterns:
Mainly three types of design patterns are used in object-oriented programming. They are as
follows:
Creational pattern:
This provides a way to produce an object while the logic of creation is hidden. It does not
make use of new operator for instantiating object (Baah, et. al., 2016). Design patterns that
includes creation design pattern are:
Abstract factory
Builder
Factory method
Prototype
Singleton
Structural pattern:
This pattern uses the composition of classes and objects. Composing of interfaces is done
through inheritance and new functionalities are obtained by composing objects (More and
Phalnikar, 2012). It includes:
Adapter
Bridge
Composite
Decorator
Façade
Flyweight
Proxy
Behavioral pattern:
This patter is based on the objects interacts with each other in order and how the objects
behave when some action arrives. It includes patterns such as:
Blackboard
7
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
Chain of responsibility
Command
Interpreter
Iterator
Mediator
Memento
Null object
Observer
Protocol task
Specification
Schedule task
Strategy
Single serving visitor
State
Visitor
Template method (Sourcemaking, 2019)
8
Document Page
LO2
P2. Design and build class diagrams using a UML tool.
UML stands for unified modeling language which includes various diagrams that makes the
users to easily understand the behavior and structure of the application (Ramasamy, et. al.,
2015). It also helps the developer in developing the intended application for particular
specifications. It used to prepare the blueprints of the design and provides a proper understanding
of the system. Three major components are used in UML diagrams:
Building blocks of UML
Things
Structural:
It includes class, interface, collaboration, use case, component, and node.
Behavioral:
It includes interaction, and state machine ( Narwita and Vidanage, 2018).
Grouping:
It includes a package.
Annotational:
It includes a note.
Relationships
Dependency
Association
Generalization
Realization (baeldung, 2018)
Diagrams
Class diagram
Sequence diagram
Use case diagram
Object diagram
Component diagram
Statechart diagram
9
Document Page
Collaboration diagram
Deployment diagram
Activity diagram
Connecting various building blocks rules
Mechanism of UML (Baeldung, 2018)
To design a UML diagram, UML tools are used. Some of the popular UML tools are:
Acceleo
AgroUML
GenMyModel
Umbrello UML Modeller
StarUML (sourcemaking, 2019)
Advantages of using the class diagram are:
1. It helps in simplifying designs that are complex.
2. The entire system can be viewed.
3. Takes less time to understand.
4. Communication becomes easy (More and Phalnikar, 2012).
5. Becomes easy for the developer to develop with the help of a diagram.
10
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
M2. Define class diagrams for specific design patterns using a UML tool.
It is a diagram which is static and it also represents the view of an intended application which is
also static. The whole system can be understood by the class diagram collection. Classes,
interfaces, collaboration, relationships, and association are described with the use of a class
diagram. It also describes objects and their relationship among them (Baah, et. al., 2016). The
main purpose to have a class diagram in use is that it depicts the aspects of OOPs, deployment
and component diagrams are based on class diagrams and fast and effective analysis of the
design.
Notations that are used in the class diagram are:
Rectangle:
It is used to represent the class having three components, namely attributes, operation and
name (Nirosh, 2015).
+, #, and - :
These symbols are associated with modifiers used for visibility decision of operations and
attributes. + is for public visibility, # is for protected visibility, and – is for private visibility
(Mulonda, 2018).
Figure 4: Notations used in the class diagram
(Source: tutorialspoint.com)
11
Document Page
Figure 4: Example of a class diagram
(Source: lucidchart.com)
12
chevron_up_icon
1 out of 37
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]