You are on page 1of 38

Higher Nationals in Computing

Advanced Programming
ASSIGNMENT

No.1

Learner’s name: VO BI THANH PHUOC

Assessor name: LE NGOC THANH

Class: GCS0903B

Learner’s ID: GCS200547

Subject’s ID: 1651

Assignment due: August 21st, 2022

Assignment submitted: August 21st, 2022


ASSIGNMENT 1 BRIEF
Qualification BTEC Level 5 HND Diploma in Computing

Unit number Unit 20: Advanced Programming

Assignment title Examine and design solutions with OOP and Design Patterns

Academic Year 2022-2023

Unit Tutor Le Ngoc Thanh

Issue date Submission date August 21st, 2022

Submission Format:

Format: The submission is in the form of a group written report. This should be written in a concise,
formal business style using single spacing and font size 12. You are required to make use of
headings, paragraphs and subsections as appropriate, and all work must be supported with
research and referenced using the Harvard referencing system. Please also provide a
bibliography using the Harvard referencing system.
Submission Students are compulsory to submit the assignment in due date and in a way requested by
the Tutors. The form of submission will be a soft copy in PDF posted on corresponding
course of http://cms.greenwich.edu.vn/
Note: The Assignment must be your own work, and not copied by or from another student or from
books etc. If you use ideas, quotes or data (such as diagrams) from books, journals or other sources,
you must reference your sources, using the Harvard style. Make sure that you know how to reference
properly, and that understand the guidelines on plagiarism. If you do not, you definitely get fail

Assignment Brief and Guidance:

Scenario: You have recently joined a software development company to help improve their
documentation of their in-houses software libraries which were developed with very poor
documentation. As a result, it has been very difficult for the company to utilise their code in multiple
projects due to poor documentation. Your role is to alleviate this situation by showing the efficient of
UML diagrams in OOAD and Design Patterns in usages.

Page 2
Tasks
You and your team need to explain characteristics of Object-oriented programming paradigm by
applying Object-oriented analysis and design on a given (assumed) scenario. The scenario can be small
but should be able to presents various characteristics of OOP (such as: encapsulation, inheritance,
polymorphism, override, overload, etc.).
The second task is to introduce some design patterns (including 3 types: creational, structural, and
behavioral) to audience by giving real case scenarios, corresponding patterns illustrated by UML class
diagrams.
To summarize, you should analyze the relationship between the object-orientated paradigm and design
patterns.

The presentation should be about approximately 20-30 minutes and it should be summarized of the
team report.

Learning Outcomes and Assessment Criteria

Pass Merit Distinction

LO1 Examine the key components related to the object-orientated programming paradigm,
analysing design pattern types

P1 Examine the M1 Determine a design D1 Analyse the relationship


characteristics of the pattern from each of the between the object-
object-orientated creational, structural, and orientated paradigm and
paradigm as well as the behavioural pattern types. design patterns.
various class relationships.

LO2 Design a series of UML class diagrams

P2 Design and build class M2 Define class diagrams for D2 Define/refine class
diagrams using a UML tool. specific design patterns using a diagrams derived from a
UML tool. given code scenario using a
UML tool.

Page 3
Table of Contents
Introduction ..................................................................................................................................... 5

P1. Examine the characteristics of the object-orientated paradigm as well as the various class
relationships. .................................................................................................................................... 6

1. Object-oriented programming ............................................................................................. 6

2. Abstract calculation concept ................................................................................................ 6

3. Encapsulation ....................................................................................................................... 7

4. The concept of inheritance................................................................................................... 8

5. Concept of polymorphism .................................................................................................. 10

6. Interface ............................................................................................................................. 10

P2. Design and build class diagrams using a UML tool................................................................... 12

1. Scenario .......................................................................................................................... 12

2. Use-case Diagrams: ........................................................................................................ 14

3. Class Diagrams: ............................................................................................................... 18

[M1 & M2] Determine a design pattern and define class diagrams using a UML tool for each of
the creational, structural, and behavioral pattern types ............................................................... 21

1. Design Pattern ........................................................................................................................ 21

2. Creational Pattern .................................................................................................................. 22

3. Structural Pattern ................................................................................................................... 25

4. Behavior Pattern..................................................................................................................... 27

D1. Analyse the relationship between the object-orientated paradigm and design patterns ...... 30

D2. Define/refine class diagrams derived from a given code scenario using a UML tool .............. 31

Conclusion ...................................................................................................................................... 36

References...................................................................................................................................... 37

Page 4
Introduction

Advance programming is a subject that contain all programming language


paradigms and Object-oriented programming is a programming language model
organized around the objects rather than “action” and data rather than logic.
Historically, a program has been viewed as a logical procedure that takes input data,
processes it, and produces output data.

In this assignment, I have required to develop software system for my company;


however, before that I have to understand the Advance Programming principles, be able
to design pattens and the object-oriented programming solution. Besides, I am going to
examine the key components related to the object-orientated programming paradigm
and analyze design pattern types. Moreover, I also define and design class diagrams for
specific design patterns using a UML tool.

Finally, I will analyze the relationship between the object-orientated paradigm and
design patterns, show fully the results into my report.

Page 5
P1. Examine the characteristics of the object-orientated paradigm
as well as the various class relationships.

1. Object-oriented programming
Object-oriented programming (OOP) is one of the very important programming
techniques nowadays. It is applicable in most practical construction applications at
businesses. Most popular programming languages and programming frameworks such
as Java, C#, and .NET support object-oriented programming. Most programmers have
learned about object-oriented programming in universities, but the basic principles of
object-oriented programming sometimes do not know how to misuse the wrong
philosophy of programming. object-oriented.
In this article, I will summarize the basic principles of object-oriented programming
to help you get an overview of OOP and how convenient it is.
What is object-oriented programming?
Object-oriented programming is a programming technique that allows
programmers to create objects in code that abstract actual objects in life. This approach
is currently very successful and has become one of the software development
templates, especially for software using on business.
When developing applications using OOP, we will define classes (classes) to model actual
objects. In the application these classes will be initialized into objects and during the
time the application runs, the methods of this object will be called.
What is the class that defines the object: include methods and properties. An
object is just an instance of the class. Classes interact with each other by the public API:
its set of methods, its public properties.

2. Abstract calculation concept


Abstraction in Java is a non-specific property that only names the problem. It is a
process of hiding the inner activities and only showing the essential features of the
object to the user. For example, if a person uses his phone to send a message, he will
enter the text of the message, the recipient's information and press the send button.
When he started sending the message, he didn't know what was going on during the
sending process but only knew if the result of the message was successfully sent to the
recipient. So, in this example, the process of sending the message has been hidden and
only shows the functions that the user needs is the function of entering the message

Page 6
content, the recipient information, the result of sending the message successfully or
failure. That is abstraction.
❖ Advantages of using abstraction for programming:
− Abstraction allows programmers to eliminate the complexity of an object by only
giving the object's needed attributes and methods in programming, improving
the maintainability of the system.
− Abstraction helps us focus on the essential core of the object rather than being
concerned with how it works.
− Abstraction provides many extended features when used in combination with
polymorphism and inheritance in object-oriented programming.
− Java abstracts through abstract classes and interfaces. In this article, I will guide
you to learn about abstract classes and abstract methods

3. Encapsulation
❖ Definition
- This property does not allow the user to change the intrinsic state of an
object. Only the object's internal methods allow to change its state. In any
way, allowing the external environment to affect the internal data of an
object is entirely up to the person writing the code. This is a property that
ensures the integrity of the object. Encapsulation enables a group of
properties, methods, and other members to be considered a single unit or
object.
❖ Example

❖ Implementation
- Public: Access to all code in the program
- Private: Access to only members of the same class
Page 7
- Protected: Access to members of same class and its derived classes
- Internal: Access to current assembly

