Samirgiriss
Samirgiriss
INTERNATIONAL SCHOOL OF
MANAGEMENT AND TECHNOLOGY
FACULTY OF COMPUTING
STUDENT DETAILS
STUDENT ID
ESTIMATED
WORD LENGTH
1|Page
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
SUBMISSION
When submitting assignments, each student must sign a declaration confirming that the work
is their own.
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 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.
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
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
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.
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
Modularity and Reusability: It promotes the creation of reusable and modular code, enabling
easier maintenance and updates.
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
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
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.
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.
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.
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:
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
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.
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
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
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
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
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
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
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
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.
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.
37 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
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
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.
40 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
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
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.
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.
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.
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.
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.
46 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
47 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
48 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
49 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
50 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
53 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
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
61 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
62 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
63 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
64 | 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
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
69 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
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.
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
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.
75 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
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
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
78 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)
Advance Programming
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
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.
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
84 | P a g e
Shankar Chhetri (BTEC HND/ FOURTH SEMESTER)