Vous êtes sur la page 1sur 26

Object Oriented Systems Analysis and Design with UML

Problem Statement
Supermarket requires stock control system to void out of stock level for each product. A purchasing_admin will be able to process an order by entering product numbers and required quantities into the system. The system will display a description, price and available stock. In-stock products will normally be collected immediately by the customer from the store. If stock is not available the purchasing_admin will be able to create a backorder for the product. The system will allow products to be paid by cash. Order details for in-stock products will be printed including the quantity, product number and description. The store manager will be able at any time to print a summary report of sales in the store for a given period, including assignment of sales to sales assistants in order to calculate weekly sales. The stock manager will be able to monitor stock levels and weekly run-rates in order to set minimum stock levels and requisition products which fall below the minimum stock levels or for which demand is anticipated. When the stock arrives it will be booked in by the warehouse person. Stock that has been backordered for collection from the store is held in a separate area and the store manager advised of its arrival. The catalogue of available products will be maintained remotely.

Step 1: Identify the business events and make an event table.


Actor providing system input

Number of event

Event description

System input

output

Actor receive output

1-

Purchase some goods from supplier

Request out of stock product

Purchasing admin

2-

Receive product from supplier

Product_id And quantity

Purchasing admin

Purchasing List of out admin of stock determine product which product want to buy from Supplier Update Purchasing product admin level in the stock

3-

Generate bill

Product_id Product_price Product _quantity Product_id Product name

supplier

invoice

4-

View goods in the supermarke t

seller

Product Informati on that stored in the system

Purchasing Admin To pay these invoice customer

5-

Customer purchase product from supermarket

Product _id Product _unit

customer

Decrease the stock Seller level of that product

6-

Generate selling bill

Product _id Product-unit

employee

invoice

customer

Step2: Identify the use cases and produce a use case diagram for the system 1- Purchase goods from supplier 2-Receive product from supplier (after check the product that need) 3- Generate purchasing bill 4- View product in the supermarket 5- Purchase product from customer 6- Generate selling bill to the customer

Determine the Actor: Initiate Purchasing _admin Purchasing _admin supplier seller customer employee Participant supplier Purchasing _ admin Purchasing _admin customer seller customer

Use case diagram Purchase good from supplier

Purchasing_admin

Generate purchasing bill

supplier

Receive product from supplier

Stock manager

View product into a supermarket

Seller
Purchase product by customers

Customer

Generate selling bill

Employee

Step 3: Write a use case narrative describing the systems response to each business event

Use case Actor purpose Description

Purchase goods from supplier Purchasing_admin Supplier Determine out of stock product then check product want to buy Purchasing admin request out of stock product and the system response a list of out of stock product then purchasing admin check the product want to buy from supplier

Use case Actor purpose Description

Receive product from supplier Purchasing _ admin To check the product unit want to store in the inventory After the purchasing_admin determine the product want to Supply from specific supplier the product send to the supermarket then purchasing_admin check this product and update stock level

Use case Actor

Generate purchasing bill Supplier Purchasing_admin To identify and document the quantity of product that supplied from supplier and document amount of invoice Supplier determine the product id and quantity and price that checked by the purchasing_admin then prepare the invoice to the purchasing admin to prepare payment

purpose

Description

Use case Actor

View product in the supermarket Seller Customer To store the information in the product and then view in the supermarket The seller enter the product information in the system and then view the product in the supermarket Purchase product by the customer Customer seller Paying the product and update the level of the stock Customer purchase product and the level of stock decrease (-)

Purpose description

Use case Actor purpose Description

Use case Actor purpose description

Generate bill to the customer Employee customer To produce invoice After customer purchase some goods from the supermarket the

employee enter product _id to the system and the system provide invoice that contain product _id, unit, price .

Expanded essential use case narrative for supermarket system:Use case Actor purpose Description
Purchase goods from supplier Purchasing_admin Supplier Determine out of stock product then check product want to buy Purchasing admin request out of stock product and the system response a list of out of stock product then purchasing admin check the product want to buy from supplier essential Out of stock product must exist List of out of stock product Purchasing admin must get the system response in 20 second

Type precondition Post condition Special requirement

Flow of event
Actor action 1- this use case begin when purchasing admin desire to supply some goods from supplier 2- the purchasing admin provide the request to determine the out of stock product 4- check the product want to purchase

system response 3- list of out of stock product 5- send the list to the supplier

Alternative flow of event When no product that out of stock so no list generate

Use case Actor purpose Description

Receive product from supplier Purchasing _ admin To check the product unit want to store in the inventory After the purchasing_admin determine the product want to Supply from specific supplier the product send to the supermarket then purchasing_admin check this product and update stock level Essential Request of the product must exit Confirmation that the list already supply to the supermarket and received Purchasing admin must get the response and confirmation in 1 day

Type Precondition Post condition Special requirement

Flow of events Actor action


1- this use case begins when A supplier receive the list of out of stock product 3- purchasing admin receive The confirmation and the product Supplied and hold in the inventory

system response

2- send conformation to the purchasing-admin include the quantity and price of the checked product 4- update stock level

Alternative flow of events Step2:if no conformation send to the purchasing admin so no product received

Use case Actor

Receive purchasing bill Supplier Purchasing_admin To identify and document the quantity of product that supplied from supplier and document amount of invoice Supplier determine the product id and quantity and price that checked by the purchasing_admin then prepare the invoice to the purchasing admin to prepare payment essential Receive product from supplier and update the level of the stock Receive the invoice to prepare payment

purpose

Description

Type Precondition Post condition

Flow of event

Actor action
1-this use case begin when a supplier desire to provide specific detail about product that supplied to purchase-admin 2- the supplier provide invoice-no Quantity and price 3- on completion of entry the supplier indicate that the invoice is complete and send to the purchasing-admin

system response
4- receive the invoice

Use case Actor

View product in the supermarket Seller Customer To store the information in the product and then view in the supermarket The seller enter the product information in the system and then view the product in the supermarket Receive product must be exist Update level of stock must be exist Store information in the system After the completion of storing information product view in the supermarket.

Purpose description

Precondition

Post condition

Flow of event
Actor action system response

1- this use case begin when the seller store product information about the product then the product view in the supermarket

2- store the information about

Use case Actor purpose Description

Purchase product by the customer Customer seller Paying the product and update the level of the stock Customer purchase product and the level of stock decrease (-) Store information about the product and view the product in the supermarket must exist Customer buying the product and update the stock level

Precondition

Post condition

flow of event Actor action 1-this use case begin when the customer purchase goods from supermarket 2- the seller enter the product id and quantity 4-on completion this process the customer Receive product (after payment) system response 3- the system store information of the product

Use case Actor purpose description

Type Precondition

Generate bill to the customer Employee customer To produce invoice After customer purchase some goods from the supermarket the employee enter product _id to the system and the system provide invoice that contain product _id, unit, price . Essential 1- customer purchase product 2-decrease the stock level Generate bill to the customer

Post condition

contain product unit, and price ,and name

Event flow
Actor action
1-This use case begin when employee desire To provide specific detail about product That purchased by customer. 2- employee enter product specification as (product_id,product_name,unit,price)

system response
3- add detail of that product 4-prepare invoice.

Alternative step3: invalid product detail return to step 3

Use case scenario

Use case 1:

Purchase goods from supplier

Purchasing admin request the out of stock product, the system provides a list of out of stock product. After the list checked by the purchasing admin, purchasing admin choose the galaxy chocolate to purchase from a supplier.

He needs galaxy detail such as (id) the system provides detail and request from supplier.

Product name Product _id unit

galaxy 1012345678 200 unit

Receive product from supplier:After the request send to the supplier the purchasing admin wait the supplier conformation if the supplier can provide the product. When the conformation received the supplier can provide only 150 unit of galaxy chocolate. The purchasing admin send the request again to another supplier or reduce the quantity.

Generate purchasing bill:The supplier kareem masri send the conformation to the purchasing admin that he can provide the 200 unit of galaxy after One day. The purchasing admin agree with this transaction and wait the invoice.

the supplier kareem masri send the invoice (invoice no :10132,send to the purchasing admin in 2-2-2011 and include the quantity of sold product (galaxy:200 unit ) and price 600 shekel .

View product into the supermarket: When the seller want to view the product (galaxy) in the supermarket He enter the product detail (galaxy detail) before he can view in the supermarket He enter the galaxy_id 1031245, galaxy _description, quantity in the stock, and the supplier _id) Assume he save this information the system response: (Invalid product_ id)

Purchase product by the customer: Ahmad Jamal went to the supermarket on Jan 12,2011 and intend to by rice ( shoqha , 150 shekel , 10kg) but the product was drained from the supermarket , then the customer go back without buying it ).

Generate bill to the customer:Omar isam went to the super market on Feb 3,2011 and he intend to buy milk (Nedo, 25 shekel) the employee enter the product barcode and the system generate bill provided to the customer include product name and product quantity and the(sub total) price and total price ..

System sequence diagram 1-use case 1

Purchase goods from supplier

Supermarket system Purchasing_admin


Supplier

request product( ) list of out of stock product ( )

paying product (id, unit )

Request ( )

confirmation ( ) end request ( )

Bids ( )

System sequence diagram

Use case 2: receive product from supplier

Stock manager

Supermarket system

Purchasing_admin

jjjuhui

Enter product information (id, unit, name) Store information ( ) update stock level ( )

System sequence diagram Use case 3: generate bill from supplier

Admin

Supplier

Super market system

Determine buying product (product_id, name, unit, price) Invoice information ( ) send invoice ( )

System sequence diagram Use case 4: view product in the supermarket

Super market system

Seller

View product (p-id, name, des, image)

Store information ( )

System sequence diagram Use case 5: purchase product by the customer

Employee

Supermarket system

Check barcode (product_id)

Decrease level of stock ( ) Payment (p-id, price, amount) Confirmation ( )

System sequence diagram Generate bill to the customer :-

Employee Supermarket system

Customer

Determine purchasing product (Product id, name, price, unit) Generate bill ( ) send invoice ( )

Contract:
Name Responsibilities Type Exception Precondition Post condition Request out of stock product Provide the product not a available in the stock System If all product a available no out of stock generate Decrease the stock level Update list of out of the stock product

Name Responsibilities Type Exception Precondition Post condition

Paying the product (product _id,product_unit) To identify the product id and unit want to buy System If the product id is not valid indicate that it was an error Save List of out of the stock product Save List of product want to buy

Name Responsibilities

Request product (product _id, unit) To identify the supplier and send a list of product want to buy System If no supplier none in the system indicate the error Add supplier to the system Add new order information.

Type Exception Precondition Post condition

Name Responsibilities Type Exception Precondition Post condition

Choose bid Choose one of several bids System If no bids provided indicate an error Store the order information Save selected bid

Name Responsibilities Type Exception Precondition Post condition

Receive the product from supplier Update stock level System If product is not available indicate error Save selected bid Update stock level.

Name Responsibilities Type Exception Precondition Post condition

Determine buying product (p_id,name ,price,unit) Determine buying product System Indicate error if p_id not available Update stock level Save product information .

Contracts for use case 4 contract Name : view product(product t id ,product name, description ,image) viewing product in the supermarket.

Responsibilities : Type :

system.

Contract Name: store information(product id ,product name ,description ,image). storing information about product. system. information stored. For use case 3 Contract Name: determine buying product(product id ,product name ,unit price). to know what the product that we buying from supplier. system. purchasing bill. send order must be exist.

Responsibilities : Type: Output:

Responsibilities:

Type : Output: Precondition :

Pot condition :

display invoice information.

Contract Name: invoice information(product id, product name ,price). storing information about invoice. system. display the product that we want to buy saving information of invoice.

Responsibilities: Type : Precondition: Postcondition :

Contract Name : Responsibilities: Type : Output: send invoice() sending invoice to the admin from supplier system. bill for the system.