4. The concept of inheritance


❖ Definition
- This feature allows an object to have the properties that other objects already
have through inheritance. This allows objects to share or expand available
features without having to redefine. However, not all object-oriented languages
have this property.
- Multi-level Hierarchy: A derived class can have only one direct base class.
However, inheritance is transitive. If ClassC is derived from ClassB, and ClassB is
derived from ClassA, ClassC inherits the members declared in ClassB and ClassA.

❖ Purpose
- The purpose of inheritance is to reuse common methods and attributes among
classes without recreating them. Reusability of a code enables you to use the
same code in different applications with little or no changes.
❖ Example
- I am presenting an example that is quite familiar to movies viewer. You know in
the “Lion King”, Simba is Mufasa son and in “Lion King 2”, Kiara is Simba daughter,
meaning Simba inherits from Mufasa and Kiara inherits from both Simba and
Mufasa:

Page 8
➢ Protected Access Modifier:
- The protected access modifier protects the data members that are declared
using this modifier.
- The protected access modifier is specified using the protected keyword.
- Variables or methods that are declared as protected are accessed only by the
class in which they are declared or by a class that is derived from this class.
- The following figure displays an example of using the protected access modifier:

➢ Base keyword: The base keyword allows you to do the following:


+ Access variables and methods of the base class from the derived class
+ Re-declare the methods and methods defined in the base class
+ Invoke the derived class data members
+ Access the base data using “base” keyword

Page 9
➢ New keyword:
- The new keyword can either be used as an operator or as a modifier in C#. This
allows you to redefine the inherited methods or variables in the derived class.
Since redefining the base class members in the derived class results in base class
members being hidden, the only way you can access these is by using the base
keyword.

-
5. Concept of polymorphism
Polymorphic techniques in object-oriented programming languages enable
programmers to increase the ability to reuse code written in a general way and can
change behavior flexibly. depending on the type of object.
Polymorphism in Java is understood in each case, different circumstances, the
object has different morphology depending on the context. The polymorphic object is a
special object because sometimes it becomes another object and sometimes it becomes
another object (depending on the situation). This "role-playing" in different objects
makes it possible for the original polymorphic object to perform different actions of
each specific object.

6. Interface
❖ Features of Interface
− The interface has only abstract methods.
− Interface is a technique to achieve complete abstraction and multiple inheritance
in C#.
− The interface always has a modifier: public interface, whether you explicitly
specify it or not.
− If there are fields, they are: public static final, whether you specify them.
− Its methods are abstract methods, meaning there is no function body, and all
modifiers are: public abstract, whether you declare it or not.

Page 10
− Interface has no constructor.
− An interface is not a class. Writing an interface is like writing a class, but they
have two different definitions. A class describes the properties and behavior of
an object. An interface contains the behaviors a class implements.
− Unless an interface implementation class is an abstract class, all of the interface's
methods need to be defined in the class.
− The IDE adds the keyword public abstract before the interface method and public
static final keywords before data members.

➢ An interface like a class by the following points:

− An interface is written in a file in .java format, with the interface name the same
as the file name.
− The interface's Bytecode is saved in a .class file format.
− Declaring interfaces in a package, the corresponding bytecode files also have a
directory structure with the same package name.

➢ An interface differs from a class in some of the following ways:


− You cannot initialize an interface.
− An interface does not contain any construct or functions.
− All interface methods are abstract.
− An interface cannot contain any fields except those that are both static and final.
− An interface cannot inherit from a class, it is implemented by a class.
− An interface can inherit from many other interfaces.

Page 11
P2. Design and build class diagrams using a UML tool

1. Scenario
Based on the scenario, we are developing a Student Management System for FPT
Academy International. The system requirement the information below:

Page 12
Page 13
2. Use-case Diagrams:
To present a brief look at what the system can do, we need to draw out a use-case
diagram - a diagram showing how users in the system can interact with the system via
the features. Thus, and according to the above information, we can have the following
use-case diagrams

Page 14
Use-case 1: Management System

− In the above diagram, you can see that User (or Admin) can access 3 main
options,
− “Managing Student”, “Managing Lecturer” and “Exit”
− Choosing “Managing Student”, system will display a Menu allowing user to
manage the students via the functionalities (Add, Search, View, Delete, Update)
Choosing “Managing Lecturer”, system will display a Menu allowing user to
manage the lecturers via the functionalities (Add, Search, View, Delete, Update)
− Choosing “Exit”, system will end.
− We can briefly imagine how the system would work through the above diagram,
now we will take a closer look on how we can manage the students and the
lecturers.

Page 15
Use-case 2: Student Manage System

− As you can see, the user will manage the students and lecturers through the functions: Add
new Student, View all the Student, Search the Student, Update Student, Delete the Student
and Return to Main Menu.
− In case, we want to stop adjust and examine the target or want to change to the other
Managing side.

Page 16
Use-case 3: Lecturer Manage System

− As you can see, the user will manage the students and lecturers through the functions: Add
new Lecturer, View all the Lecturer, Search the Lecturer, Update Lecturer, Delete the
Lecturer and Return to Main Menu.
− In case, we want to stop adjust and examine the target or want to change to the other
Managing side.

Page 17
3. Class Diagrams:
− After knowing the actual functions that will be used to manage the targets, we now
need to determine the classes, the interfaces and their relationship that will be used
in the system. And to determine those, I drew the following Class Diagram - one of
the most important diagrams of software design, it shows the structure and
relationship between the components that make up the software.

Class diagram: Management System

− As you can see in the diagram, there are 6 classes (Main Menu, Student Menu,
Lecturer Menu, Student, Lecturer, Person) and one interface (Function) that will be
used in the system and their relationships are also clearly defined.

Page 18
Name Type Description Relationship

Including the ability to access Association


the menu of student and Relationships:
Main Menu Class
lecturer as well as exit the With “Student Menu” and
program “Lecturer Menu”

Including the functionalities of


Add new object, View all
Generalization relationship:
objects, Search object, Delete
inherit by
Function Interface object, Update object and
“Student Menu” and
Return to Main Menu (object
“Lecturer Menu”
here refer to both student and
lecturer)

Including the properties of the


object (student and lecturer): Generalization relationship:
Person Class Name, Date of birth, Address, inherit by
Email with the conditions in “Student” and “Lecturer”
the scenario

Including the properties from


Generalization relationship:
“Person” and other
inherit from “Person”.
properties: Id and Name with
Student Class Dependency
the conditions in the scenario,
Relationships: with
Student List for
“Student Menu”
data storage

Page 19
Including the properties from Generalization relationship:
“Person” and other inherit from “Person”.
Lecturer Class properties: Id and Name with Dependency
the conditions in the scenario, Relationships: with
Lecturer List for data storage “Lecturer Menu”

Association
Relationships:
Including the functionalities in
Student With “Main Menu”.
Class the “function” as well as the
Menu Dependency
data in the “Student”
Relationships: with
“Student”

Association
Relationships:
Including the functionalities in
Lecturer With “0Main Menu”.
Class the “function” as well as the
Menu Dependency
data in the “Lecturer”
Relationships: with
“Lecturer”

Page 20
[M1 & M2] Determine a design pattern and define class diagrams
using a UML tool for each of the creational, structural, and
behavioral pattern types

