cp31010: fundamentals of software engineering bgazm team: adrian zatta angela mccarthy anthony bath...

30
Townsville Tavern and Brewery CP31010: Fundamentals of Software Engineering BGAZM Team: Adrian Zatta Angela McCarthy Anthony Bath Matthew Grasso

Upload: lawrence-floyd

Post on 03-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Townsville Tavern and Brewery

CP31010: Fundamentals of Software Engineering

BGAZM Team:Adrian Zatta

Angela McCarthyAnthony Bath

Matthew Grasso

Presentation OverviewIntroduction

Software Development Team

BackgroundProblem Definition

IssuesSolutionsThreat Model

Prototyping EnvironmentsJavaC#

Use Case AnalysisBusiness Rule

IntegrationUse Case Design

High Level DesignUse Case

ImplementationLow Level

ImplementationCode Review

Peer Review Closing

BackgroundTownsville Tavern

and BreweryTavern hours

Sun-Thurs 10AM – Late

Fri-Sat (*and special

events) 10AM – 3PM

Brewery hoursMon-Sun

9AM – 7PM

Townsville Tavern and Brewery stocks and sells various alcoholic beverages

Brewery also supplies local pubs in the region and exports Australia-wide

Problem DefinitionIssues

Stock and Inventory handled manuallyCounted at the end of each night, inventory

adjusted accordinglyOrders: Importing and exporting done

manuallyTakes up timeLarge cost on business due to excess

manual labour and large hours

Problem DefinitionSolutions

Supply Chain Management SystemKeeps accurate count of stockInventory adjusted when stock scanned

out/inAutomated/scheduled ordering of stockReduces cost – procedures automatedReduces time – removes the need for

manual counts

Problem DefinitionThreat Model

ThreatRisk Value

Counter Measures

Unauthorised Users

4 System kept behind counter, away from public access. System stored on private machine

Data Corruption 5 System keeps backups to revert to in the event of data corruption.

User Errors 3

Staff to be trained to ensure errors do not occur. Risk high when system first introduced, but risk will be reduced with time and training.

Data Connectivity 6

If system cannot connect to database, will instead update a database on local system. Local system will then update main database once connection re-established. 

Loss of Data/Resources

4

To minimize the risk of loss of data/resources (such as natural disasters, eg. cyclone, fire), all data records are backed up externally from the site. These then can be easily accessed to replace lost data.

Architectural Representation

Client ServerClient PC(Windows)

Client Software

(Software requirement

s)

Data Storage Unit

Software Requirements• Create inventory items• Edit inventory items• Delete inventory items• Display inventory

amounts• Edit inventory amounts• Automatic inventory

update• Automatic stock

ordering • .....

Use Case - Create Inventory Item – Goals and ConstraintsConstraints:

The User is at the “Create Inventory Item” UI and has entered details of new item.

Goal:The inventory item has been added to the data

storage unit.

Use Case View – Create Inventory Item

Item

details

Confirms details

Data

Access Object

Persistent Storage

Create Inventory Item

Delete Inventory Item

Item

details

Use Case – Create Inventory Item Primary Actor: User Secondary Actors: N/A Pre-Condition: The User is at the “Create Inventory Item” UI and has entered details of new item. Goal: The inventory item has been added to the data storage unit.   Main Path

1. The User clicks the “Create” button.2. The system validates the details that were entered.3. The system confirms the new inventory item does not exist on the data storage unit.4. The system adds the new inventory item to the data storage unit.5. System returns to Manage Inventory Display.

Extensions

1.1 User clicks “Cancel” and returns to Manage Inventory Display.2.1 If inventory item details are incorrectly filled in, a message is displayed.2.2 Return to step 2 of the Main Path.3.1 If the inventory item already exists, a message is displayed3.2 Return to step 2 of the Main Path.

Use Case – Create Inventory ItemSupporting User Interface

Use Case Analysis, Design and ImplementationUIManageInventory

Main menu UI for the management of inventory includingCreationEditingDeletion

Simply extends JFrame and contains 4 Jbuttons and a JLabel (heading, purely aesthetics)

