Download 1651 Advanced Programming ASM1 and more Assignments Information Technology in PDF only on Docsity!
Higher Nationals in Computing
Advanced Programming
ASSIGNMENT 1
Learner’s name: Dương Trọng Quí
ID: GBS
Class: GCS1005A
Subject code: 1651
Assessor name: NGUYEN VAN SON
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 Dương Trọng Quí Student ID GBS Class GCS1005A Assessor name Nguyen Van Son 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 Quí 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 - 2023 Unit Tutor Nguyen Van Son 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 1 ANSWERS
Introduction:
In this assignment, I will be applying object-oriented research and design to a specific situation will allow me to define the characteristics of the object-oriented programming paradigm. Even though the problem is not urgent, some OOP qualities need to be addressed. The second objective is to enlighten the audience about some design trends through the use of real-world case studies and pertinent trends that are depicted with UML class diagrams. Finally, I'll demonstrate how design patterns and OOP are related to one another.
P1 Examine the characteristics of the object-orientated paradigm as well as the various
class relationships.
1. Object – Oriented Programming (OOP):
1.1. Definition: Object-Oriented Programming, or OOPs, is the term used to describe programming languages that employ objects. Implementing real-world concepts like inheritance, hiding, polymorphism, etc. in programming is the goal of object-oriented programming. The primary goal of OOP is to bind together the data and the functions that use them such that only that function and no other section of the code may access the data. Figure 1 : Object – Oriented Programming(OOP) (Source: bumbii, 2023) 1.2. The benefits of OOP: Object-Oriented Programming (OOP) has several benefits, including:
- Modularity: OOP enables you to break your code down into smaller, more logical sections known as objects. This makes reading, understanding, and maintaining your code simpler.
- Reusability: OOP enables you to reuse code by creating objects that may be used in various software components or even in different projects straight out of the gate.
- Encapsulation: Because OOP enables you to illustrate data and procedures inside of articles, the inner workings of the item can be kept separate from the rest of the program. This ensures that the data is only accessed and altered in a regulated manner, helping to protect its integrity.
- Inheritance: OOP enables the creation of new classes based on pre-existing classes. This process, known as inheritance, enables code reuse and the creation of more specialized classes without the need for extensive planning.
- Polymorphism: Depending on the context in which it is used, OOP enables you to incorporate a comparable strategy or property in different ways. This is known as polymorphism, and it makes writing flexible, reusable code easier. 1.3. The drawbacks of OOP: Object-oriented programming (OOP) has several drawbacks, including:
- Complexity: OOP can be more challenging for novice programmers than other paradigms. It introduces novel concepts like inheritance, polymorphism, and epitome, which can be difficult to understand and correctly apply.
- Overuse of inheritance: While inheritance is a key component of OOP, it may also result in complicated and difficult-to-understand code. Engineers occasionally abuse inheritance, resulting in difficult-to-explore class hierarchies.
- Tight coupling: OOP may result in objects being tightly coupled to one another, which can make it challenging to change or grow code. A change to one part of the code may have unintended consequences on other parts of the code.
- Performance: Because of the aforementioned dynamic dispatch and virtual capability calls, OOP can be slower than other programming paradigms.
- Not appropriate for all issues: OOP isn't always the optimal approach for solving certain kinds of issues, such as those that don't require information control or higher performance.
- Credits: operating system, memory, and variety...
- Techniques include chatting, phoning, taking pictures, and recording.
- This class includes objects that include the iPhone, Samsung, Oppo, Huawei, and more. 2.3. Abstraction: Abstraction refers to using simplified classes, rather than complex implementation code, to access objects. It's frequently simpler to create software when you can keep a class's implementation and interface distinct. With OOP, you may leverage the class member functions to display a clear, user-friendly interface while abstracting the implementation specifics of a class. As a result, if an error occurs, the modification only impacts the implementation details of a class and not the outside code. Abstraction helps isolate the impact of changes made to the code. Figure 3 : Example of Abstraction (Source: logicmojo.com) 2.4. Encapsulation: The process of encapsulation involves keeping an object's finer points of execution hidden from the outside world. This suggests that an obvious connection point must be used to access the object's interior state, adding an element of abstraction.
Figure 4 : Example of Encapsulation (Source: algodaily.com) 2.5. Inheritance: Inheritance is the process of creating new classes from existing ones. When using subclasses and relationships, developers can reuse functionality that is comparable while yet maintaining a clear hierarchy. This characteristic of OOP expedites development and boosts accuracy by necessitating a more thorough analysis of the data. Figure 5 : Example of Inheritance (Source: geeksforgeeks, 2023)
- Search Student by Name.
- Sort the Student List by Name.
- Sort the Student List by Age.
- Edit Student Information.
- Let Student Study Status.
- Delete Student by ID.
- Exit.
2. Use case Diagram:
Figure 7 : Use case Diagram
Explanation: Manager capabilities:
- The manager can add students.
- The manager can delete students.
- The manager can edit students' information.
- The manager can search for students' information.
- The manager can display all information on accessible students.
- The manager can sort for students' information.
- The manager can let students' status. Specification name: Add Student. Specification target: Permit manager to add a new student. Description: The manager decides to add another student to the program, then adds the fundamental information to the student and snaps save. When saved, the student will be added and will be shown if necessary. Specification name: Display (All students). Specification target: Permit manager to view all current students. Description: The manager selects the item to see all students in the program, and all the information of the student will be displayed on the screen for the manager. Specification name: Search Student. Specification target: The manager can search students by name or Id. Description: The manager selects the search; then the search message panel appears requesting to enter the name or student ID. In the wake of entering, the system does the undertaking of looking and yielding student information according to the id (name) entered. Specification name: Edit student information. Specification target: Permit manager to edit information about student currently.
3. Class Diagram:
Figure 8 : Class Diagram Explanation: This student management program includes 4 main classes: Person, Student, Menu, and Program.
- Class Person: is the fundamental class that symbolizes a person. The Student class has an inherited link with it, making them a unique class of people. In order to express polymorphism, the Person class additionally has a virtual method called Study(), which the Student class overrides in order to supply the student's current learning state.
- Class Student: a class that extends the characteristics of a Person, such as Grade, phone number, Age, etc. To provide information about the student's academic progress, this class also replaces the Study() method. The other classes on the chart have no connection to the Student class.
- Class Menu: A straightforward class that has the ShowMenu() method for showing the user's menu interface. The other levels in the chart have no connection to this class.
- Class Program: The primary class that houses the Main() method, which manages program execution. The menu is displayed by the Program class, which also handles the user's selection. Additionally, it organizes lists of students and carries out operations including adding, showing, searching, sorting,
and changing student data. The remaining classes on the chart have no connection to the Program class.
Conclusion:
Applying both the object-oriented programming philosophy and the UML design of the aforementioned utilize Case Diagram and Class Diagram to the Greenwich Student Management project is a logical and appropriate method to utilize. I was able to improve the usefulness of object-oriented programming for any project thanks to that. According to my evaluation, the project's needs are completely compatible with the organizational strategy, system design, and characteristics of object-oriented programming.
REFERENCES
- Wikipedia contributors (2023) “Object-oriented programming,” Wikipedia [Online]. Available at: https://en.wikipedia.org/wiki/Object-oriented_programming. [Accessed 16 August 2023].
- Doherty, E. (2023) “What is object-oriented programming? OOP explained in depth,” Educative: Interactive Courses for Software Developers [Online]. Available at: https://www.educative.io/blog/object-oriented-programming. [Accessed 16 August 2023].
- GeeksforGeeks (2023) “Introduction of Object Oriented Programming,” GeeksforGeeks [Online]. Available at: https://www.geeksforgeeks.org/introduction-of-object-oriented-programming/. [Accessed 16 August 2023].
- Gillis, A.S. and Lewis, S. (2021) “object-oriented programming (OOP),” App Architecture [Online]. Available at: https://www.techtarget.com/searchapparchitecture/definition/object-oriented- programming-OOP. [Accessed 16 August 2023].
- Abstraction in OOPs - Logicmojo (2023) [Online]. Available at: https://logicmojo.com/abstraction-in-oops. [Accessed 16 August 2023].
- Encapsulation in OOPs- Logicmojo (2022) [Online].