Assignment 1 Advanced Programming FPT, Assignments of Computer Science

Pass Assignment 1 Advanced Programming FPT

Typology: Assignments

2021/2022

Uploaded on 10/11/2022

unknown user
unknown user 🇻🇳

5

(13)

6 documents

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
BTEC Level 5 HND Diploma in Computing
Unit 20: Advanced Programming
Learner’s name: Nguyn Hùng Huân
ID: GBS200308
Class: GCS0903A
Subject code: 1651
Assessor name: Lâm Nguyn Trung Nam
Assignment due: Assignment submitted:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Assignment 1 Advanced Programming FPT and more Assignments Computer Science in PDF only on Docsity!

BTEC Level 5 HND Diploma in Computing

Unit 20 : Advanced Programming

Learner’s name: Nguyễn Hùng Huân

ID: GBS200 308

Class: GCS0903A

Subject code: 1651

Assessor name: Lâm Nguyễn Trung Nam

Assignment due: Assignment submitted:

ASSIGNMENT 1 FRONT SHEET Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 20: Advanced Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyễn Hùng Huân Student ID GBS Class GCS090 3 A 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 Huan Grading grid P1 P2 M1 M2 D1 D

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 Unit Tutor Lâm Nguyễn Trung Nam Issue date Submission date 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. 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 as well as the various class relationships. 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. 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.

Assignment Answer

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

1. What is object-orientated paradigm (OOP) Figure 1: Object-orientated paradigm (OOP) (GP Coder, 201 7 )

  • Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior.
  • OOP focuses on the objects that developers want to manipulate rather than the logic required to manipulate them. This programming approach is well-suited for programs that are large, complex, and actively updated or maintained. This includes programs for manufacturing and design, as well as mobile applications; for example, OOP can be used for manufacturing system simulation software.
  • The organization of an object-oriented program also makes the method beneficial to collaborative development, where projects are divided into groups. Additional benefits of OOP include code reusability, scalability, and efficiency.
  • The first step in OOP is to collect all of the objects a programmer wants to manipulate and identify how they relate to each other, an exercise known as data modeling.
  • Languages used in Object Oriented Programming: Java, C++, C#, Python, Ruby.

2. The structure of OOP The structure, or building blocks, of object-oriented programming, include the following:  Classes are user-defined data types that act as the blueprint for individual objects, attributes, and methods.  Objects are instances of a class created with specifically defined data. Objects can correspond to real-world objects or abstract entities. When class is defined initially, the description is the only object that is defined.  Methods are functions that are defined inside a class that describe the behaviors of an object. Each method contained in class definitions starts with a reference to an instance object. Additionally, the subroutines contained in an object are called instance methods. Programmers use methods for reusability or keeping functionality encapsulated inside one object at a time.  Attributes are defined in the class template and represent the state of an object. Objects will have data stored in the attributes field. Class attributes belong to the class itself. Figure 2: The structure in OOP (TechTarget, 2019) 3. General concepts of OOP Four Principles of OOP: The four pillars of object-oriented programming are:

**4. Design Patterns:

  • Definition:** A design pattern is a general strategy for overcoming challenges that frequently arise while creating software with object-oriented programming (OOP).
  • According to the findings and endorsement of several researchers, the design pattern is the best type of standard pattern that can be used in programming to address numerous issues of a similar sort at once.
  • A particular programming language is not required to use a design pattern. It is applicable to the majority of OOP programming languages, including PHP, C#, Java, Python, and many more. *** Creational Pattern:**
  • Creational design patterns in software engineering deal with object creation processes and attempt to generate things in a situation-appropriate way. The simplest method of object generation may lead to design issues or increase design complexity. Creational design patterns address this issue by influencing the process of object formation.
  • Two main concepts make up creational design patterns. One is storing information about the concrete classes the system use. Another is to conceal the process of creating and combining instances of these concrete types. Figure 4: Creational Pattern
  • Creational design patterns are further divided into class- and object-creational patterns, where class- creational patterns deal with class-instantiation and object-creational patterns deal with the creation of objects. In further detail, class-creational patterns defer their object creation to subclasses whereas object- creational patterns delay some of their object creation to another object. *** Structural Pattern:**
  • Structural design patterns in software engineering are design patterns that simplify the design by identifying an easy approach to realize connections between things.
  • The Design Pattern classification in this Structural Pattern structure includes 7 design patterns. It includes: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy.

Figure 5: Structural pattern

  • These design patterns are all about Class and Object composition. Structural class-creation patterns use inheritance to compose interfaces. Structural object-patterns define ways to compose objects to obtain new functionality. *** Behavioral Pattern.**
  • Design patterns known as behavioral design patterns in software engineering are those that reveal typical communication patterns between objects. These patterns broaden the range of communication methods possible.
  • This is the group with the largest number of Design Pattern classifications. The number of templates in this group is up to 11. It includes: Interpreter, Template Method, Chain of Responsibility. There are also Command, Iterator, Mediator, Memento, Observe, State, Strategy and Visitor. Figure 6 : Behavior pattern
  • These design patterns are all about Class's objects communication. Behavioral patterns are those patterns that are most specifically concerned with communication between objects.

2. Usecase Diagram Figure 7 : Usecase Diagram

  • In this diagram, Firstly, User must have a library card ID by fill up registration form to become a member. After that User can use all function like Search, Borrow, Request, Return book and feedback. Librarian mainly responsible for adding and modifying books, book items, and users.
  • Some function in this diagram:
  • Find books: To help user search book quickly by title, author or category.
  • Borrow books: To borrow a book from library.
  • Request new books: To ask for new books if them do not have in library.
  • Return books: To return a book that was checked out to a member to the library.
  • Feedback: Member can give ideas to improve their experience in this system.
  • Register new user: To adds new member.
  • Add/Update/Delete books: To help librarian add, update or modify books.
  • Accept feedback: To help librarian have feedback from user.
  • Manager Library database: Librarian will manage all books and users information.

3. Class Diagram

  • The attributes, methods, and relationships between objects in the Library Management System class are simply described in the class diagram for that system.
  • Library class: It oversees every operation. The primary purpose for which software is designed is in the organization. Attribute is UserName and Password. Method is Register(), Login(), and Logout().
  • User class: It manages all operations of user. Attribute is Name and ID. Method is Authenticate(), Searchbooks(), Borrowbooks(), Returnbooks(), Payfine(), andGivefeedback().
  • Book class: It manages all function of books. It is basic building block of system. Attribute is Name, ID, Authorname, and Catogory. Method is Displaybooksdetail().
  • Librarian class: It manages all operations of Librarian. Attribute is Name and ID. Method is Addnewbooks(), Deletebooks(), Updatebooks(), Collectfine(), and Collectfeedback(). Figure 8: Class Diagram