1. Design Pattern
− Design Patterns in the object-oriented world is a reusable solution to common
software design problems that occur repeatedly in real-world application
development. It is a template or description of how to solve problems that can be
used in many situations.
− "A pattern is a recurring solution to a problem in a context."
− "Each pattern describes a problem that occurs over and over again in our
environment, and then describes the core of the solution to that problem, in such
a way that you can use this solution a million times over, without ever doing it the
same way twice." - Christopher Alexander, A Pattern Language.
− Patterns are used by developers for their specific designs to solve their problems.
Pattern choice and usage among various design patterns depends on individual
needs and problems.
− Design patterns are a very powerful tool for software developers. It is important
to understand design patterns rather than memorizing their classes, methods, and
properties. It is also important to learn how to apply patterns to specific problems
to get the desired result. This will be the required continuous practice for using
and applying design patterns in day-to-day software development. First, identify
the software design problem then see how to address these problems using
design patterns and determine the best-suited design problem to solve the
problem.
− There are 23 design patterns, also known as Gang of Four (GoF) design patterns.
The Gang of Four is the authors of the book, "Design Patterns: Elements of
Reusable Object-Oriented Software". These 23 patterns are grouped into three
main categories:

Page 21
Design Patterns

2. Creational Pattern
− The creational patterns aim to separate a system from how its objects are
created, composed, and represented. They increase the system's flexibility in
terms of what, who, how, and when of object creation.
− As modern software engineering depends more on object composition
than class inheritance, emphasis shifts away from hard-coding behaviors
toward defining a smaller set of basic behaviors that can be composed into
more complex ones. Hard-coding behaviors are inflexible because they
require overriding or reimplementing the whole thing to change parts of the
design. Additionally, hard coding does not promote reuse and makes it
difficult to keep track of errors. For these reasons, creational patterns are
more useful than hardcoding behaviors. Creational patterns make design
become more flexible. They provide different ways to remove explicit
references in the concrete classes from the code that needs to instantiate
them. In other words, they create independency for objects and classes.

Page 22
− Consider applying creational patterns when:
• A system should be independent of how its objects and products
are created.
• A set of related objects is designed to be used together.
• Hiding the implementations of a class library or product, revealing
only their interfaces.
• Constructing different representation of independent complex
objects.
• A class wants its subclass to implement the object it creates.
• The class instantiations are specified at run-time.
• There must be a single instance and client can always access this
instance.
• Instance should be extensible without being modified.
− Types of creational design patterns:
1. Factory Method
2. Abstract Factory
3. Builder
4. Prototype
5. Singleton

− I will use Abstract Factory Pattern to give an example:

Creational Pattern

Page 23
2.1. Definition:
- Abstract Factory Pattern is an object-oriented pattern design in computer
software design, providing a class interface that creates a set of related or
interdependent objects without specifying them as specific classes.
- Abstract Factory design pattern encapsulates a group of classes that play
a "production" role in the application, which are the classes used to create
objects. These production classes share a programming interface
inherited from a pure virtual parent class called "virtual production layer".

2.2. Why use it:


- Initializing Objects that hides the logical handling of creation. o It
alleviates the exchange of objects families. o It promotes consistency
between objects.

2.3. Scenario:
- I use a smartphone's information description program to illustrate
the structure of Abstract Factory Pattern.
- The example here is implementing an Abstract Factory in the form
of the IMobilePhone Interface, which has methods that can create
Smartphone object and Normal Phone objects. The client code against
IMobilePhone and gets ISmartPhone and INormalPhone interfaces.
- In the case of "Nokia", it creates a family of Nokia objects
(SmartPhone and NormalPhone) and in the "Samsung" case, creates a
family of Samsung objects (SmartPhone and NormalPhone). o
IMobilePhone interface returns as it codes against ISmartPhone and
INormalPhone interface.

Page 24
2.4. Class Diagram:

Example - Class Diagram

3. Structural Pattern
− Structure designs are designs that make it easy to design by simply identifying a
relationship between entities.
− Structure patterns describe ways to assemble objects to perform a new function.
− Identify how different classes and objects are combined to form larger structures.
− Structure class patterns use inheritance to edit interfaces or settings. The structured
object templates compose objects for new functions.

Page 25
− Types of Structural Design patterns:
1. Adapter

2. Bridge

3. Composite

4. Decorator

5. Facade

6. Flyweight

7. Proxy

Structural Pattern

− I will use Decorator Pattern to give an example:

