











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
afffâfâfăfăfawfawfawfawfawfawfawfawfawaawfawfawfawfawwfawfawf
Typology: Assignments
1 / 19
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 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyễn Lâm Thắng Student ID GCH Class GCH0716 Assessor name Doan Trung Tung 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
Grade: Assessor Signature: Date: Lecturer Signature:
As an employee in a software development company, to help improve their documentation of their in-houses software libraries which were developed with very poor documentation, I alleviate this situation by showing the efficient of UML diagrams in OOAD and Design Patterns in usages. The detail of them will be shown in the report.
Definition : 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 approach to programming is well-suited for programs that are large, complex and actively updated or maintained. 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. Even when using microservices, developers should continue to apply the principles of OOP. Principles of OOP: Object-oriented programming is based on the following principles:
1. Scenario The Apollo english center - A center teaches Toeic, Ielts, Toefl…. for everyone. Now, the center wants to expand the system because there are more people want to register day by day. Moreover, the old system was out of date. This system makes difficult in managing everything. Therefore, to help the center manage the
information of teachers and students better. I create a system to do it. In the system, there are 3 main actors : Admin, Teacher and Student. Each actor has the corresponding functions.
2. Use case Diagram Based on the scenario, I have use case diagram for 3 main actors: Figure 1 : Use case Diagram Admin has functions :
Student. These classes are inheritance from superclass Person. This superclass has the same attributes. Relationship between Person class and Admin , Teacher , Student class is generalization In addition, Admin class also has attributes: Authorities and ID. Teacher class also has attribute: Syllabus. Student class also has attribute: Review Relationship between Admin class and Authority class is Association. Each Admin has an unique ID and functions: add more teacher, student or delete teacher, student. Relationship between Teacher class and Syllabus class is Association. Each Student has an unique ID and can review the class. Relationship between Student class and Review class is Association. Each Teacher has an unique ID and can create syllabus for the class.
Because Student , Teacher , Admin classes are inheritance from Person superclass , these classes can see information of NewsBoard through class NewsBoard. So relationship between Person class and Newsboard class is Association. This class is created for showing all information of class. Relationship between Newsboard class and Information class is Aggregation. In that, information is taken from class Information and class Address. Relationship between Information class and Address class is Aggregation, too. From 2 classes above, I can get ID to see information. Each class has attributes and methods as above. Relationship between Person class and Course class is Association through attribute SS1. As the same, relationship between Course class and Level class is Association. Moreover, Relationship between Level class and Bill class is Aggregation. At the Course class, there is a function for student test to get mark. This mark is used for studying suitable and student can pay fee.
Figure 3 : Class diagram for DP ( Singleton ) There will be 3 main classes: ComputerSystem, Computer and Table. Class ComputerSystem (Singleton) : In the class ComputerSystem , the private will create a " cs " pointer that will be the only object of both a system and must be static. Besides creating a " Table " vector to store besides, we also have the Constructor ComputerSystem () function. Coming to the public function, there will be ComputerSystem * get_computer_system () in the static form to transfer data and will call vector get_tables () along with functions such as adding tables ( add_table ) or adding rations ( add_ration ) Class Table: Coming to the class Table. To facilitate the calculation with name calling. Here private will pass Name as string and vector rations as string, to public will have functions with properties similar to ComputerSystem class but will have an invoice () function to be able to print invoices when you need to create a menu.
Class Computer: Finally, the class Computer will be connected to the class ComputerSystem through the Association relationship, so that we can use and name the other functions like creating a new invoice create_invoice () or print the invoice with the invoice () function. Relationship:
- ComputerSystem: Because this is a Singleton pattern, there will be relationships with an Association with the ComputerSystem function itself to represent Singleton.
Figure 5 :Class diagram for DP ( Composite ) Explanation: The diagram consists of 3 classes equivalent to the components of the composite structure: Person (Component): has the common properties of Manage and Employee: Name, ID, Positon. Being a representative class, it is possible to represent (abstractly) the other 2 classes Contains general information of the other 2 opponents (manager and staff). Contains common manipulation methods of object components. Employee (leaf): has an additional attribute: private: Salary. Is the smallest unit, representing its employees Employees cannot manage employees. Operations in the Class Person can be used. Manage (Composite): Has more attributes: Department. Represents an aggregate class because it can contain many (stores) Employee (leaf) It is possible to create itself through the use of person (Component) class to create. Operations in the Class Person can be used.
The relationship between Employee and Person is an inheritance relationship.
+Update(Id : string, name : string, Position : string, Salary : int) : Update information of employee +Showall() : void : Show information of all managers by rank +is_equal(f : company) : bool : Check employee or manager to delete person easier. +add_personnel(c : Person) : Add more people ( manager or employee ) +delete_personnel(c : Person) : Delete people ( manager or employee )
3. Behavioral pattern In software engineering, behavioral design patterns are design patterns that identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.
English test: (has second change)
Sourcemaking. (n.d.). Retrieved from https://sourcemaking.com/design_patterns/behavioral_patterns