Assigment2-Advanced Programing- Hải Đăng - 2
Assigment2-Advanced Programing- Hải Đăng - 2
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Grading grid
P3 P4 M3 M4 D3 D4
Summative Feedback: Resubmission Feedback:
ADVANCED
PROGRAMING
Table of Figures
Figure 1 UML Class Diagram of the scenario ........................................................................................5
Figure 2 Class Diagram from code .......................................................................................................6
Figure 3 Origin Class Code ...................................................................................................................6
Figure 4 Dogs Class Code.....................................................................................................................7
Figure 5 Program Class Code ...............................................................................................................7
Figure 6 The result of scenario ............................................................................................................8
Figure 7 The result of scenario ............................................................................................................8
List of Tables
Table 1 Creational Patterns ............................................................................................................... 12
Table 2 Structural Patterns................................................................................................................ 16
Table 3 Behavioral Patterns .............................................................................................................. 23
Program Class:
Their task is to add a student's information to get the results printed on the screen. The order in which
the information is entered is the same as its variables in the Origin Class.
Singleton implementations
A single constructor,
which is private and
parameterless.
The class is sealed. This
is unnecessary, strictly
Set up receivers.
Create instructions,
and if necessary
connect them with
the receivers.
Build senders, and
associate basic
commands with
them.
The advantages of a
Command Pattern
Clear Concept of
Accountability.
You can decouple
classes that trigger
class operations
that execute certain
operations.
Principle open /
Closed. You can
insert new
commands into the
program without
breaking existing
client code.
You will have undo
/ redo activated.
You can perform
deferred operations.