3.1 Definition:
− Decorator Pattern is a design pattern that allows adding behavior to an individual
object, without affecting the behavior of other objects in the same class.
− This type of design has a structure that acts as a wrap for the existing layer.
Whenever a new feature is needed, the existing object is wrapped in a new object
(decorator class).

Page 26
3.2 Why use it:
- It provides greater flexibility than static inheritance. o It enhances the scalability
of the object because changes are made by coding new layers.
- It simplifies coding by allowing you to develop a range of functions from targeted
classes instead of coding all the behavior into the object.

3.3 Scenario:
In this program I will illustrate the process of enchanting an item in a game such
as Sword and Iron armor, the program will return the name and value of the item.

3.4 Class Diagram:

Example - Class Diagram

4. Behavior Pattern
− Behavioral design patterns are designs that identify common communication
patterns between objects and identify patterns. By doing so, these patterns increase
the flexibility in making this communication.
− Behavioral patterns are concerned with communication (interaction) between the
objects, with the assignment of responsibilities between objects. Moreover,
encapsulating behavior in an object and delegating requests to it.

Page 27
− Types of Behavioral Design Patterns:

• Chain of Responsibility

• Command

• Interpreter

• Iterator

• Mediator

• Memento

• Observer

• State

• Strategy

• Visitor

• Template Method

Behavioral Pattern

Page 28
− In this part I will use Strategy Pattern to give an example:
4.1. Definition:
The strategy pattern (also known as the policy pattern) is a behavioral software
design pattern that enables selecting an algorithm at runtime. Instead of implementing a
single algorithm directly, code receives run-time instructions as to which in a family of
algorithms to use. Strategy lets the algorithm vary independently from clients that use it.
Deferring the decision about which algorithm to use until runtime allows the calling code
to be more flexible and reusable.

4.2. Why use it:


o It provides an alternative to subclasses. o It defines each behavior in its own class,
eliminating the need for conditional statements. o It makes it easy to extend and
incorporate new behaviors without changing applications.

4.3. Scenario:
I will use the program to sum and difference of two integers to illustrate the
Strategy Pattern structure.

4.4. Class Diagram:

Example - Class Diagram

Page 29
D1. Analyse the relationship between the object-orientated
paradigm and design patterns

First, a paradigm is simply a programming style or approach. Object Oriented


Programming, for example, is a paradigm. If you follow this paradigm, you'll approach
the overall program through objects. The objects contain data and behaviors, which you
must connect in logical ways to complete the task. Besides, design pattern is a tried and
tested solution to a common programming pattern. It could be considered a best
practice. If you approach a program using an Object-Oriented paradigm, there are
several design patterns you can then draw on to solve specific problems.

In addition, Object-Oriented programming is a paradigm in and of itself.


Procedural programming, functional programming, and other programming paradigms
are examples. Design patterns are nothing more than a solution to a recurring problem.
However, this solution is reliable, scalable, readable, and adaptable. They can also be
found in other programming paradigms. Moreover, many design patterns are focused
on specific needs or situations, and their presentation is typically Object Oriented in
style and notation. Nevertheless, there's no reason to believe that a Design Pattern can't
use and combine other Design Patterns.

Furthermore, Design Patterns are well-known approaches to resolving problems


in OOP programming. Knowing about design patterns can help you save time when
deciding what to buy. When deciding how to approach a situation, knowing about
design patterns can help save time. For instance, some design patterns, such as the
Visitor Pattern, allow you to do things that would otherwise be impossible or
complicated, such as adding new functionality to a group of classes without them
realizing it. One would create an interface or virtual methods using standard OOP
techniques for each class. An interface or virtual methods that each class implements
would be created using standard OOP techniques. This is in violation of the OOP
open/closed principle.

In conclusion, Design patterns are procedures, and OOP are the paradigm to
execute the procedures and produce the result. Therefore, both the Object-Oriented
Paradigm and design patterns make life easier for the software developer by fixing the
complex requirements.

Page 30
D2. Define/refine class diagrams derived from a given code
scenario using a UML tool

