1 CSE3OAD/CSE4OAD - Assignment 2 Due Date: 10 am Friday 21 May 2021 Assessment: This assignment 2 is worth 25% of the final mark for CSE3OAD/CSE4OAD. This is an individual assignment. Copying, Plagiarism: Plagiarism is the submission of somebody else’s work in a manner that gives the impression that the work is your own. The Department of Computer Science and Computer Engineering treats plagiarism very seriously. When it is detected, penalties are strictly imposed. Students are referred to the Department of Computer Science and Computer Engineering's Handbook and policy documents with regard to plagiarism. No extensions will be given: Penalties are applied to late assignments (5% of total assignment mark given is deducted per day, accepted up to 5 days after the due date only). If there are circumstances that prevent the assignment being submitted on time, an application for special consideration may be made. See the departmental Student Handbook for details. Note that delays caused by computer downtime cannot be accepted as a valid reason for a late submission without penalty. Students must plan their work to allow for both scheduled and unscheduled downtime. Assignments submitted more than 5 days late will receive the mark of 0. Return of Assignments: Students are referred to the departmental Student Handbook for details. Objectives: To implement web services. Introduction The aims of the assignment are: • To implement web services for making available resources regarding a collection of recipes. The recipes are those that you have worked with in assignment 1. Using Java Reflection and Servlet API • To apply the relevant validation strategies to the grocery, using the Validation Framework we built in Lab 07. 2 Files Provided The following are provided in the recipeWS directory (of the zip file) • The jar files for JSON conversion and MySQL driver (in directory lib) • The Java files for validation (in directory validate) some of them need to be completed. • CreateRecipeDatabase.sql You can adapt this file to your own need. However, the table name must be recipe, and the structure of this table must be exactly the same as that shown in the SQL script. • The class Recipe.java • The class RecipeDSC.java • The class Helper with methods for JSON conversions • The class RecipeWS (To be COMPLETED) Building Web Services You are required to build the web services to • Get all the recipes o Parameter: None o Data Sent (to server): None o Data Received (from server): JSON array representing all the recipes • Get the recipe of a given id o Parameter: an id (to be attached to the URL) o Data Sent: None o Data Received: JSON object representing the recipe • Add a recipe o Parameter: None o Data Sent: JSON object representing the recipe o Data Received: JSON object representing the recipe • Edit (update) a recipe o Parameter: an id (to be attached to the URL) o Data Sent: JSON object representing the edited recipe o Data Received: JSON object representing the newly updated recipe • Delete the recipe of a given id o Parameter: an id (to be attached to the URL) o Data Sent: None o Data Received: None The URL for all requests should be: http://localhost:8080/recipeWS/recipes Your program must be tested by Postman. 3 What to submit • Electronic copy of all of the classes required to run the application, including those that are provided, are to be submitted to LMS. • All of the classes that you created or completed must be able to be compiled from their current directory. This means, they must not be contained in any package. • As for the database, The only requirement is that your program should work on the table recipe which must have the same structure as the one in the provided MySQL script. • For classes that you create, you must include, as part of the comments, your name (with surname in capital), student ID, your user name and the subject code. Assignments without any of surname, given names, student ID, username, or subject code will have 5% of the mark deducted .
欢迎咨询51作业君