Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now

Recipe Management System Phase 1: Design Document

Recipe Management System Phase 1: Design Document

Version 1.0

XYZZY Software

July 2019

Revision History

VersionDateAuthorComments




If any corrections / clarifications are required to this document, please report them to Jacquie Jarvis at j.jarvis@cqu.edu.au

Table of Contents

Revision History 2

1. Introduction 4

2. Requirements 5

3. Architecture 6

4. Database / Data Access Design 7

5. GUI Design 9

6. Class Diagram 11

7. Sequence Diagrams 12

8. Test Plan 13

  1. Introduction

XYZZY Software has decided to develop a recipe management system for personal use. The system must be developed using Java Technologies (NetBeans, Swing, Java DB) and a phased implementation strategy will be adopted. This document represents the current state of the design for the Phase 1 system.

  1. Requirements

Because of the simplicity of the functional requirements, the corresponding use cases are not duplicated here, as would be the case in a normal XYZZY design document.

The purpose of the system is to assist people in recipe selection. A 3 phase development process is envisaged, with the incorporation of recipe details being deferred to a later phase. In the first two phases, the selection process will be restricted to main course recipes.

A Java desktop application is to be developed, driven by a simple Swing GUI. Interaction between the database and the application is to be via JDBC. The NetBeans IDE is to be used for development. Java DB must be used as the database.

The initial functional requirements are:

  1. Start the application and connect to the database
  2. Close the database connection and stop the application
  3. Display all recipes for a particular category (meat, fish, vegetarian)
  4. Display all recipes for a particular category with a preparation time within a specified range
  5. Display all recipes for a particular category with a combined preparation and cooking time that is within a specified range
  6. Display the number of recipes that have a specified ingredient as its key ingredient
  7. Add a new recipe to the database.
  8. Clear the display

In addition, the application must conform to the MVP architecture.

The database design and sample data are provided in Section 4. Data validation is not required at this stage. However, basic preconditions must be satisfied for each requirement and if these are not satisfied, an appropriate message is to be displayed. These preconditions are specified in Section 8.

  1. Architecture

An MVP conformant three-layered architecture is to be used for the application. Layers are to be modelled as packages – the package structure for the application is illustrated in Figure 1.

Figure 1. Package structure

  1. Database / Data Access Design

The SQL script that is to be used to create the database’s RECIPES table is given below.

DROP TABLE RECIPES;

CREATE TABLE RECIPES

(

ID INT NOT NULL GENERATED ALWAYS AS IDENTITY,

RECIPENAME VARCHAR (60) NOT NULL,

CATEGORY VARCHAR (10) NOT NULL,

MAININGREDIENT VARCHAR (10) NOT NULL,

PREPARATIONTIME INT NOT NULL,

COOKINGTIME INT NOT NULL

);

INSERT INTO RECIPES (RECIPENAME,CATEGORY,MAININGREDIENT,PREPARATIONTIME,COOKINGTIME)

VALUES

(‘steak tartare’,’meat’,’steak’,10,0),

(‘roast chicken’,’meat’,’chicken’,15,60),

(‘fish and chips’,’fish’,’fish’,5,10),

(‘grilled steak and salad’,’meat’,’steak’,15,5),

(‘baked beans on toast’,’vegetarian’,’beans’,0,5);

As there is only one table, an ERD is not provided.

Data access will be via JDBC using prepared statements. Java DB must be used as the database.

Normally, in an XYZZY design document, we would specify the queries in this section and relate them to the methods exposed by the RecipesQueries class described in Section 6. However, for this project, we have decided to leave query formulation to the implementers. Note that if you choose to use SQL’s COUNT() method for Requirement 6, the result set returned when the query is executed consists of a single row with a single column that contains an int. To retrieve this value, use code similar to the following:

// execute query here

// resultSet and n have been declared elsewhere

resultSet.next();

n = resultSet.getInt( 1 );

  1. GUI Design

Developers are free to use the NetBeans GUI Builder or alternatively, they can hand code the complete GUI. An indicative GUI is presented in Figure 2 and Table 1. Developers are free to use this design as is or to do things differently, for example using menus for data entry. Note that because of the simplicity of the GUI in Figure 2, screen shots for the realisation of each requirement are not shown as would normally occur in an XYZZY design document. Rather, the required actions are summarised in Table 2. When outputting lists of recipes, formatting the data as tables with appropriate headings is not required – you can just use Recipe.toString() to display the details of each recipe.

Figure 2. Indicative GUI

FunctionalitySwing Components
OutputJTextArea
InputJLabel, JTextField
OperationsJButton

Table 1. Mapping of GUI functionality to Swing component types.

RequirementButtonInputs Required
1n/an/a
2ExitNone
3CategoryCategory
4Category and Preparation TimeCategory and Preparation times – see below
5Category and Combined TimeCategory and Combined Times – see below
6Main IngredientMain Ingredient
7AddAll, except for right-most Preparation and Cooking times and Combined Times
8Clearn/a

Table 2. Mapping of requirements to actions

For Requirements 4 and 5, note that clicking of the corresponding button will result in the invocation of a single method.

If two numbers are specified as input, then they are to be treated as the lower bound (left) and upper bound (right) of an inclusive range. Having the upper bound less than the lower bound is to be treated as an error. Having both numbers the same is not an error – they are the endpoints of a range of length zero.

If one number is specified, then if it is the right input, then the left input is set to 0. If the left input is specified, then the right input is set to the value of the left input.

Validation of inputs is to be done in the RecipesView class.

  1. Class Diagram

The class diagram for the application is illustrated in Figure 3.

Figure 3. Class diagram

Note: Use the zoom feature in Word to view the details of the class diagram in figure 3 above. You must adhere to the detailed specifications for the classes as shown in figure 3.

The mapping to packages/layers is provided in Section 3. Note that Figure 3 represents a refactoring of the class structure favoured by the NetBeans GUI Builder. Rather than having GUI creation in the GUI class definition (through the provision of a main() method, we have chosen to place GUI creation in a separate main class. If you are using the NetBeans GUI builder, all that this means is that the main() method that the GUI builder generates is moved into the Recipes class. Also note that interaction between the RecipeQueries class and the JBC library classes is not shown. This is normal for class diagrams. Finally, formal UML syntax is not strictly followed. In particular, we feel felt that method signatures as employed in NetBeans are clearer than their UML counterparts.

  1. Sequence Diagrams

Omitted

  1. Test Plan

The following tests will be performed prior to acceptance:

RequirementTestComment
1Operation performs correctly given correct preconditions
1Handles no database/incorrect databaseApplication is to exit
2Operation performs correctly

3Operation performs correctly given correct preconditions
3Handles incomplete field entry

4Operation performs correctly given correct preconditionsNo data validation checks required.
4Handles incomplete field entry

4Input variants as specified in Section 5 are handled correctly
5Operation performs correctly given correct preconditionsNo data validation checks required.
5Handles incomplete field entry

5Input variants as specified in Section 5 are handled correctly
6Operation performs correctly given correct preconditionsNo data validation checks required.
6Handles incomplete field entry

7Operation performs correctly given correct preconditionsNo data validation checks required.
7Handles incomplete field entry

8Display is cleared

Table 3. Acceptance tests

Note:

  1. By preconditions, we mean that the required values are available.
  2. Acceptance tests coincide with class unit tests, so no separate unit testing is required.
  3. Testing will be conducted with the database specified in Section 4.

The post Recipe Management System Phase 1: Design Document appeared first on My Assignment Online.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

Native UK, USA & Australia writers Deadline from 3 hours 100% Plagiarism-Free — Turnitin included Unlimited free revisions Free to submit — compare quotes
Scroll to Top