





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















ASSIGNMENT 1 FRONT SHEET Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 20: Advanced Programming Submission date 14 - 02 - 2022 Date Received 1st submission 14 - 02 - 2022 Re-submission Date Date Received 2nd submission Student Name DAO VINH KHANG Student ID GCS Class GCS0905B 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 KHANG Grading grid P1 P2 M1 M2 D1 D
ASSIGNMENT 1 BRIEF Qualification BTEC Level 5 HND Diploma in Business Unit number Unit 20: Advanced Programming Assignment title Examine and design solutions with OOP and Design Patterns Academic Year 2021 - 2022 Unit Tutor LE NGOC THANH Issue date 28 November 2022 Submission date IV name and 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.
Table Content Contents ASSIGNMENT 1 FRONT SHEET ........................................................................................................... 2 ASSIGNMENT 1 BRIEF..................................................................................................................... 4 P1 Examine the characteristics of the object-orientated paradigm as well as the various class relationships. ......................................................................................................................................... 9 Object-oriented programming ........................................................................................................... 9 Abstract calculation concept ........................................................................................................... 11 Encapsulation: .................................................................................................................................. 12 The concept of inheritance .............................................................................................................. 13 Concept of polymorphism ........................................................................................................... 14 Features of Interface........................................................................................................................ 15 P2 Design and build class diagrams using a UML tool. ........................... Error! Bookmark not defined. Scenario............................................................................................... Error! Bookmark not defined. Use-case Diagrams: ........................................................................ Error! Bookmark not defined. Class Diagrams: ............................................................................... Error! Bookmark not defined.
. ........................................................................................................... Error! Bookmark not defined. Activity Diagram: ................................................................................. Error! Bookmark not defined. REFERENCES ......................................................................................................................................... 27
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.
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 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.
Example code:
+ Definition
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 considered to be a
Its methods are abstract methods, meaning there is no function body, and all modifiers are: public abstract, whether you declare it or not. 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 Java Compiler adds the keyword public abstract before the interface method and public static final keywords before data members.
Use-case Diagrams:
Class Diagrams: