Practical Guide to Application Development with Class Diagrams and Design Patterns, Assignments of Advanced Algorithms

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

2021/2022

Uploaded on 12/28/2022

ng-n-minh-anh
ng-n-minh-anh 🇻🇳

4.8

(26)

34 documents

1 / 47

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Higher Nationals in Computing
Unit 9: Advanced Programming
ASSIGNMENT 1
Assessor name: LE NGUYEN TRUNG NAM
Learner’s name: NGUYEN THAI THINH
ID: GCS200090
Class: GCS0903A
Subject code: 1651
Assignment due: Assignment submitted:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f

Partial preview of the text

Download Practical Guide to Application Development with Class Diagrams and Design Patterns and more Assignments Advanced Algorithms in PDF only on Docsity!

Higher Nationals in Computing

Unit 9: Advanced Programming

ASSIGNMENT 1

Assessor name: LE NGUYEN TRUNG NAM

Learner’s name: NGUYEN THAI THINH

ID: GCS

Class: GCS0903A

Subject code: 1651

Assignment due: Assignment submitted:

ASSIGNMENT 2 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 NGUYEN THAI THINH Student ID GCS Class GCH0705 Assessor name LE NGUYEN TRUNG NAM 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 P3 P4 M3 M4 D3 D

ASSIGNMENT 2 BRIEF

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 2 : Advanced Programming Assignment title Application development with class diagram and design patterns Academic Year 2018 - 2019 Unit Tutor Doan Trung Tung Issue date 30 April 2019 Submission date 11 May 2019 Submission Format: Format: The submission is in the form of an individual 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/ together with zipped project files. 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 : (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. Tasks: Your team is now separated and perform similar tasks in parallel. You will choose one of the real scenarios that your team introduced about DP in previous phase, then implement that scenario based

on the corresponding class diagram your team created. You may need to amend the diagram if it is needed for your implementation. In additional, you should discuss a range of DPs related / similar to your DP, evaluate them against your scenario and justify your choice. In the end, you need to write a report with the following content:  A final version of the class diagram based on chosen scenario which has potential of using DP.  Result of a small program implemented based on the class diagram, explain how you translate from design diagram to code.  Discussion of a range of DPs related / similar to your DP, evaluate them against your scenario and justify your choice (why your DP is the most appropriate in that case). Learning Outcomes and Assessment Criteria Pass Merit Distinction LO 3 Implement code applying design patterns P3 Build an application derived from UML class diagrams. M3 Develop code that implements a design pattern for a given purpose. D3 Evaluate the use of design patterns for the given purpose specified in M3. LO4 Investigate scenarios with respect to design patterns P4 Discuss a range of design patterns with relevant examples of creational, structural and behavioral pattern types. M4 Reconcile the most appropriate design pattern from a range with a series of given scenarios. D4 Critically evaluate a range of design patterns against the range of given scenarios with justification of your choices.

  • ASSIGNMENT 2 BRIEF
  • Table of Contents
  • Table of Figures..............................................................................................................................................
  • Assignment 1 Report
  • P3 Build an application derived from UML class diagrams.
    1. Scenario analysis
  • 1.1. Scenario
  • 1.2. Diagram
    1. Implementation
  • 2.1. Code.....................................................................................................................................................
    •  Class Movie
    •  Class Program....................................................................................................................................
    • The menu interface code for Admin.........................................................................................................
    • The menu interface code for User
  • 2.2. Program screenshots
    • Main Menu of the program
    • The menu interface for Admin
    • The menu interface for User
  • types.............................................................................................................................................................. P4 Discuss a range of design patterns with relevant examples of creational, structural and behavioral pattern
    1. Range of similar patterns
    • 1.1. Creational Design Pattern
    • 1.2. Structural Design Pattern
    • 1.3. Behavioral Design Pattern
    1. Usage of pattern....................................................................................................................................
  • References
  • Figure 1: Class Diagram Table of Figures
  • Figure 2: Class Movie use singleton with add and view function..................................................................
  • Figure 3: The delete movie function
  • Figure 4: The update movie function
  • Figure 5: The search movie function
  • Figure 6: The watch movie function
  • Figure 7: Declare variables step
  • Figure 8:Movie form to write information
  • Figure 9: Validation step
  • Figure 10: Validation information (1)
  • Figure 11: Validation information (2)
  • Figure 12: Final function will show the result on the screen
  • Figure 13: Main menu interface coding
  • Figure 14: Menu for admin
  • Figure 15: The validation system for admin (1)
  • Figure 16: The validation system for admin (2)
  • Figure 17: Menu for user
  • Figure 18: The validation system for user
  • Figure 19: Show result
  • Figure 20: Main menu of the program
  • Figure 21: Choosing option (1)
  • Figure 22: The menu of Admin
  • Figure 23: Add new movie function.............................................................................................................
  • Figure 24: Add new movie successfully
  • Figure 25: Error in add new movie function
  • Figure 26: View function
  • Figure 27: Error in view function
  • Figure 28: Delete function
  • Figure 29: Delete function testing (1)
  • Figure 30: Delete function testing (2)
  • Figure 31: Update movie function................................................................................................................
  • Figure 32: Update movie function testing (1)
  • Figure 33: Update movie function testing (2)
  • Figure 34: Update movie function testing (3)
  • Figure 35: Get back to main menu
  • Figure 36: Choosing option (2)
  • Figure 37: The menu of User
  • Figure 38: Search Movie function testing (1)
  • Figure 39: Search Movie function testing (2)
  • Figure 40: Search Movie function testing (3)
  • Figure 41: Watch Movie function testing (1)
  • Figure 42: Watch Movie function testing (2)
  • Figure 43: Watch Movie function testing (3)

2 | P a g e This class diagram is about a movie management system. The system will display all movie available for user to search and watch when they launch the app. The administrator will management all the movie in the system, he can add, view, update, and delete movies. This is a simpler way to manage movies before developing into a larger project.  Class MovieWebsite Show the list of movies  Class Admin This class will manage all movies and execute functions (Add, View, Update, Delete)  Class Movie This class is used to declare a property variable that will hold details about the movie. ID, Name, Director, and Category of the Movie. Create functions to retrieve and set values, then make them available to other classes for use.  Class User This class can check information of movie by searching and watch movie they search.

2. Implementation 2.1.Code In order to make sure the application works effectively, we must employ code to manage. To create the management menu of movie, we have to go to the first steps that we need to create the movie class.  Class Movie I shall first build the movie class. Here, I'll use the singleton pattern to make it simpler to declare variables for movie functions like add, view, update, delete, and watch movie as well as variables for id, name,

3 | P a g e director, and category. All of these characteristics have a significant role in both printing the output and afterwards influencing its functionality. Here I set the movie class as the main instance so that I may declare the variables and functions below. To optimize the selection, I'll use the "if - else" command as well as show input and authenticity to make the menu more realistic. The future management of both Admin and User will make use of each paragraph here. Figure 2 : Class Movie use singleton with add and view function In first paragraph is the add new movie function. In order for this add item to display the form that needs to be filled out, I have incorporated the code from the form in the movie class here.

5 | P a g e Here I also added a note in the menu to remind users to enter movie id to delete, and before deleting, you need to add the information of movie first. For the purpose of revalidating this delete statement for the id that was discovered or not discovered, I additionally utilized an additional if else statement. Then the next function is update movie: Figure 4 : The update movie function

6 | P a g e Here I also added a note in the menu to remind users to enter movie id to update, and before updating, you need to add the information of movie first. For the purpose of revalidating this update statement for the id that was discovered or not discovered, I additionally utilized an additional if else statement. Next is the search movie function: Figure 5 : The search movie function

8 | P a g e I have added a note to request user to enter the name to find the movie that users want to watch. Like other situations, you have to add all the information of the movie before you want to search and watch them. For the purpose of revalidating this watch statement for the name of movie that was discovered or not discovered, I additionally utilized an additional if else statement. Next we will come to the next step is setting variables as well as the calculations in the movie class. Here I will declare movie variables about id, name, director and category. All these properties are very important in printing the result. Figure 7 : Declare variables step After declaring the attributes in the movie class, next I will proceed to create forms according to each attribute. Each form will be filled with notes and we can optionally tweak any color to make this form easier to see.

9 | P a g e Figure 8 :Movie form to write information Admin will enter the information of all movie into this form such as ID, name, director, category. there are also some notes for admin like suggestion to fill in ID of movie. Below this form, we also have information verification item, it means that when admin fill in incorrectly, an error message will be displayed and the admin have to re-enter them. If admin enter correctly, the system will also notice that admin has filled in the information successfully.

11 | P a g e Figure 11 : Validation information (2) As you can see, these message line will appear when you skip the step of filling in the information. Finally, all steps of filling in the information will end up with ShowInformation function will show the result. Figure 12 : Final function will show the result on the screen

12 | P a g e Then we move to Program file where I create all interface for this program.  Class Program The menu interface code for Admin After completing the necessary function on the Class Movie, we come to code about interface. Firstly, we have the main menu when we launch the program which have three options one for admin, two for user, and three for exiting the program. Figure 13 : Main menu interface coding