


















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 / 26
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^06 Dec^2022 Date Received 1st submission Re-submission Date 13 Dec 2022 0 Student Name NGUYEN GIA 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 HUY Grading grid P1 P2 M1 M2 D1 D
Grade: Assessor Signature: Date: Lecturer Signature:
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 2021 - 2022 Unit Tutor LE NGOC THANH Issue date 06 Dec 2022 Submission date 06 Dec 2022 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
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.
To make it easier to imagine, we have a real-life example of an object that is a smartphone. This object will have:
In OOP, Abstraction can be divided into 2 levels (2 realms)
The image above shows that when applying inheritance, we only need to write the other methods in the parent class once and let the subclasses inherit again. This will avoid errors when editing and increase reusability. For example, if you want to add a class MayMac , you just need to declare it to inherit from Class Mayvitin to be able to use the above properties and methods already. 2.5. Polymorphism (Overloading and Overriding) Polymorphism (polymorphism) is a word of Greek origin, translated into Vietnamese meaning "a name with many different forms and shapes". In other words, an object has many forms or a name with many different functions. "Poly" means many and "morph" means forms. Polymorphism provides the ability to execute multiple classes with the same name. As mentioned above, polymorphism in C# deals with multiple classes with the same name, which are related to each other. This is an important concept in object-oriented programming after encapsulation and inheritance. Polymorphic Types in C# There are basically 2 types of polymorphism in C#, including:
Static polymorphism (or Compile Time) in C# is also known as Early Binding. Method overloading is a good example of static polymorphism. In overloading, the method/function has the same name but different signature. It is also known as compile time polymorphism because the decision on which method is called is done at compile time. Overloading is a concept where methods have the same name as different sets of parameters. Here the compiler checks the number of parameters passed and the type of the parameters, and then makes a decision on which method to call. In case if no method is found, it will throw an error. Dynamic Polymorphism in C# (Or Runtime Polymorphism) Dynamic Polymorphism or Runtime Polymorphism is also known as Late Binding. Where method name and method signature (number of parameters and parameter type should be same, but may have different implementation). Overriding is a good example of dynamic polymorphism. Overriding can be done using inheritance. With overriding method, base class and derived class can have same method name and some other things. The compiler is not aware of the method available to override the function, so it will not return an error when compiling. The compiler will decide which method to call at runtime and if no method is found it will throw an error. 2.6. Abstract classes
1. Scenario The library of the University of Greenwich Vietnam has imported a large number of books of all genres. The school's library has always controlled and managed books by manual human resources, now they decided to build an effective book management software and I am the programmer assigned to do this task. For this project of the library, I decided to choose an object-oriented programming solution combined with the C# programming language to support software implementation. The reason for this choice of mine is because: Object-oriented programming has outstanding advantages in the software development process such as security, ease of management and development, and optimization in many situations. The C# programming language is one of the most popular object-oriented programming languages in the world. With the backing from Microsoft, C# will be the trusted language in software development that I choose. The software will include the following main functions: - Add, delete, edit books. - Print the entire book to the screen. - Search for books. - Borrow books and return books. Software requirements include:
Target specification: Librarians can search books by name or Id. Description: The librarian selects the book search item; the search message panel appears asking to enter the name or book ID. After entering, the system does the task of searching and outputting book information according to the id (name) entered.