Download Asm 2 Advanced programming (pass) and more Assignments Advanced Algorithms in PDF only on Docsity!
ASSIGNMENT 2 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 20: Advanced Programming
Submission date September 13 th 2022 Date Received 1st submission September 13 th 2022
Re-submission Date Date Received 2nd submission
Student Name Huỳnh Trần Anh Khoa Student ID GCS
Class GCS0903A Assessor name Lâm Nguyễn Trung Nam
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 KHOA
Grading grid
P3 P4 M3 M4 D3 D
X X
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date:
Lecturer Signature:
ASSIGNMENT 2 BRIEF
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 2 : Advanced Programming
Assignment title Application development with class diagram and design patterns
Academic Year 2018 - 2019
Unit Tutor Doan Trung Tung
Issue date 30 April 2019 Submission date 11 May 2019
Submission Format:
Format: The submission is in the form of an individual 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
Table of Contents
1) Input ...................................................................................................................................................................... 5 Program .................................................................................................................................................................... 5 User Interface ........................................................................................................................................................... 6 Book .......................................................................................................................................................................... 9 BookList .................................................................................................................................................................... 9 2) Output ................................................................................................................................................................. 10 P4 Discuss a range of design patterns with relevant examples of creational, structural and behavioral pattern types. ............................................................................................................................................................................... 11 1) Design Pattern ........................................................................................................................................................... 11 2) Function of Design Pattern ............................................................................................................................... 11 3) Classify ................................................................................................................................................................... 11 Creational: .............................................................................................................................................................. 11 Structural: .............................................................................................................................................................. 16 Behavioral: ............................................................................................................................................................. 18 Reference ........................................................................................................................................................................ 30 P4 Discuss a range of design patterns with relevant examples of creational, structural and behavioral pattern types. M4 Reconcile the most appropriate design pattern from a range with a series of given scenarios. D4 Critically evaluate a range of design patterns against the range of given scenarios with justification of your choices.
P3 Build an application derived from UML class diagrams.
1) Input
Program
2) Output
P4 Discuss a range of design patterns with relevant examples
of creational, structural and behavioral pattern types.
1) Design Pattern
Design patterns are comprehensive solutions that have been optimized and reused for
common software design problems that we face on a daily basis. This is a collection of well-
thought-out solutions to specific problems.
2) Function of Design Pattern
This solution can be used by programs to solve similar problems. You may come up with a
solution to the problems you encounter, but it may not be optimal.
You must understand that it is not a specific language. Most programming languages support
design patterns. It assists you in solving problems in the most efficient manner possible by
providing solutions in object-oriented programming (OOP).
3) Classify
There are three types of design patterns:
Creational:
Objects are created in Creational Design Patterns. When creating objects in a controlled
manner, they reduce complexity and instability.
The new algorithm is widely regarded as harmful because it disperses objects throughout the
application.
Because layers become increasingly intertwined, changing deployments can become difficult
over time.
Creational Design Patterns addresses this issue by completely removing the client from the
initial creation process.
• Create the same related dependency objects as an abstract factory. Abstract Factory
designs are used to create families of objects that are related or dependent on one
another. It is also known as a "factory of factories."
Example:
- The Singleton design pattern is used to test the initialization of objects of a specific class by ensuring that only one object of the object exists in the Java Virtual Machine. A Singleton class also provides a single global access point for the object, ensuring that any subsequent calls to the access point return only that object. Example:
- Builder: This design pattern focuses on abstraction and is excellent at dealing with complex objects; however, the design is somewhat complex. Example:
- Prototype Structural: Structural Patterns (SP) are Design Patterns (DPs) in Software Engineering that facilitate design by defining a simple way to realize relationships between entities.
- Adapter: An adapter pattern is a pattern that acts as an intermediary between two layers, converting the interface of one or more existing layers into another that is appropriate for the layer being written. This allows classes with different interfaces to easily communicate with one another via intermediate interfaces without having to change the code of the existing or newly written class. The Adapter Pattern, also known as the Wrapper Pattern, provides a compatible "overlay" interface to an existing system, has consistent data and behavior, but has an interface that is incompatible with the class being written. Example: