Jim Lynch

Software Engineering CSC 481

Individual Semester Project



Corner Video Store



1. OUTLINE DESCRIPTION.. 7

1.1. Overview.. 7

1.2. Customer 7

1.3. Goals. 7

1.4. Constraints. 7

1.5. Functions. 7

1.6. Attributes. 8

1.7. Feasibility. 8

1.8. Environmental Diagram.. 9

2. USE CASES. 9

2.1. Typical Course Of Events. 9

2.2. Use Cases Diagram.. 10

2.3. Rent Video. 10

2.4. Return Video. 10

3. CONCEPTUAL MODEL. 12

4. SEQUENCE DIAGRAMS. 12

4.1. Rent Video. 13

4.2. Return Video. 14

5. COLLABORATION DIAGRAMS. 15

5.1. Rent Video. 15

5.2. Return Video. 15

6. CLASS DIAGRAM... 16

7. JAVA CODE. 16

7.1. // Source file: scanners.java. 16

7.1. // Source file: keyboard.java. 17

7.2. // Source file: system.java. 17

 

1.   OUTLINE DESCRIPTION

1.1.        Overview

             The purpose of the project is to design a video store terminal with scanners. It must be simple to use, minimizes errors, fast, and efficient.

1.2.        Customer

             Corner Video Store is my customer. It caters to local residents within walking distance of the store.

1.3.        Goals

             It will provide two activities, renting and returning videos.

             The system will use scanners for videos and customer ID cards, and a keyboard for other clerk input.

             It will update and display customer account information.

             It will update video usage.

             The terminal shall be efficient and easy to use.

1.4.        Constraints

             The system must track late fees and update the customer s account.

             A customer may only rent two videos at a time.

             The system must conform to all applicable Federal, State and local regulations.

1.5.        Functions

             scanners catch_c_id() catch_v_id()

             keyboard rent_kbrd() payment()

return_kbrd()

             system get_c_id() get_v_id()

rent_sys() displayAccount() commit()

return_sys() printReceipt() displayReadyState()

             database RENT_DB() RETURN_DB()

UPDATE()

1.6.        Attributes

             customer c_id name

creditCard cardExpDate charges

rental1 rental1ReturnDate rental2

rental2ReturnDate

             video v_id title

stars releaseDate cost

renter

             scanners c_id v_id

1.7.        Feasibility

             The functions and attributes above can be implemented within the given cost and schedule constraints. One problem with the current store system is that it doesn t have scanners. All data must be entered from the keyboard. This is slow and error prone. A quick and efficient system will make the store more user friendly.

1.8.        Environmental Diagram

 

2.   USE CASES

2.1.        Typical Course Of Events

             A customer comes into the store to either rent or return a video.

             When a customer rents a video, the clerk scans their store ID card and the video. The transaction and current charges are then displayed (including late fees). After payment is received, account and the video records are updated.

             When a video is returned the clerk scans the video, the records are updated (including late fees if applicable), and the video is restocked.

2.2.        Use Cases Diagram

2.3.        Rent Video

             Actors: Clerk

             Purpose: To make a rental association between the customer account and the video.

             Overview: The clerk scans the customer ID and the video. The system associates that video with the customer account. Then it determines the current charges and displays this on the monitor. The clerk collects the money, the system prints a receipt, and the records are updated

Actor Action

System Response

1.      Clerk scans video.

2.      Gets video data.

3.      Clerk scans customer ID.

4.      Gets customer account, including current late fees.

 

5.      Displays customer account with this transaction.

6.      Completes transaction.

7.      Updates records.

              

2.4.        Return Video

             Actors: Clerk

             Purpose: To update customer account and video data.

             Overview: The clerk scans the video. The system gets and updates the customer account and the video usage. Applicable late fees are added to the account.

Actor Action

System Response

1.      Clerk scans video.

2.      Gets video data and customer account.

 

3.      Updates account and video records.

              

3.   CONCEPTUAL MODEL

Conceptual Model Diagram

4.   SEQUENCE DIAGRAMS

4.1.        Rent Video

4.2.        Return Video

 

5.   COLLABORATION DIAGRAMS

5.1.        Rent Video

5.2.        Return Video

6.   CLASS DIAGRAM

7.   JAVA CODE

7.1.        // Source file: scanners.java

public interface scanners

{ /** The value of the video ID. */

private long v_id = null;

/** The value on the customer ID card. */

private long c_id = null;

/** Scanner gets customer id from ID card.

@roseuid 3CA182D50023 */

public void catch_c_id(long c_id);

/** Scanner gets video id.

@roseuid 3CA18F9501F3 */

public void catch_v_id(long v_id);

} // END INTERFACE SCANNERS

7.2.        // Source file: keyboard.java

public interface keyboard

{ /** A keyboard button that tells the system to get the

customer and video ID's from the scanner and rent

the customer this video.

@roseuid 3CA2124F035C */

public void rent_kbrd();

/** @roseuid 3CA188DE03D2 */

public float payment(float money);

/** A keyboard button that tells the system to

get the video ID from scanner and update

the records of a returned video.

@roseuid 3CA21279001D */

public void return_kbrd();

} // END INTERFACE KEYBOARD

7.3.        // Source file: system.java

public final class system

{ static

{

}

{

}

system()

{

} // end system

protected void finalize() throws Throwable

{ super.finalize();

} // end finalize

/** Get c_id from scanners and set the scanner

value to null. @roseuid 3CA266210389 */

public long get_c_id() {

} // end get_c_id

/** Get v_id from scanners and set the scanner

value to null. @roseuid 3CA2665502F8 */

public v_id get_v_id()

{

} // end get_v_id

/** Use get_c_id and get_v_id to get c_id and v_id

from scanner. Use these to call database and add

this video to the customers account. Also, set the

video usage to this customer.

@roseuid 3CA191EA026A */

public customer rent_sys(long c_id, long v_id)

{

} // end rent_sys

/** Tell the database to update and commit the

transaction. @roseuid 3CA192FD0265 */

public void commit(float money, long c_id, long v_id)

{

} // end rent_sys

/** Use get_v_id from the scanners, call the database

to get customer ID from video usage. Check for

late fees, remove video from customer account,

set video usage to null, and commit.

@roseuid 3CA197BC010E */

public void return_sys(long v_id)

{

} // end return_sys

/** Display ready/wait state on monitor.

@roseuid 3CA194FB0182 */

public void displayReadyState()

{

} // end displayReadyState

/** Display account with this transaction on

monitor. @roseuid 3CA1929C0003 */

public void displayAccount(CUSTOMER customer)

{

} // end displayAccount

/** Print receipt on terminal printer.

@roseuid 3CA194710007 */

public void printReceipt(CUSTOMER customer)

{

} // end printReceipt

} // END CLASS SYSTEM