1651 assignment 1 (pass)

32 14 0
1651 assignment 1 (pass)

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) 1651 assignment 1 (pass) fpt greenwich

Higher Nationals in Computing Unit 19: ASSIGNMENT Advanced Programming (1651) Assessor name: LE NGOC THANH Learner’s name: Đào Vĩnh Khang ID: GCS200222 Class: GCS0905B Subject code: 1651 Assignment due: Assignment submitted: ASSIGNMENT FRONT SHEET Qualification BTEC Level HND Diploma in Computing Unit number and title Unit 20: Advanced Programming Submission date 14-02-2022 Date Received 1st submission Re-submission Date 14-02-2022 Date Received 2nd submission Student Name DAO VINH KHANG Student ID GCS200222 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 Grading grid P1 P2 M1 M2 D1 D2 KHANG ❒ Summative Feedback: Grade: Signature & Date: ❒ Resubmission Feedback: Assessor Signature: Date: ASSIGNMENT BRIEF Qualification BTEC Level 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 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 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 FRONT SHEET ASSIGNMENT BRIEF P1 Examine the characteristics of the object-orientated paradigm as well as the various class relationships Object-oriented programming 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 18 Information Gathering: 18 Scenario 18 Use-case Diagrams: 19 Class Diagrams: 21 MusicDisc Class 23 EdmMusicDisc Class 24 PopMusicDisc Class 24 MusicDiscShop Class 25 Sequence Diagram: 28 REFERENCES 30 P1 Examine the characteristics of the object-orientated paradigm as well as the various class relationships Object-oriented programming Object-oriented programming (OOP) is one of the very important programming techniques nowadays It is applicable in most practical construction applications at businesses Most popular programming languages and programming frameworks such as Java, C# and NET support object-oriented programming Most programmers have learned about objectoriented programming in universities, but the basic principles of object-oriented programming sometimes not know how to misuse the wrong philosophy of programming object-oriented In this article, I will summarize the basic principles of object-oriented programming to help you get an overview of OOP and how convenient it is What is object-oriented programming? Object-oriented programming is a programming technique that allows programmers to create objects in code that abstract actual objects in life This approach is currently very successful and has become one of the software development templates, especially for software using on business 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 P2 Design and build class diagrams using a UML tool Information Gathering: Scenario My brother recently asked me to help them build a record management platform for their business I plan to develop an application that will keep a list of music discs available in the store This software allows users to add new discs by entering disc information such as ID, name, artist, description, year and price In addition, the system contains tasks requested by customers such as adding, deleting, updating and searching disc information Use-case Diagrams: Use case diagram: Here the actors are the user and the admin Each use case comes with the description, actors, pre/post conditions and the flow of control Here the admin is the one that maintains the application Coming to the conditions on the use cases, the implicit one is that the user must be logged into the system to access recommendations Flow of control would be the inherent activies of each use case like the processing of the request as soon as the user enters a query for searching the music, the compiling of the list generated from the scores and showing those with high values etc Class Diagrams: Figure 3: MusicDisc Class Diagram ❖ Class EdmMusicDisc is the class which is inherits from MusicDisc class, this class contains Price which is overrides the property Price from class MusicDisc and it also contains three methods GetTitle(), GetType() and DisplayMusicInfo() which is overrides the abstract method abstract from class MusicDisc Figure 4: EdmMusicDisc Class Diagram ❖ Class PopMusicDisc is the same as class EdmMusicDisc because it also inherits from class MusicDisc Figure 5: PopMusicDisc Class Diagram MusicDisc Class ❖ Class Diagram: As previously stated, the MusicDisc class has the fundamental fields that other classes can inherit, such as: ➢ Field includes id, name, artist, description, year and price ➢ Properties include Id, Name, Artist, Description, Year, and Price (this property with the keyword virtual appears to mean that it can be overridden by children class) to encapsulate the field and change the way other classes access this class, for example, other classes will access the id field via its property Id In addition, this MusicDisc Class is also an abstract class and it have three methods for inherited classes to define themselves which is GetTitle() to get the title of the disc, GetType() to get the type of the disc and DisplayMusicInfo() to display the info of the disc EdmMusicDisc Class ❖ Class Diagram As previously stated, this class is the child class of the MusicDisc class, or we can say it employs inheritance, that is one of the characteristics of OOP; it inherits everything contained in the parent class (MusicDisc class), and I also highlighted that the MusicDisc class contains the property 'Price' with the 'virtual' key word for child class having the capability to modify the logic within it (this is a polymorphism characteristic of OOP) Last but not least, it also contains three methods GetTitle(), GetType() and DisplayMusicInfo() which is overrides the abstract method abstract from class MusicDisc PopMusicDisc Class ❖ Class Diagram As previously stated, this is also the child class of MusicDisc and this class is the same as EdmMusicClass because it also inherits everything in parent class (MusicDisc Class) MusicDiscShop Class ❖ Class Diagram As previously stated, because it has a list of books and a CRUD function, the MusicDiscShop class is critical to the overall software Here is the explanatory specification: ➢ MusicDiscs: this is the list of items that have a music disc within ➢ CheckID(): Because each music disc's id is unique, I wrote this method to check if the id is duplicated or not; if duplicated, the user will be prompted to provide the other id to prevent having two duplicated ids in the 'musicDiscs' list ➢ AddMusicDisc(): this is the method to add more disc into the list ➢ PrintAllDisc(): this is the method to display all of the disc that exist in the list ➢ PrintAllEdm(): this is the method to display all of the EDM music disc that exist in the list ➢ PrintAllPop(): this is the method to display all of the POP music disc that exist in the list ➢ UpdateById(): It is difficult to update music discs by name or artist since they can be duplicated, but each disc's id is unique, thus I created this method to update music discs by id ➢ DeleteById(): This method is the same as Update because it is also difficult to remove disc by name or artist since they can be duplicated It would be rather amusing if I opted to remove the disc by name because I may delete the wrong disc because there are many songs with the same name in the world nowadays, but each disc's id is unique, thus I created this method to delete music discs by id ➢ GetMusicDiscById(): As I mentioned from update and delete method that each disc's id is unique, so I designed this method to help users discover the music disc in the most convenient way possible ➢ GetMusicDiscByName(): Each music disc has its own name, but their names can be the same, so I created this method to find discs by their names in order to keep track of how many discs with the same name are entered ➢ GetMusicDiscByArtist(): Each disc has its own artist name, and they can write many songs on each disc, so I devised this system for finding discs by their creator's name in order to keep track of how many discs that artist has composed And last but not least, the relationship between MusicDiscShop and MusicDisc is composition because the MusicDiscShop can not be a music disc shop if there are not any music discs in the shop as well as the disc will be just a regular music disc if they are not in the store to be purchased Activity Diagram: Main activities for each of the service provided are described by an activity diagram This activity diagrams deal with the workflows of the recommender system The work flows are depicted in sequence and often have conditions specified on the control-flow lines The diagram is accompanied by the description, the intiator of the activity and the workflow The initiator is generally a function module that gets called when an activity starts Some of the functions in this music recommender system implementation are: - initMusicRecSys(…) – create new instance of the system - loadUserProfile(…) – authenticates and loads a user profile - processRequest(…) – analyses the query entered by the user - dispResults() – get the results and display them - logUserActivity(…) – playcount, timestamp etc are all logged for further calculation - getRecommendation(…) – show the recommendations after calculating similarity and prediction scores - logExplicitRating(…) – user rating to specific song is noted for further calculations Note that these are all parameterized methods and will be known during the implementation stage and are being omitted here Sequence Diagram: The sequence diagrams are one of the interaction diagrams that depict the communication between the objects The collaboration of objects is modelled based on a time sequence The objects involved in the scenario pass messages between themselves Here the return messages are not shown but are to be understood as implicit The diagram below is basically asynchronous way of communication as in the recommender system the similarity scores are to be computed asynchronously without the user having to wait for Khang REFERENCES Advanced programming with C# Available at: https://www.codeproject.com/Articles/1094625/Advanced-programming-with-CsharpLecture-Notes-Par [Accessed November 26, 2022] What is Object Oriented Programming? OOP Explained in Depth Available at: https://www.educative.io/blog/object-oriented-programming [Accessed November 26, 2022] Design a Library Management System Available at: https://www.educative.io/courses/grokking-the-objectorienteddesigninterview/RMlM3NgjAyR [Accessed November 26, 2022] Object Oriented Programming Using C# NET Available at: https://www.c-sharpcorner.com/UploadFile/84c85b/object-oriented-programmingusingC-Sharp-net/ [Accessed November 26, 2022] Lập trình hướng đối tượng (OOP) C# Available at: https://comdy.vn/c-sharp/lap-trinh-huong-doi-tuong-oop-trong-c-sharp/ [Accessed June 12, 2021] OOP Concepts in C#: Code Examples and How to Create a Class Available at: https://stackify.com/oop-concepts-c-sharp/ [Accessed November 26, 2022] C# OOP Available at: https://www.w3schools.com/cs/cs_oop.php [Accessed November 26, 2022] C# Inheritance with Examples Available at: https://www.tutlane.com/tutorial/csharp/csharp-inheritance [Accessed November 26, 2022] C# Inheritance with Examples Available at: https://www.tutlane.com/tutorial/csharp/csharp-encapsulation [Accessed November 26, 2022] C# Polymorphism with Examples Available at: https://www.tutlane.com/tutorial/csharp/csharp-polymorphism [Accessed November 26, 2022] C# Abstraction with Examples Available at: https://www.tutlane.com/tutorial/csharp/csharp-abstraction [Accessed November 26, 2022] Types Of Relationships In Object Oriented Programming (OOPS) Available at: https://www.c-sharpcorner.com/article/types-of-relationships-inobjectorientedprogramming-oops/ [Accessed November 26, 2022] Dependency, Generalization, Association, Aggregation, Composition in Object Oriented Programming Available at: https://www.csharpcorner.com/UploadFile/b1df45/dependencygeneralizationassociation-aggregation-compos/ [Accessed November 27, 2022] Class Diagram for Library Management System Available at: https://www.geeksforgeeks.org/class-diagram-for-library-management-system/ [Accessed November 26, 2022]

Ngày đăng: 18/07/2023, 23:51

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan