0% found this document useful (0 votes)
7 views84 pages

Samirgiriss

Uploaded by

kif22.sg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views84 pages

Samirgiriss

Uploaded by

kif22.sg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 84

Advance Programming

INTERNATIONAL SCHOOL OF
MANAGEMENT AND TECHNOLOGY

FACULTY OF COMPUTING

ASSIGNMENT COVER SHEET


This form is to be completed by students submitting assignments of level 4 and level 5. Students
are required to complete all sections and attach to your assignment.

STUDENT DETAILS

STUDENT NAME Samir giri

STUDENT ID

UNIT AND ASSIGNMENT DETAILS

Unit 20: Advanced Programming


UNIT TITLE

UNIT NUMBER Y/615/1651

ASSIGNMENT Employee Management System


TITLE

ISSUE DATE 18/09/2023 DUE DATE 18/11/2023

ASSESSOR Bipin Dhakal


NAME

ESTIMATED
WORD LENGTH

1|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

SUBMISSION

HAND IN DATE 3/14/2024

DECLERATION AND ACKNOWLEDGEMENT

When submitting assignments, each student must sign a declaration confirming that the work
is their own.

Plagiarism and Collusion


Plagiarism: to use or pass off as one’s own, the writings or ideas of another without
acknowledging or crediting the source from which the ideas are taken.

Collusion: submitting an assignment, project or report completed by another person


and passing it off as one’s.

In accordance with the Academic Integrity and Plagiarism Policy:

1. I declare that:
a) this assignment is entirely my own work, except where I have included fully-
documented references to the work of others,
b) the material contained in this assignment has not previously been submitted for any
other subject at the University or any other educational institution, except as
otherwise permitted,
c) no part of this assignment or product has been submitted by me in another (previous
or current) assessment, except where appropriately referenced, and with prior
permission from the Lecturer / Tutor / Unit Coordinator for this unit.

2. I acknowledge that:
a) if required to do so, I will provide an electronic copy of this assignment to the
assessor;
b) the assessor of this assignment may, for the purpose of assessing this assignment:

2|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

I. reproduce this assignment and provide a copy to another member of academic


staff;
II. Communicate a copy of this assignment to a plagiarism checking service such
as Plagiarism Check (which may then retain a copy of this assignment on its
database for the purpose of future plagiarism checking).

I am aware of and understand that any breaches to the Academic Code of Conduct will be
investigated and sanctioned in accordance with the College Policy.

SIGNATURE Samir giri DATE 3/14/2024

3|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Table of Contents
List of Figures..................................................................................................................................6
Part 1................................................................................................................................................8
Introduction..................................................................................................................................8
Object-Oriented Programming (OOP).......................................................................................11
Encapsulation.......................................................................................................................11
Inheritance............................................................................................................................13
Polymorphism......................................................................................................................14
Abstraction...........................................................................................................................16
Class Relationships in OOP.......................................................................................................17
Association............................................................................................................................18
Aggregation..........................................................................................................................19
Composition..........................................................................................................................20
Inheritance............................................................................................................................21
Dependency..........................................................................................................................22
Conclusion.................................................................................................................................24
Part 2..............................................................................................................................................25
Unified Modeling Language (UML):........................................................................................25
The Significance of UML Diagrams: Unveiling Clarity Amidst Complexity..........................25
Key Points about UML Diagrams: Decoding the Language of Software Architecture............25
Types of UML Diagrams: Exploring the Landscape of Software Architecture........................27
Structural Diagrams:...........................................................................................................27
Behavioral Diagrams:..........................................................................................................27
Class Diagram......................................................................................................................28
Object Diagram....................................................................................................................29
Component Diagram...........................................................................................................30
Deployment Diagram...........................................................................................................31
Activity Diagram..................................................................................................................32

4|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Use Case Diagram................................................................................................................33


Communication Diagram....................................................................................................34
UML Diagram...........................................................................................................................35
Draw.io:................................................................................................................................35
Visual Paradigm:.................................................................................................................36
Lucidchart:...........................................................................................................................36
Enterprise Architect............................................................................................................37
Designing class diagram of Employee Management System Using UML tool........................37
Conclusion.................................................................................................................................38
Part 3..............................................................................................................................................40
Lab Report.................................................................................................................................40
Introduction................................................................................................................................40
Initial Steps and Technological Choices....................................................................................40
Adopting the MVC Design Framework....................................................................................40
Code-First Approach and Database Management.....................................................................41
Screen Shot of Web Application...............................................................................................41
User Login Page........................................................................................................................41
Conclusion.................................................................................................................................71
Part 4..............................................................................................................................................72
Design pattern............................................................................................................................72
Design Pattern types..................................................................................................................72
Creational Design Pattern..........................................................................................................72
Singleton pattern..................................................................................................................73
Factory Method Pattern......................................................................................................74
Structural Design Pattern...........................................................................................................76
Adapter Pattern...................................................................................................................76
Bridge Pattern......................................................................................................................77
Behavioral Design Patterns........................................................................................................79
Observer Pattern.................................................................................................................79
Strategy pattern...................................................................................................................82
Conclusion.................................................................................................................................83

5|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

References......................................................................................................................................84

List of Figures
Figure 1 UML diagram types........................................................................................................28
Figure 2 class diagram example....................................................................................................29
Figure 3:object diagram example..................................................................................................30
Figure 4 component diagram example..........................................................................................31
Figure 5 deployment diagram example.........................................................................................32
Figure 6 activity diagram example................................................................................................33
Figure 7 Use case diagram example..............................................................................................34
Figure 8 Communication diagram example..................................................................................35
Figure 9 draw.io logo.....................................................................................................................36
Figure 10 Enterprise architect logo................................................................................................37
Figure 11 Employee Management System Class diagram............................................................38
Figure 12 User login page..............................................................................................................41
Figure 13 Home page.....................................................................................................................42
Figure 14 Employee Report page..................................................................................................42
Figure 16: User Detail Entity.........................................................................................................43
Figure 17: User Detail View Model..............................................................................................44
Figure 18; Account Controller.......................................................................................................45
Figure 19: Login View Page..........................................................................................................46
Figure 20: Employee List..............................................................................................................47
Figure 21: Employee Entity...........................................................................................................47
Figure 22: Employee View Model................................................................................................48

6|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 23: Employee Controller Index Action..............................................................................49


Figure 24: Employee Controller Create Action.............................................................................50
Figure 25: Employee Controller Edit and Delete Action..............................................................51
Figure 26: Employee list view Page..............................................................................................52
Figure 27:Employee create view page...........................................................................................53
Figure 28: Employee Edit View Page...........................................................................................54
Figure 29: Salary list Page.............................................................................................................54
Figure 30: Leave Edit Page............................................................................................................61
Figure 31: Leave Entity.................................................................................................................62
Figure 32: Leave View Model.......................................................................................................63
Figure 33: Leave Controller Index and Create Action..................................................................64
Figure 34: Leave Controller Edit and Delete Action.....................................................................65
Figure 35: Leave List View Page..................................................................................................67
Figure 36: Leave Create Page........................................................................................................69
Figure 37: Leave Edit Page............................................................................................................70
Figure 38: Example of Singleton pattern.......................................................................................74
Figure 39: Factory Method Pattern................................................................................................75
Figure 40: Adapter Pattern.............................................................................................................77
Figure 41: Bridge Pattern...............................................................................................................78
Figure 42: Example of Observer Pattern.......................................................................................80
Figure 43: Strategy pattern............................................................................................................82

7|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Part 1
Introduction
Inside the energetic domain of program advancement, my part reverberates as that of a junior
program designer settled inside the dynamic hallways of PT Arrangements. Endowed with the
momentous errand of designing a strong Human Assets and Finance administration framework
for the distinguished Wellness Sanctuary exercise center, I discover myself at the limit of an
elating travel. At the heart of our endeavor lies a significant investigation into the object-oriented
worldview, a guide enlightening our way towards computer program greatness. This worldview,
with its complicated embroidered artwork of objects, epitomizes the exceptionally quintessence
of measured quality, reusability, and program judgment, in this way laying the basis for our
yearning venture.

As we embark on this odyssey, we delve into the fundamental tenets of object-oriented


programming, each concept akin to a precious gem in our toolkit. Among these jewels, the
concept of a class emerges as the cornerstone, serving as the blueprint from which objects are
instantiated. Objects, in turn, encapsulate both data and behaviors, akin to sentient entities
endowed with purpose and functionality. Through the lens of inheritance, we witness the elegant

8|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

hierarchy that permeates the object-oriented landscape, as classes bequeath their attributes and
behaviors to progeny, fostering a sense of lineage and cohesion. Poly-morph-ism, a term as
multifaceted as its implications, bestows upon us the power of versatility, allowing objects to
manifest in diverse forms while adhering to a unified interface. And in the sanctum of data
encapsulation, we find solace in the notion of privacy and abstraction, shielding the inner
workings of objects from external meddling, thus fostering a sense of security and robustness.
Within this narrative, class associations emerge as the interwoven threads that bind our software
ecosystem together, forging connections and dependencies that breathe life into our creation..

9|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

10 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Object-Oriented Programming (OOP)


Conceptual Framework: OOP models real-world entities as objects with data and behaviors,
providing a structured approach to programming.

Modularity and Reusability: It promotes the creation of reusable and modular code, enabling
easier maintenance and updates.

Key Principles: OOP is based on encapsulation, inheritance, polymorphism, and abstraction,


fostering flexibility and scalability in software design.

Encapsulation
 Data Hiding: Encapsulation bundles data and methods within classes, hiding internal
states from the outside world.
 Access Control: It uses access specifiers (private, protected, public) to control access to
the object's internal state.
11 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

 Improves Maintainability: Encapsulation organizes code logically, making it easier to


maintain and update without widespread changes.