The UML Class diagram is a graphical notation used to construct and visualize object-
oriented systems. A class diagram in the Unified Modeling Language (UML) is a type of
static structure diagram that describes the structure of a system by showing the
system's: o classes, o their attributes, o operations (or methods), o and the relationships
among objects.

❖ UML Class Notation

A class represent a concept which encapsulates state (attributes) and behavior


(operations). Each attribute has a type. Each operation has a signature. The class name is
the only mandatory information.

− Class Name:

➢ The name of the class appears in the first partition.

− Class Attributes:

➢ Attributes are shown in the second partition. o The attribute


type is shown after the colon. o Attributes map onto member
variables (data members) in code.

− Class Operations (Methods):

➢ Operations are shown in the third partition. They are services


the class provides.

Page 31
➢ The return type of a method is shown after the colon at the
end of the method signature.
➢ The return type of method parameters is shown after the
colon following the parameter name. Operations map onto
class methods in code.

❖ Class Visibility

+, - and # are the symbols before an attribute and operation name in a class denote
the visibility of the attribute and operation.

Class Visibility

➢ (+) denotes public attributes or operations


➢ (-) denotes private attributes or operations
➢ (#) denotes protected attributes or operations

Page 32
❖ Parameter Directionality

Each parameter in an operation (method) may be denoted as in, out or in out which
specifies its direction with respect to the caller. This directionality is shown before the
parameter name.

Parameter Directionality

❖ Perspectives of Class Diagram


− The choice of perspective depends on how far along you are in the development
process. During the formulation of a domain model, for example, you would seldom
move past the conceptual perspective. Analysis models will typically feature a mix of
conceptual and specification perspectives.
− Design model development will typically start with heavy emphasis on the
specification perspective and evolve into the implementation perspective.
− A diagram can be interpreted from various perspectives:
➢ Conceptual: represents the concepts in the domain.
➢ Specification: focus is on the interfaces of Abstract Data Type (ADTs) in
the software.
➢ Implementation: describes how classes will implement their interfaces.

Perspectives of Class Diagram

Page 33
❖ Relationships between classes
− UML is not just about pretty pictures. If used correctly, UML precisely conveys
how code should be implemented from diagrams. If precisely interpreted, the
implemented code will correctly reflect the intent of the designer.
− A class may be involved in one or more relationships with other classes. A
relationship can be one of the following types:

Relationships between classes

− The figure above describes what each of the relationships mean relative to the
target programming language. This section is meant to help to understand UML
class relationships.

Page 34
❖ Class Diagram Example:

Example - Class Diagram

This is a manager's development system. Create a system that can manage students
as well as subject teachers. When users first launch the app, they will have the option of
viewing the student or lecturer management screens.

The administration could add, edit, delete, and perform query tasks such as
searching. Then you can see what you've seen. Thus, we'll be able to see what we've
changed. This can be viewed as a solution that simplifies management.

Page 35
Conclusion

In this assignment, I explained characteristics of Object-oriented programming


paradigm by applying Object-oriented analysis and design on a given (assumed) scenario
and examined various characteristics of OOP (such as: abstraction, encapsulation,
inheritance, polymorphism)

Besides, I also introduced some design patterns (including 3 types: creational,


structural, and behavioral) to give real case scenarios, corresponding patterns illustrated
by UML class diagrams. In addition, I analyzed the relationship between the object-
orientated paradigm and design patterns.

After all, I have just completed my report and learned a lot of knowledge by
doing this assignment.

Page 36
References

[1] GeeksforGeeks. 2022. C# | Abstract Classes - GeeksforGeeks. [ONLINE] Available


at: https://www.geeksforgeeks.org/c-sharp-abstract-classes/. [Accessed 20
August 2022].
[2] Educative: Interactive Courses for Software Developers. 2022. What is object-
oriented programming? OOP explained in depth. [ONLINE] Available
at: https://www.educative.io/blog/object-oriented-programming. [Accessed 20
August 2022].
[3] GeeksforGeeks. 2022. C# | Constructors - GeeksforGeeks. [ONLINE] Available
at: https://www.geeksforgeeks.org/c-sharp-constructors/?ref=lbp. [Accessed 20
August 2022].
[4] GeeksforGeeks. 2022. C# | Inheritance - GeeksforGeeks. [ONLINE] Available
at: https://www.geeksforgeeks.org/c-sharp-inheritance/?ref=lbp. [Accessed 20
August 2022].
[5] GeeksforGeeks. 2022. C# | Encapsulation - GeeksforGeeks. [ONLINE] Available
at: https://www.geeksforgeeks.org/c-sharp-encapsulation/?ref=lbp. [Accessed
20 August 2022].
[6] GeeksforGeeks. 2022. C# | Abstraction - GeeksforGeeks. [ONLINE] Available
at: https://www.geeksforgeeks.org/c-sharp-abstraction/?ref=lbp. [Accessed 20
August 2022].
[7] WhatIs.com. 2022. What is polymorphism? - Definition from WhatIs.com.
[ONLINE] Available
at: https://www.techtarget.com/whatis/definition/polymorphism#:~:text=In%20
object%2Doriented%20programming%2C%20polymorphism,have%20more%20t
han%20one%20form.. [Accessed 20 August 2022].
[8] Educative: Interactive Courses for Software Developers. 2022. What is
polymorphism? [ONLINE] Available at: https://www.educative.io/answers/what-
is-polymorphism. [Accessed 20 August 2022].
[9] Lucidchart. 2022. UML Class Diagram Tutorial | Lucidchart. [ONLINE] Available
at: https://www.lucidchart.com/pages/uml-class-diagram. [Accessed 20 August
2022].

