


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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
1 / 34
This page cannot be seen from the preview
Don't miss anything!



























Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 20: Advanced Programming Submission date 03/12/2022 Date Received 1st submission 06/12/ Re-submission Date 13/12/2022 Date Received 2nd submission 13/12/ Student Name Truong Quang HUy 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
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 2018 - 2019 Unit Tutor Doan Trung Tung Issue date 25 April 2019 Submission date 7 May 2019 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.
1 | P a g e P1 Examine the characteristics of the object-orientated paradigm as well as the various class relationships. One of the most used programming paradigms at the moment is object-oriented programming (OOP). OOP is a fairly accessible solution for programmers of all levels and areas because it is supported in some way by almost all major programming languages. Because of this, many individuals wonder why OOP is so widely used. There are also individuals that vehemently disagree with the employment of this programming paradigm within their businesses. Few individuals have, however, taken the effort to explore the reasons why so many programmers have chosen OOP over alternative algorithmic frameworks. The key elements that make object-oriented programming so successful are those listed above. Continue reading to find out more about how object orientation boosts code readability, reduces construction costs, and streamlines the software development process.
1. What is Object Oriented Programming The goal of object-oriented programming (OOP), a method for designing software, is to divide big systems into simpler, more manageable parts known as objects. This makes program organization and maintenance simpler. Applications may be made more adaptable and extendable thanks to OOP. Additionally, it encourages code reuse, which lowers the price of development. Modular code writing is made simpler by object-oriented programming, which is one of its main advantages. It is feasible to develop code that may be restructured and reused without impacting other sections of the program since the various components of an application are distinct objects. As a result, more complicated applications may be created with fewer lines of code than would otherwise be necessary. The ability for an application to be more adaptable and extendable is another benefit of OOP. An application's components are all objects, thus it's feasible to alter one component without having to update or rebuild the entire program. As a result, programs may be created with more customization than they otherwise could.OOP also encourages the reuse of code. Each component is an object, making it feasible to reuse previous work without starting from scratch in new projects. Developers may create complicated apps using less code than would otherwise be necessary, which lowers development costs. Example:
3 | P a g e 2.1. Encapsulation: Another feature of OOP is the emphasis on data and functionality encapsulation within objects. Objects are defined with particular functionality that determines how the objects interact with one another. Data encapsulation is a critical component of OOP. This is due to the fact that it prohibits hackers from changing data saved in the database. If hackers are able to change the data in the database, the consequences for the firm might be severe. The method through which programmers segregate data within an object is known as encapsulation. It stops hackers from examining the data's specifics as well as the database's structure. The two primary components of the OOP paradigm that promote security are data encapsulation and abstraction. a. Any programming framework meant to hold sensitive data must have thes
4 | P a g e 2.2. Abstraction:
6 | P a g e 2.3. Classes and Objects: The defining of classes is the next feature of object-oriented programming. A class is where an object's blueprint is specified. The blueprint describes the object's methods, characteristics, and other properties. Classes are used to build objects. A class is sometimes known as an object's blueprint. It defines the object's attributes, methods, and other characteristics. Classes are used to build objects. A class is simply an object's blueprint. It defines the object's attributes, methods, and other characteristics. 2.4. Inheritance and Composition: Inheritance and composition are other features of OOP. The technique of allowing one object to generate another is known as inheritance. It effectively lets one object "inherit" another object's attributes, methods, and other characteristics. The practice of mixing many items to produce a new and distinct entity is known as composition. It effectively allows programmers to reuse parts peculiar to other objects in order to generate a new and distinct entity. One of the most essential characteristics of OOP is the ability to combine objects and inherit their attributes. In every programming language, this is how objects are generated and utilized. It is the basis of OOP
7 | P a g e 2.5. Binding:
9 | P a g e also knowing how to pass it along to other things. When an object wishes to transfer data to another object, it simply calls the corresponding method on that other object. This allows items to talk with one another and form intricate chains of objects. Message forwarding is one method through which things may communicate. Message passing is the act of transmitting a message from one object to another. Each item has a unique "address" that other things can use to communicate with them. When an object receives a message, it simply reads it and takes the appropriate action in accordance with the message. The entire program might be made up of various objects interacting with one another in this fashion. Message passing makes it considerably simpler for programs to grow in complexity and for objects to engage in fascinating interactions with one another. Even though message passing is one of the most fundamental types of communication in OOPS, it's a crucial idea to comprehend if you wish to create more complex systems.
3. Object- Orientated Class relationships 3.1. Generalization/ Inheritance When one class inherits properties and methods from another, this is referred to as inheritance. Inherited classes are referred to as kid classes (also called sub-classes). These classes are descended
10 | P a g e from parent classes (also known as superclasses). It is frequently used when two or more classes share a set of common methods or attributes: The parent class may be made more abroad, and it can include the common characteristics. Child classes will be more specialized, adding to or modifying the parent class's characteristics.An animal class hierarchy is a frequent illustration in OOP literature. Say you teach a lesson on dogs. A Dog class may include methods like eat(), bark(), and rollOver, as well as properties for name, working (true or false) and color (). There may also be a Cat class. A Cat class could have methods like eating as well as properties for color, name, declawed (true/false) (), and both scratch furniture, and meow() (). Both the Cat class and the Dog class include an eat() function as well as color and name properties. It is preferable to combine these similar parts into a single class rather than writing these attributes (and associated accessor/mutator functions) repeatedly in both classes. As a result, we may create a class named Pet with the properties name and color as well as the function eat (). Pet would become the parent class, while Dog and Cat would become the children. The name, color, and eat() methods are inherited by the Dog and Cat classes. Then, we can add declawed, meow(), and scratchFurniture() to the Cat and working, bark, and rollOver() to the Dog Inheritance is depicted in the UML as a solid line between the parent class with the child class (es). The parent is indicated with an arrow at the end of the line.
12 | P a g e A consumer accesses their account using an ATM device to withdraw or deposit money: In the UML, dependencies are represented by a dashed line joining the client and provider classes. On one end, there should be an arrow pointing from the client to the provider.
13 | P a g e Aggregation Given that it incorporates ownership, aggregation is a stronger kind of association. ClassA owns or possesses ClassB. (the "part"). Similar to how associations are a component of the status of ClassA, ClassB is. The primary distinction is that aggregation is unidirectional rather than bidirectional. In other words, there is just one way that the "activity" takes. The portion class "belongs" to the contained class. This example, for example, is found in many role- playing game Aggregation is represented by a solid line with a hollow diamond at the end that connects the "whole" or "container" part of the relationship.