Due to the custom nature of the design, layout managers were not utilized instead absolute positioning was implemented

JButton

JLabel

JFrame

Use Case Analysis, Design and ImplementationUICreateInventoryItemThis is the UI that was seen two slides agoAgain extends JFrame and contains

JButton, JTextField and JLabel componentsText fields accept user input in the form of a

String data typeButtons used for progression (Create) and

regression (Back)Singleton pattern used for all UI’s to

prevent multiple instances

JButton

JTextFieldJLabel

JFrame

Use Case Analysis, Design and ImplementationUCCreateInventoryItemContains the code to implement the Create

Inventory Item Use Case that Matthew discussedImplements a Use Case Controller which has a

single abstract function run()Adapter pattern utilized for “attaching” use cases

to buttons ie UCC-> ActionListener AdapterThis allows use cases to be ran when user clicks a

buttonIn the case of this use case, it is run when the user

clicks “Create” from the Create Inventory Item UI

Use Case Analysis, Design and ImplementationInventoryDAO

Data Access Object to read and write to data storage unit (DAO Pattern)

Contains all the SQL queries in functionscreateInventoryItem(InventoryItem

newItem)Etc (unrelated to this UC)

Contains validation rules for length of fields, exists or not, etc

Use Case Analysis, Design and ImplementationDatafiles Overview

For this use case, there is a single data sourceUser input via keyboard/mouse

Validation is used to ensure all fields are filled in and new item doesn’t already exist in DB

No output files are generatedNo initialization files are required

Use Case Analysis, Design and ImplementationDataflowFor this use case, there is only one simple direction of

data flow:User enters the data via the keyboard into the UI, then

clicks the button to allow the item to be created on the data storage unit

UIUser Data Storage Unit

Use Case Analysis, Design and ImplementationData Storage

A MySQL database running on a local server at the client’s business

This is to allow for efficient data transfer over a Local Area Network

Off-site back-up exists for record-keeping in the case of corruption or loss of data due to disasters

Prototyping EnvironmentsJava C#Portability

Used across multiple platforms

Portability.NET

Software Demonstration

Code Review Class Problem private void makePanel() {

        tabbedPane = new JTabbedPane();        itemTabbedPane = new JTabbedPane();        createItemTextField = new JTextField(20);        deleteItemTextField = new JTextField(20);

        JPanel createItemPane = new JPanel();        GridLayout experimentLayout = new GridLayout(0,2);        createItemPane.setLayout(experimentLayout);

        JLabel createItemHeader = new JLabel("Create New Item");        JLabel blank = new JLabel("");

        createItemButton = new JButton("Create Item");        UCCreateItem ucCreateItem = new UCCreateItem(this);        createItemButton.addActionListener(new UCCToALAdapter(ucCreateItem));

        createItemPane.add(createItemHeader);        createItemPane.add(blank);        createItemPane.add(createItemTextField);        createItemPane.add(createItemButton);...

Code Review Function Problem

public function addInventoryItem() {        $theDisplay = new DisplayUI();        $theDisplay->displayAddItemForm();        $this->viewInventory();    }

    public function submitInventoryItem($iname,$iqty) {        $theDisplay = new DisplayUI();        $this->pharseQ( "INSERT INTO inventory (`item_id`, `item_name`, `item_qty`) VALUES (NULL, '" . $iname . "', '" . $iqty . "')");        echo "<h3>Item Submitted</h3>\n";            }

Code Review Error Handling

$sql="INSERT INTO Customer (Customer_Name, Customer_Password, Customer_Email)VALUES

('$_POST[formusername]','$_POST[formpassword]','$_POST[formemail]')";    if (!mysql_query(($sql,$con))    {        die('Error: ' . mysql_error());    }

Code Review Variable Problem

private static Container frame1;frame1 = getContentPane();frame1.add(BorderLayout.NORTH, new HeaderField());frame1.add(BorderLayout.WEST, new SideAdd());frame1.add(BorderLayout.CENTER, new TabField());

jLabel1 = new javax.swing.JLabel();(unused)

Questions?

Thank you