Page 37
[10] Viblo. 2022. Design Pattern: Class Diagram. [ONLINE] Available
at: https://viblo.asia/p/design-pattern-class-diagram-L4x5xGVYlBM. [Accessed 20
August 2022].
[11] What's a design pattern?. 2022. [ONLINE] Available
at: https://refactoring.guru/design-patterns/what-is-pattern. [Accessed 20
August 2022].
[12] Design Pattern Quick Guide. 2022. [ONLINE] Available
at: https://www.tutorialspoint.com/design_pattern/design_pattern_quick_guide
.htm. [Accessed 20 August 2022].
[13] Creational Design Patterns. 2022. [ONLINE] Available
at: https://refactoring.guru/design-patterns/creational-patterns. [Accessed 20
August 2022].
[14] Structural Design Patterns. 2022. Structural Design Patterns. [ONLINE]
Available at: https://refactoring.guru/design-patterns/structural-patterns.
[Accessed 20 August 2022].
[15] Behavioral Design Patterns. 2022. Behavioral Design Patterns. [ONLINE]
Available at: https://refactoring.guru/design-patterns/behavioral-patterns.
[Accessed 20 August 2022].
[16] Abstract Factory. 2022. Abstract Factory. [ONLINE] Available
at: https://refactoring.guru/design-patterns/abstract-factory. [Accessed 20
August 2022].
[17] Decorator. 2022. Decorator. [ONLINE] Available
at: https://refactoring.guru/design-patterns/decorator. [Accessed 20 August
2022].
[18] Strategy. 2022. Strategy. [ONLINE] Available
at: https://refactoring.guru/design-patterns/strategy. [Accessed 20 August
2022].
[19] Abstract Class In C#. 2022. [ONLINE] Available at: https://www.c-
sharpcorner.com/UploadFile/annathurai/abstract-class-in-C-Sharp/. [Accessed
21 August 2022].
[20] Quora. 2022. What is the relationship between object-oriented
paradigms and design patterns? - Quora. [ONLINE] Available
at: https://www.quora.com/What-is-the-relationship-between-object-oriented-
paradigms-and-design-patterns. [Accessed 21 August 2022].
Page 38

You might also like