Object-Oriented Programming and Design Patterns: A Comprehensive Guide for Students, Assignments of Advanced Algorithms

Scenario: (continued from Assignment 1) Your team has shown the efficient of UML diagrams in OOAD and introduction of some Design Patterns in usages. The next tasks are giving a demonstration of using OOAD and DP in a small problem, as well as advanced discussion of range of design patterns.

Typology: Assignments

2021/2022

Uploaded on 12/28/2022

ng-n-minh-anh
ng-n-minh-anh 🇻🇳

4.8

(26)

34 documents

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Higher Nationals in Computing
Unit 20: Advanced Programming
ASSIGNMENT 1
Learner’s name: NGO TRAN BAO PHUC
ID: GCS200731
Class: GCS0905C
Subject code: 1651
Assessor name: Le Ngoc Thanh
Assignment due: Assignment submitted: 12/4/2022
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Object-Oriented Programming and Design Patterns: A Comprehensive Guide for Students and more Assignments Advanced Algorithms in PDF only on Docsity!

Higher Nationals in Computing

Unit 2 0: Advanced Programming

ASSIGNMENT 1

Learner’s name: NGO TRAN BAO PHUC

ID: GCS

Class: GCS0905C

Subject code: 1651

Assessor name: Le Ngoc Thanh

Assignment due: Assignment submitted: 1 2 / 4 / 2 0 2 2

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 20: Advanced Programming Submission date 04/12/2022 Date Received 1st submission 04/12/ Re-submission Date Date Received 2nd submission Student Name Ngo Tran Bao Phuc Student ID GCS Class GCS0905C^ Assessor name Le Ngoc Thanh 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 P1 P2 M1 M2 D1 D

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. 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 characteristics of the object-orientated paradigm M1 Determine a design pattern from each of the creational, structural and behavioural pattern types. D1 Analyse the relationship between the object- orientated paradigm and design patterns.

as well as the various class relationships. LO2 Design a series of UML class diagrams P2 Design and build class diagrams using a UML tool. M2 Define class diagrams for specific design patterns using a UML tool. D2 Define/refine class diagrams derived from a given code scenario using a UML tool.

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

1. What is an object-oriented paradigm (OOP)  A computer programming paradigm known as object-oriented programming (OOP) centers software design around data and objects rather than on functions and logic. An object is a data field with particular characteristics and behavior.  OOP puts less emphasis on the logic needed to use the objects than it does on the objects that developers desire to modify. This method of programming works best for extensive, intricate programs that are often updated or maintained. This encompasses mobile applications as well as design and production software. OOP, for instance, can be applied to manufacturing system simulation software. (Gillis A. 2021) 2. The structure of OOP  The following are some of the components, or building pieces, of object-oriented programming:  Class: User-defined data types called classes serve as the building blocks for specific objects, properties, and methods.  Object: are instances of a class that were generated using data that was precisely defined. Both concrete and abstract items can be considered as objects. The description is the sole item that is first specified when a class is created.  Method: are described as internal class functions that explain an object's behaviour. The first line of code in every method seen in class declarations is a reference to an instance object. Additionally, an object's internal functions are referred to as instance methods. Programmers utilize techniques to make code reusable or to keep functionality contained to a single object at a time.  Attributes: The class template defines attributes, which stand in for an object's state. Data will be kept in the attributes field of objects. Class characteristics are the property of the class. (Doherty E. 2020)

3. General concepts of OOPEncapsulation: encapsulation concept, only specific information is accessible while all essential information is kept inside an object. Each object's implementation and state are kept secretly inside a designated class. This class is not accessible to other objects, nor do they have the power to modify it. Only a limited set of public functions or methods can be called by them. Data concealing using this feature enhances application security and prevents inadvertent data damage.

required for each execution of that object from a parent class. The functionality of the parent class is then expanded by a child class that is formed. Different sorts of objects can flow via the same interface thanks to polymorphism.

4. Design Patterns 4.1. Definition  A design pattern is an all-encompassing technique for resolving problems that typically occur while developing software using object-oriented programming (OOP).  The design pattern is the best kind of standard pattern that may be used in programming to solve several challenges of a similar sort at once, according to the results and support of multiple scholars.  A design pattern may be applied to any computer language. The majority of OOP programming languages, including PHP, C#, Java, Python, and many more, are compatible with it. 4.2. Creational Pattern

 In software engineering, creational design patterns deal with the processes of creating objects and make an effort to produce things in a situation-appropriate manner. The simplest approach to object creation could result in problems with the design or make the design more complex. Creational design patterns work to solve this problem by altering the way objects develop.  Creational design patterns are based on two fundamental ideas. One is keeping track of the specific classes the system uses. Another is to keep the method of producing and fusing examples of these concrete types a secret.  Class- and object-creational design patterns are further subdivided into creational design patterns that deal with the creation of objects and class instantiation, respectively. To put it another way, object creational patterns postpone some of their object creation to another object while class-creational patterns postpone their object creation to subclasses. 4.3. Structural Pattern  In software engineering, structural design patterns are patterns that identify a simple method to realize connections between things, thus simplifying the design.  This structural pattern structure's Design Pattern classification consists of 7 design patterns. Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy are among its components.  These design patterns are centered on the composition of classes and objects. Inheritance is used by structural class-creation patterns to create interfaces. Object composition techniques using structural object patterns are described in order to create new functionalities. 4.4. Behavioral Pattern  In software engineering, design patterns that expose common communication patterns between objects are referred to as behavioral design patterns. These patterns increase the number of available communication techniques.  This group has the most different categories for Design Patterns. There are up to 11 templates in this category. It incorporates the Chain of Responsibility, the Interpreter, and the Template

 In order to become a member, the User must first complete a registration form and obtain a library card ID. The user may then use all features, including feedback, borrowing, searching, and requesting books. The fundamental responsibilities of librarians are the addition and modification of books, book objects, and users.  User-accessible features:

  • Find books: To help user search books quickly by title, author, or category.
  • Borrow books: To borrow a book from the library.
  • Request new books: Ask for new books if they do not have them in the library. Return books: To give a member of the library a book that has been checked out.
  • Return books: To return a book that was checked out to a member of the library.
  • Register new user: To add the new member.  Managers can do the functions:
  • To assist librarians in adding, updating, or deleting books.
  • Manager of the library database: The librarian will oversee all of the books and user data. 3. Class Diagram  The class diagram for that system briefly describes the properties, methods, and connections between objects in the Library Management System class.

 Class in the library: It is in charge of everything. Software is mostly created with the organization in mind. Password and User are attributes. It uses the Register, Login, and Logout method. o User class: It oversees all user actions. Name and ID are attributes. Search, Borrow, Return, and Pay is the method. o Book class: It oversees all book-related operations. It is a fundamental component of the system. Name, ID, Author, and Category make up an attribute. Book detail is the method. o Manager class: It oversees all manager operations. Name and ID are attributes. the Add, Delete, and Edit method.