12 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Inheritance
 Reusability: Inheritance allows new classes to inherit properties and methods from
existing classes, promoting code reuse.
 Hierarchical Relationships: It establishes a hierarchy between classes, reflecting real-
world relationships and creating a clear class structure.
 Extensibility: Inheritance enables extending the functionality of existing classes without
altering their source code, enhancing flexibility.

13 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Polymorphism
 Method Overloading: Polymorphism allows multiple methods with the same name but
different parameters, enhancing method flexibility.
 Method Overriding: Derived classes can override base class methods to provide
specialized behavior, supporting tailored functionality.
 Dynamic Binding: It enables runtime method invocation based on object type, allowing
for more flexible and extensible code.

14 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

15 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Abstraction
 Simplification: Abstraction hides complex implementation details, exposing only
essential features and simplifying the user interface.
 Focus on Essentials: It allows developers to concentrate on high-level operations and
interactions, streamlining system design.
 Implementation Hiding: Abstraction separates what an object does from how it does it,
enabling changes in implementation without affecting usage.

16 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Class Relationships in OOP


Class relationships in Object-Oriented Programming (OOP) define how classes interact with
each other. These relationships include inheritance, association, aggregation, composition, and
dependency, each representing different ways that objects can be related or interact in a software
system.

17 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Association
1. Represents a relationship where two classes are connected but operate independently.
2. Can be unidirectional or bidirectional, allowing instances of one class to communicate with
instances of another.
3. Example: A `Customer` class and an `Order` class where customers place orders without
implying ownership.

18 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Aggregation
1. A type of association representing a "has-a" relationship with independent lifetimes for the
contained objects.
2. Signifies a whole-part relationship with a weaker bond than composition.
3. Example: A `Library` class aggregating `Book` objects, where books can exist outside the
library.

19 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Composition
1. A strong form of aggregation with a "has-a" relationship where contained objects cannot exist
independently.

2. Signifies a whole-part relationship with strong ownership and lifecycle dependency.

3. Example: A `House` class composed of `Room` objects, where rooms do not exist separately
from the house.

20 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Inheritance
1. A relationship where a class (child) inherits properties and behaviors from another class
(parent), forming an "is-a" relationship.

2. Promotes code reuse and establishes a logical hierarchy between parent and child classes.

3. Example: A `Dog` class inheriting from an `Animal` class, gaining shared methods like `eat()`
and `sleep()`.

21 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Dependency
1. A relationship where one class relies on another class to function properly, indicating a "uses-
a" relationship.

2. Typically temporary and represented by method parameters or local variables.

3. Example: A `Car` class depending on a `Fuel` class, showing that the car needs fuel to run.

22 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

23 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Conclusion
In conclusion, our voyage into the object-oriented worldview has yielded a bountiful gather of
experiences and disclosures. Through fastidious investigation and reflection, we have unwound
the complicated embroidered artwork of objects and classes, observing the significant transaction
that supports their relationship. From the humble beginning of a course to the expand move of
legacy and polymorphism, each concept serves as a reference point directing our journey for
program excellence.

Moreover, our attack into course affiliations has lit up the complicated web of conditions that
penetrate our computer program engineering, underscoring the significance of keen plan and
fastidious arranging. As we offered farewell to this chapter of our travel, we stand balanced on
the slope of plausibility, equipped with recently discovered information and a more profound
appreciation for the creativity of program engineering.

24 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Part 2
Unified Modeling Language (UML):
Unified Modeling Language (UML) serves as a reference point of clarity and accuracy inside the
complicated space of program building. It stands as a standardized visual dialect, fastidiously
created to encourage the comprehension, plan, and documentation of complex frameworks.
Focusing on a differing group of onlookers extending from program designers to investigators
and partners, UML enables people to communicate framework structure and behavior viably. By
giving a orderly approach to considering and investigation, UML gets to be an vital apparatus in
the weapons store of advanced program advancement.

The Significance of UML Diagrams: Unveiling Clarity Amidst Complexity


The question of why we should use UML Diagrams resonates deeply within the corridors of
software development. UML diagrams are not merely aesthetic niceties but essential features of
documentation, especially in Agile environments where productivity and focus are paramount.
They serve as navigational aids, guiding development teams through the labyrinth of system
architecture and design. Furthermore, UML diagrams expedite the onboarding process for new
team members, ensuring a seamless transition into ongoing projects. With the aid of innovative
platforms like Lucid chart, UML diagrams transcend their static nature, evolving into dynamic
visualizations that adapt to the ever-changing landscape of software development.

Key Points about UML Diagrams: Decoding the Language of Software Architecture

Visual Representation:

At the heart of UML lies its ability to provide visual representations of complex software
systems. Through standardized symbols and notations, UML diagrams offer blueprints that guide
developers through the intricate maze of system architecture and design.

25 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

System Abstraction:

Class diagrams serve as the foundational building blocks of object-oriented solutions, delineating
classes, attributes, actions, and their interrelationships. By dissecting the structure of software
systems, class diagrams provide developers with invaluable insights into system organization and
functionality.

Standardized Language:

UML acts as a universal language, transcending geographical and cultural boundaries to


facilitate effective communication among software professionals worldwide. Its standardized
symbols and notations ensure consistency and clarity in conveying complex ideas and concepts.

Versatility:

One of the most striking features of UML is its versatility. It offers a diverse array of diagram
types, each tailored to address specific aspects of software architecture and behavior. From
depicting static structures to illustrating dynamic interactions, UML diagrams cater to a wide
spectrum of development needs.

Collaboration Tool:

UML serves as a catalyst for collaboration, fostering communication and innovation among
diverse stakeholders involved in the software development process. By providing a common
language and platform for discourse, UML bridges the gap between developers, designers,
testers, and business analysts, enabling cohesive and synergistic development efforts.

26 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

System Understanding and Documentation:

UML diagrams serve as invaluable tools for understanding and documenting software systems.
They provide developers with visual roadmaps that aid in design, analysis, and maintenance
tasks, thereby enhancing the overall quality and reliability of software products.

Types of UML Diagrams: Exploring the Landscape of Software Architecture


UML diagrams come in a myriad of types, each offering unique insights into different facets of
software architecture and behavior.

Structural Diagrams:
These diagrams focus on depicting the static structure of software systems, showcasing the
various components and their relationships. Examples include class diagrams, component
diagrams, and object diagrams.

Behavioral Diagrams:
In contrast, behavioral diagrams elucidate the dynamic interactions and behaviors within a
system, shedding light on how components collaborate to achieve desired functionality.
Examples include use case diagrams, activity diagrams, and sequence diagrams.

In essence, Unified Modeling Language (UML) stands as a cornerstone in the realm of software
engineering, offering a standardized framework for comprehending, designing, and documenting
complex systems. By harnessing the power of visual representation and collaboration, UML
empowers developers to navigate the turbulent waters of software development with clarity,
precision, and efficiency.

27 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 1 UML diagram types

Class Diagram
Class diagrams serve as the foundational framework for any object-oriented solution. They
delineate the classes within a system, detailing the attributes and behaviors associated with each
class, as well as the relationships that exist between them. Typically, class diagrams are
structured in a hierarchical manner, with class names positioned at the top, attributes in the
middle, and actions or methods at the bottom. In more complex systems where multiple classes
overlap, these classes are often grouped together to form comprehensive class diagrams.
Relationships between classes are denoted by arrows, elucidating the connections and
dependencies between various components of the system.

28 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 2 class diagram example

Object Diagram
In the realm of the Unified Modeling Language (UML), an object diagram serves as a schematic
representation offering a snapshot of classes within a system at a specific moment in time. It
offers a granular view of individual objects and their interrelations, encapsulating properties,
attributes, and the connections that bind them. By depicting real-world instances and their
interactions within the system, object diagrams complement class diagrams, providing a tangible
depiction of the system’s current state. Through visualizing how objects manifest and interact
within the system, stakeholders gain a deeper comprehension of the system's dynamics and the
manner in which various entities coalesce to fulfill specific functionalities.

29 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 3:object diagram example

Component Diagram
Component diagrams are instrumental in illustrating the structural relationships among the
components constituting a software system. Particularly beneficial in managing complex systems
replete with myriad features, component diagrams delineate how components communicate via
interfaces and are interconnected through links. By elucidating the architecture and interactions
of system components, these diagrams facilitate a comprehensive understanding of the system's
composition and functionality. Refer to the accompanying figure for a visual representation of a
component diagram, showcasing the interconnectedness and communication pathways among
system components.

30 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 4 component diagram example

Deployment Diagram
The deployment diagram offers a comprehensive overview of the hardware and software
configurations deployed within a system. Particularly invaluable for distributed software
solutions spanning multiple computing nodes, each with distinct configurations, deployment
diagrams provide a lucid visualization of the system's physical and logical infrastructure. By
mapping out the deployment topology, stakeholders gain insights into how software components
are distributed across various hardware nodes, facilitating effective system management and
optimization. Refer to the provided example of a deployment diagram for a visual representation
of how hardware and software elements are orchestrated within a system environment.

31 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 5 deployment diagram example

Activity Diagram
In the domain of the Unified Modeling Language (UML), the activity diagram serves as a
behavioral model delineating the sequential processes within a system or business process.
Offering a dynamic portrayal of system processes, activity diagrams elucidate the flow and
progression of activities, emphasizing their order and state transitions. Activities are represented
as rounded rectangles, with transitions depicted by arrows, symbolizing the directional flow of
execution. Decision points, denoted by diamonds, delineate conditional branches within the
process, while forks and joins illustrate parallel and synchronous processes, respectively. Swim
lanes may also be employed to segment the diagram, identifying distinct responsibilities or
organizational units involved in the process. Leveraging activity diagrams, stakeholders gain a
coherent understanding of how activities are orchestrated to achieve specific goals within a
system or program, facilitating requirements analysis and system design.

32 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 6 activity diagram example

Use Case Diagram


A use case diagram, within the Unified Modeling Language (UML), serves as a behavioral
model providing a high-level visualization of how a system interacts with external entities, often
referred to as actors. Actors represent external entities such as users or other systems, while use
cases depict specific operations or actions that the system can perform. The diagram illustrates
the relationships between actors and use cases, delineating how users or external systems interact
with the system to accomplish a goal. Arrows denote the interactions between actors and use
cases, offering insights into the functional requirements of the system. Use case diagrams are
invaluable for capturing and communicating the essential system functionalities in a user-
friendly manner, supporting needs analysis and providing a foundation for subsequent system
design and development activities.
33 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 7 Use case diagram example

Communication Diagram
Originally termed collaboration diagrams in UML 1, communication diagrams offer a variant
perspective akin to sequence diagrams, with a primary focus on message transmission between
objects. These diagrams encapsulate the exchange of messages between objects, providing a
visual representation of the communication pathways within the system. By representing
interactions through a series of images and objects, communication diagrams facilitate a
comprehensive understanding of the message flow and interactions among system components.

34 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 8 Communication diagram example

UML Diagram
The landscape of software development is enriched with a plethora of UML modeling tools, each
offering intuitive interfaces and robust features to streamline the creation, editing, and execution
of Unified Modeling Language (UML) models. These tools serve as indispensable aids in
visualizing and conceptualizing complex software architectures, facilitating effective
communication and collaboration among development teams. Let's explore a few popular UML
diagram tools:

Draw.io:
Draw.io stands out as a versatile and user-friendly web-based drawing tool, empowering users to
craft intricate diagrams, including UML diagrams, flowcharts, and concept maps, with utmost
ease. Its accessibility is a notable advantage, as it operates entirely within web browsers,
eliminating the need for cumbersome software installations. Users can seamlessly access
Draw.io from any web-enabled device, fostering collaborative diagramming efforts. The tool
boasts an extensive library of shapes and icons, coupled with a drag-and-drop interface, enabling
effortless creation, customization, and editing of images. Integration with various cloud storage

35 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

services facilitates seamless saving and sharing of diagrams, while real-time collaboration
features empower multiple users to work synchronously on the same canvas. Draw.io's
simplicity, rich graphical options, and robust collaboration capabilities render it a preferred
choice for individuals and teams seeking intuitive diagramming solutions.

Figure 9 draw.io logo

Visual Paradigm:
Visual Paradigm emerges as an easy-to-use UML modeling tool, designed to empower users in
visually designing software systems with remarkable efficiency. Leveraging drag-and-drop
functionality, it facilitates the creation of UML diagrams, enabling the representation of intricate
system structures and actions with precision. Beyond diagramming, the tool supports code
engineering, expediting the software development lifecycle. Collaboration features enhance its
suitability for team-oriented projects, while providing a comprehensive environment for
modeling and documentation. In essence, Visual Paradigm streamlines the complexities inherent
in software development, fostering a deeper understanding of program architectures and
expediting the development process through its user-centric design.

Lucidchart:
Lucidchart emerges as an intuitive online diagramming tool, catering to a diverse array of
diagramming needs, including flowcharts, UML diagrams, and more. Accessible via web
browsers, it facilitates seamless collaboration among individuals and teams in real-time.
Integration with cloud services simplifies storage and sharing of diagrams, while its user-friendly
interface expedites the creation and synthesis of complex concepts. Lucidchart's emphasis on

36 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

visual clarity and collaborative functionality makes it an invaluable asset for teams striving for
seamless communication and comprehension in their diagramming endeavors.

Enterprise Architect
Enterprise Architect stands as a robust software modeling tool, tailored for designing and
visualizing intricate systems with unparalleled sophistication. It serves as a cornerstone in the
creation of UML diagrams for complex software architectures, providing a multifaceted
environment equipped with advanced code engineering capabilities. Widely embraced in large-
scale software and system engineering projects, Enterprise Architect facilitates streamlined
prototyping and development of intricate software systems, offering indispensable support in
navigating the complexities of modern software development endeavors.

Figure 10 Enterprise architect logo

Designing class diagram of Employee Management System Using UML tool


In practical application, let's consider the scenario of designing a class diagram for an Employee
Management System utilizing a UML tool. By leveraging the functionalities offered by UML
modeling tools like Visual Paradigm or Draw.io, developers can meticulously delineate the
various classes, attributes, and relationships pertinent to the system. Through intuitive drag-and-
drop interfaces and comprehensive libraries of UML elements, developers can construct an
exhaustive representation of the system's architecture, facilitating a clear understanding of its
organizational structure and functional dependencies. Real-time collaboration features further
enhance the design process, enabling seamless coordination among team members and fostering
iterative refinement of the class diagram until an optimal solution is achieved.

37 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 11 Employee Management System Class diagram

Conclusion
In conclusion, UML diagrams serve as indispensable assets in the realm of software
development, standardizing system design and enhancing communication among stakeholders.
Through an examination of popular UML diagram tools such as Draw.io, Visual Paradigm,
Lucidchart, and Enterprise Architect, we've underscored their pivotal role in simplifying the
complexities of software architecture design and documentation. The design and synthesis of a
class diagram for an Employee Management System using a UML tool exemplify the practical
application of these tools in real-world scenarios, elucidating their efficacy in addressing the
multifaceted challenges inherent in software development endeavors. As software development

38 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

continues to evolve, UML diagrams remain invaluable instruments, empowering developers to


articulate and visualize intricate system architectures with precision and clarity.

39 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Part 3

Lab Report
Introduction
Crafting a Human Resources and Payroll (Employee) management system for Fitness Temple as
a junior software developer presented a multifaceted challenge, necessitating a meticulous
approach from conception to execution. The endeavor commenced with the development of a
comprehensive UML Diagram, a foundational step ensuring alignment with client expectations
and project requirements. Embracing a robust technology stack comprising C# programming
language and ASP .NET 7.0, bolstered by Entity Framework Core for seamless database
interactions, laid the groundwork for a scalable and efficient solution.

Initial Steps and Technological Choices


In selecting C# alongside ASP .NET 7.0, my decision was driven by a combination of
familiarity, proficiency, and suitability for the project scope. Having prior experience with C#
proved instrumental in navigating the intricacies of the language, enabling swift development
without compromising on quality. ASP .NET 7.0, renowned for its versatility and performance,
provided a robust framework for web application development, aligning seamlessly with the
client's requirements.

Adopting the MVC Design Framework


The Model-View-Controller (MVC) design pattern emerged as the cornerstone of the project's
architecture. This choice facilitated the division of responsibilities into distinct layers,
streamlining application logic and enhancing maintainability. Within this framework, the Model
encapsulates data and business logic, the View renders the user interface, and the Controller
orchestrates interactions between the two. Such compartmentalization ensures clarity,
extensibility, and ease of debugging throughout the development lifecycle.

40 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Code-First Approach and Database Management


Employing a code-first approach, I prioritized domain entities' creation before delving into
database design. Leveraging the Entity Framework API, I seamlessly translated domain classes
into a structured database schema, minimizing redundancy and optimizing performance.
Microsoft SQL Server emerged as the preferred database management system, seamlessly
integrated with the .NET Entity Framework. Its robustness and scalability made it an ideal choice
for managing Fitness Temple's employee data efficiently.

Screen Shot of Web Application


User Login Page

Figure 12 User login page

Authentication mechanisms were paramount to the system's integrity and security. Through the
Account controller, I implemented user login functionality, ensuring secure access to the
system's features. Leveraging ASP .NET's session management capabilities, I preserved essential
user-related information across interactions, facilitating a seamless and personalized experience.
Dynamic view rendering based on user roles enhanced usability, ensuring that each user's access
privileges aligned with their designated responsibilities.

41 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 13 Home page

Upon accessing our system, users are empowered to retrieve personalized reports providing a
comprehensive overview of their information, including personal details, leave Drecords, and
salary history. This functionality enables users to gain valuable insights into their individual data
within our platform.

Figure 14 Employee Report page

Here, we present a snippet of code pertaining to one of the numerous entities integrated into our
software: the UserDetails entity. This entity encapsulates various properties that serve as a model
for the corresponding database table. Following a code-first methodology throughout our
development process, the attributes of this class seamlessly align with columns within the
42 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

database table. Instances of this class play a crucial role in facilitating interaction with user data
within our system.

Figure 15: User Detail Entity

43 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

The structure presented here represents the view model for UserDetails, meticulously crafted for
the generation of view pages. Unlike entities, view models incorporate supplementary properties
essential for seamless integration into our codebase. These additional attributes are strategically
included to cater to specific requirements, ensuring optimal functionality and adaptability in our
coding endeavors.

Figure 16: User Detail View Model

44 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Moving forward, we have the Account controller, responsible for managing various aspects of
user interaction. This includes the HTTP GET action for user login, which provides a view in
response. Additionally, it handles the HTTP POST action for form submissions, oversees
authentication processes, and efficiently manages sessions. Interaction with the database is
facilitated through the ApplicationDbContext, ensuring smooth data transactions. The session
mechanism plays a pivotal role in preserving pertinent user-related information.

A notable feature is the dynamic differentiation of displayed views based on the roleId session
variable. This dynamic approach tailors the user experience by presenting distinct views to
different users. This proves particularly valuable in restricting access to specific functionalities,
reserving certain privileges exclusively for administrators.

Figure 17; Account Controller

45 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Following this, we provide the razor view page for the Login action. This page contains all the
HTML code with a form for user login and utilizes a partial view layout to enhance modularity
and maintainability.

Figure 18: Login View Page

46 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 19: Employee List

Figure 20: Employee Entity

47 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 21: Employee View Model

48 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 22: Employee Controller Index Action

49 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 23: Employee Controller Create Action

50 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 24: Employee Controller Edit and Delete Action


51 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 25: Employee list view Page


52 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 26:Employee create view page

53 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 27: Employee Edit View Page

Figure 28: Salary list Page

54 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

55 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

56 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

57 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

58 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

59 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

60 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 29: Leave Edit Page

61 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 30: Leave Entity

62 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 31: Leave View Model

63 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 32: Leave Controller Index and Create Action

64 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 33: Leave Controller Edit and Delete Action


65 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

66 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 34: Leave List View Page

67 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

68 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 35: Leave Create Page

69 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 36: Leave Edit Page

70 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Conclusion
In conclusion, the creation of a Human Resources and Payroll management system for Fitness
Temple exemplifies the symbiotic relationship between design and execution in software
development. From conceptualization through implementation, adherence to industry best
practices, utilization of appropriate design patterns, and strategic technological choices
underpinned the project's success. By seamlessly integrating user authentication, session
management, and view models within an MVC architecture, I delivered a scalable, efficient, and
user-centric solution tailored to Fitness Temple's unique requirements. As software development
continues to evolve, embracing a holistic approach encompassing design, implementation, and
iteration remains paramount to achieving success in today's dynamic landscape.

71 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Part 4

Design pattern
A design model serves as a versatile blueprint, offering a standardized approach to tackle
recurring challenges in software development. It embodies an optimal solution or suggestion
tailored to address particular policy hurdles, furnishing a validated and streamlined method to
construct and govern. These models are not exhaustive blueprints nor finalized codes; rather,
they serve as frameworks and patterns for resolving a spectrum of issues in an adaptable and
modular fashion.

The primary aim of design modeling is to foster the reuse of code, facilitate maintenance, and
enhance scalability by integrating solutions to prevalent design dilemmas. They function as a
communal lexicon for developers, enabling effective communication and comprehension of one
another's rationale and choices. By leveraging design models, software teams can expedite
development cycles, ensure consistency across projects, and cultivate a culture of innovation and
efficiency in software engineering endeavors. Thus, design models stand as pivotal assets in the
arsenal of modern software development, propelling teams toward greater agility, reliability, and
productivity in crafting sophisticated digital solutions.

Design Pattern types


There are 3 types of design patterns:

 Creational Design Pattern


 Structural Design Pattern
 Behavioral Design Pattern

Creational Design Pattern


Creational design patterns are crucial for establishing robust object creation processes, offering
streamlined and adaptable approaches to instantiate objects tailored for diverse scenarios. These
models tackle the intricacies of object instantiation, ensuring scalability, maintainability, and
adherence to design best practices.

72 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

A cornerstone of creational design is the Singleton pattern, which guarantees the existence of a
single instance of a class and facilitates global access to that instance. This proves invaluable
when precisely one object suffices to orchestrate actions within the system. For instance, an
application's configuration manager might leverage the Singleton instance to centrally manage
configuration settings throughout the software ecosystem.

Another pivotal creational pattern is the Factory Method pattern, which abstracts the creation of
objects through an interface while allowing subclasses to alter the specific type of object
instantiated. This fosters loose coupling, empowering classes to delegate object creation
responsibilities to their subclasses. In a document generation scenario, for instance, the Factory
Method pattern enables diverse document types (e.g., resumes, reports) to be generated
seamlessly by embedding creative logic within corresponding subclasses. These creational
patterns play a vital role in orchestrating intricate product designs, empowering developers to
construct efficient and well-structured object models. By offering a standardized approach to
object creation across software systems, these patterns promote code reusability, flexibility, and
maintainability.

Singleton pattern
The Singleton pattern, belonging to the creational design patterns category, ensures that a class
has only one instance and provides a global point of access to that instance. This unique instance
is particularly advantageous in scenarios where precisely one instance of a class is necessary to
oversee actions across a system. For instance, it can be instrumental in coordinating resources,
managing configurations, or serving as a central point for specific functionalities. By restricting
instantiation to just one object, the Singleton pattern helps maintain consistency and avoids
conflicts that may arise from multiple instances attempting to manage system-wide resources
independently.

73 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 37: Example of Singleton pattern

Factory Method Pattern


The Factory Method pattern is another member of the creational design patterns family, offering
a solution to the problem of creating objects without specifying their exact class types. It
establishes an interface for creating objects but delegates the responsibility of instantiation to
subclasses. This mechanism allows subclasses to alter the type of objects created without
necessitating changes to the client code. By decoupling the object creation process from the
client, the Factory Method pattern promotes flexibility and extensibility in software design. It
enables developers to introduce new object types or adjust existing ones seamlessly, without
disrupting the overall architecture. This pattern is particularly beneficial in scenarios where the

74 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

exact type of objects needed may vary or evolve over time, providing a robust and adaptable
solution to object creation requirements.

Figure 38: Factory Method Pattern

75 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Structural Design Pattern


Structural design patterns play a crucial role in crafting robust systems comprised of
interconnected classes and objects. By effectively managing the relationships between these
elements, structural design patterns enhance system flexibility and efficiency. They achieve this
by promoting transparent communication and facilitating the reuse of components. Let's delve
into two prominent structural design patterns: the Adapter Pattern and the Bridge Pattern. In
essence, structural design patterns like the Adapter Pattern and the Bridge Pattern empower
developers to architect systems that are not only robust and efficient but also adaptable to
evolving requirements. By embracing these patterns, software engineers can effectively manage
complexity, enhance code maintainability, and foster scalability in their projects. Thus,
incorporating such patterns into the design phase constitutes a strategic approach towards
building resilient and future-proof software systems.

Adapter Pattern
The Adapter Pattern serves as a mediator between incompatible interfaces, enabling them to
collaborate seamlessly. It essentially acts as a bridge, facilitating synchronization between
systems with differing interfaces. This pattern proves invaluable when integrating existing
systems or third-party libraries characterized by disparate interfaces. For instance, consider a
scenario where a legacy system needs to incorporate a new class. By creating an adapter that
harmonizes the interface of this new class with that of the legacy system, seamless integration
becomes feasible.

76 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 39: Adapter Pattern

Bridge Pattern
The Bridge Pattern focuses on decoupling abstraction from implementation, thereby allowing
them to vary independently. This pattern entails the presence of a bridge interface, which
maintains a reference to the implementation interface. It is particularly advantageous in scenarios
where a permanent relationship between abstraction and implementation is undesired. For
example, consider a situation where a shape abstraction needs to be separated from its rendering
implementation. By employing the Bridge Pattern, developers can achieve this decoupling,
ensuring greater flexibility and extensibility in the system's design.

77 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 40: Bridge Pattern

78 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Behavioral Design Patterns


Behavioral design patterns are crucial in defining how components collaborate, communicate,
and interact within a system. They focus on distributing responsibilities among objects,
structuring actions, and organizing interactions effectively. Two prominent examples of
behavioral design patterns are the Observer Pattern and the Strategy Pattern. Behavioral design
patterns play a pivotal role in designing flexible and maintainable software systems. Both
patterns offer distinct advantages in managing complex systems. The Observer Pattern facilitates
robust event handling, ideal for scenarios where objects need to react to state changes in a
decoupled manner. On the other hand, the Strategy Pattern excels in scenarios requiring
interchangeable algorithms, allowing for easy adaptation to varying requirements.

Observer Pattern
The Observer Pattern establishes a relationship between a subject and multiple observers. Here,
the subject monitors state changes and notifies all registered observers accordingly. Observers, in
turn, respond to these updates by invoking their designated methods. This pattern enables a
loosely coupled architecture where subjects and observers can vary independently, enhancing
flexibility and scalability.

79 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Figure 41: Example of Observer Pattern

80 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

81 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Strategy pattern
The Strategy Pattern encapsulates a set of algorithms, each representing a different strategy. It
allows clients to select a specific algorithm from this family of strategies dynamically. By
decoupling the selection of algorithms from the client code, the Strategy Pattern promotes
flexibility and extensibility. Clients can switch between strategies seamlessly, adapting behavior
at runtime without modifying the core logic.

Figure 42: Strategy pattern

82 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Conclusion
In the realm of software development, design patterns play a pivotal role by providing reusable
solutions to recurring problems, thereby facilitating code reusability and enhancing
communication among developers. Rather than presenting rigid, step-by-step blueprints, these
patterns offer flexible guidelines, which promote adaptability and modularity within software
systems. Notably, patterns such as the Singleton and Factory Method contribute to the scalability
and maintainability of software applications by streamlining the instantiation of objects and
managing dependencies efficiently. Additionally, structural patterns like Adapter and Bridge are
instrumental in establishing robust class and object systems, ensuring that software components
can seamlessly collaborate and evolve over time.

What sets design patterns apart is their ability to establish a common language among
developers, fostering a shared understanding of best practices and promoting consistency across
projects. By emphasizing simplicity and efficiency, these patterns empower developers to craft
resilient and maintainable software solutions that can withstand the test of time. Ultimately,
design patterns serve as a cornerstone in the construction of software systems, enabling
developers to tackle complex problems with confidence and precision.

References
Anon., n.d. [Online]
Available at: https://www.smartdraw.com/uml-diagram/
[Accessed 28 02 2024].

83 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming

Anon., n.d. geeksforgeeks. [Online]


Available at: https://www.geeksforgeeks.org/unified-modeling-language-uml-introduction/
[Accessed 29 02 2024].

Anon., n.d. geeksforgeeks. [Online]


Available at: https://www.geeksforgeeks.org/software-design-patterns/
[Accessed 26 02 2024].

Anon., n.d. Lucidchart. [Online]


Available at: https://www.lucidchart.com/pages/uml-class-diagram
[Accessed 25 02 2024].

Anon., n.d. Smartdraw. [Online]


Available at: https://www.smartdraw.com/uml-diagram/
[Accessed 28 02 2024].

84 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)

You might also like