You are on page 1of 12

Automation of Sterling Courier

(Advanced Java Programming Project)

Education & Research Department


© Infosys Technologies Ltd

Version Date Author Reviewed by Description


Revision
1.00 May 2007 Yuvarani Suresh Joseph, FP Restructuring 2007.
Meiyappan Neelam Santani
© Infosys Technologies Limited Table of Contents

Table of Contents

BACKGROUND..........................................................................................................1
1. BUSINESS REQUIREMENTS.........................................................................................1
2. THE CONSOLE APPLICATION......................................................................................2
3. MENU SYSTEM.......................................................................................................2
4. DESIGN OPTIONS FOR STERLING COURIER APPLICATION....................................................2

4.1. Class Design for Customer Registration...........................................................3


4.2. Class Design for Order Module......................................................................4
4.3. Class Design for Courier Dispatch Responsibility Generation Module........................5
4.4. Class Design for Delivery Module...................................................................6
4.5. Class Design for Invoice Module....................................................................7
4.6. Class Design for Report Module.....................................................................7
5. GUIDELINES..........................................................................................................9

ER/CORP/CRS/LA22/006 Version 1.0 Page i


© Infosys Technologies Limited Advanced Java Programming Project Specification

Background
This document contains the high level design of the project that has to be executed in order
to complete the course Advanced Java Programming.

The project is to automate Sterling Courier, to provide better service to the customers and
edge over their competitors.

1. Business Requirements
The Business Requirements of the project is as follows. Sterling wants you to implement the
following modules.

• Customer Registration
• Courier Order Booking
• Courier Delivery List Generation
• Courier Delivery
• Invoice Generation

Every day, orders are accepted from the customers. The manager would assign the orders to
the delivery boys for dispatching. The courier is allocated to a delivery boy, if the delivery
boy belongs to the region where the courier order has to be dispatched. Once assigned, the
delivery boy would dispatch the courier and updates the status. The delivery boy keeps
dispatching the courier till the recipient accepts the courier or has been rejected due to
reasons like the recipient not accepting the courier, the recipient permanently not available
in the address.

For the above given specification, some have been partially implemented already and the
source code is available with you. This section describes the services, the proposed system
should provide to the users.

Sl Requirement Status

1 Console Interface to read the data for all the modules Implemented as part of Java
i.e. Presentation Tier Programming module project
2 Bean classes Implemented as part of Java
Programming module project
2 Customer Registration To be implemented
3 Courier Order Booking To be implemented
4 Courier Delivery List Generation To be implemented
5 Courier Delivery To be implemented

ER/CORP/CRS/LA22/006 Version 1.0 Page 1


© Infosys Technologies Limited Advanced Java Programming Project Specification

6 Invoice Generation To be implemented

2. The Console Application

The system has to be web based application, which is part of Introduction to JEE module. The
business tier classes generated as part of this project would be reused in the forthcoming
projects. The console application, written as part of Java Programming module is used for the
purpose of testing the classes created in this project. As this application is for testing, client
side validations are not required for any of the screens.

3. Menu System
This module is to provide a menu system for easily accessing other functionalities

*************************************
Sterling Courier Company
*************************************
1. Customer Registration
2. Courier Order Booking
3. Courier Dispatch Responsibility Generation
4. Courier Delivery
5. Invoice Generation
6. Reports
7. Exit

Enter Your choice:

4. Design Options for Sterling Courier Application

Design Option 1:
The client application interacts with the Database directly

Presentation
Tier

Database

ER/CORP/CRS/LA22/006 Version 1.0 Page 2


© Infosys Technologies Limited Advanced Java Programming Project Specification

Demerits
1. All the layers of the application, presentation layer, business layer and data layer are
tightly coupled
a. A change in any one of these will result in changes in the entire application.
For example, any change made in the database like name of the tables, name
of the fields or the database package itself will affect the UI code
b. Programmers with different skill sets are required for the development and
maintenance of each of these

Design Option 2:

The client application interacts with the database through a set of classes called Data Store
(DB) Classes. Data Store classes abstract the database from the application. Another set of
classes (Bean Classes) are used to hold the data.

CustomerDB OrderDB DeliveryDB

InvoiceDB DeliveryListDB

Presentation Data Store Classes


Tier
Customer Order Delivery

Invoice
Entity / Bean Classes Database
Business Tier

Description:

4.1. Class Design for Customer Registration

This module is used when a new customer wants to enroll himself with Sterling Couriers.
The module allows the user to enroll the customer as well to view the customer
information. The methods in the CustomerTester should interact with the corresponding
method available in the CustomerDB class to store and retrieve the customer information.

Note: Use the Tester and the Bean classes developed as part of Java Programming Module.

CustomerDB

+saveCustomer (in customer : Customer) : int


+retrieveCustomer(in customerId : int) : Customer

ER/CORP/CRS/LA22/006 Version 1.0 Page 3


© Infosys Technologies Limited Advanced Java Programming Project Specification

Note:
• The method, public Customer retrieveCustomer(int
customerId) throws InvalidCustomerException
• The method should retrieve the customer information from
retrieveCustomer(..) the DB and should return it in the form of Customer bean.

Note:
• The method, public Customer saveCustomer(Customer
customer) should call the corresponding SP to store the
customer information in the DB.
saveCustomer(..)

4.2. Class Design for Order Module

This module is used when the order has to be placed for sending the courier. This module
enables placing order, retrieving the order status, retrieving the orders whose status is
neither Delivered nor Rejected, retrieving the Order information. The OrderTester should
call the corresponding method available in the OrderDB to perform the above mentioned
operations.

Note: Use the Tester and the Bean classes developed as part of Java Programming Module.

OrderDB
-connection : Connection
-statement : Statment
+saveOrder(in order : Order) : int
+retrieveOrdersNotClosed(in employeeId : int) : List
+retrieveOrderStatus(in orderId : int) : char
+retrieveOrder(in orderId : int) : Order

Note:
• The method should do the following
o Validate the CustomerID. If invalid, throw
InvalidCustomerException.
o Validate whether the recipient city is any of those
cities where the delivery boys are available (refer to
employee table. Don’t hard code the cities in the
saveOrder()
program). If does not exist, throw
InvalidCityException
o Validate whether Courier weight is <= 5 and >0
o In case of valid data, insert the record into the

ER/CORP/CRS/LA22/006 Version 1.0 Page 4


© Infosys Technologies Limited Advanced Java Programming Project Specification

Sterling_Order table by generating the OrderID using


the sequence
o The status of the courier order by default is ‘A’
o Return the OrderId to the calling method

Note:
• The method public char retrieveOrderStatus(int orderId)
should retrieve the status of the given Order.
• The method should throw InvalidOrderException in case of
invalid OrderID

retrieveOrderStatus()

Note:
• List retrieveOrdersNotClosed(int employeeId) should
retrieve the List of OrderId which are assigned to the
given employeeId but not closed (i.e. CourierStatus other
retrieveOrdersNotClose() than ‘R’, ‘D’).

• The method should throw InvalidEmployeeExcpetion (in


case if the employeeid is invalid),
OrderNotAssignedException (in case if the employee is not
assigned with any order currently)

Note:
• The method public Order retrieveOrder(int orderId) should
retrieve the Order information.
• The method should throw InvalidOrderException in case of
retrieveOrder() invalid OrderID

4.3. Class Design for Courier Dispatch Responsibility


Generation Module
This module is used to generate the courier dispatch responsibility list. The assumption in this
project is that there is only one delivery boy per region. Every day, the manager invokes the
module to assign the orders that are to be dispatched (Order with status ‘Accepted’) to the
Delivery boy. The business logic for assigning the responsibility is that the delivery boy
belongs to the region where the courier has to be dispatched.

ER/CORP/CRS/LA22/006 Version 1.0 Page 5


© Infosys Technologies Limited Advanced Java Programming Project Specification

The DistributionTester should invoke the method by passing the required parameters to
perform the above mentioned operation. The method would further call the stored procedure
to generate the distribution list.

Note : Use the Tester class developed as part of Java programming module.

DistributionDB

+saveDistribution(in dateOfGeneration:Calendar):int

Note:
• The method should call the Stored procedure which generate
the Distribution List and return the appropriate value to the
calling method
saveDistribution(..)

4.4. Class Design for Delivery Module

This module is used by the delivery boy to record the status of delivery of a particular
order. The status of the courier might be ‘Pending’ (if the recipient is not available
currently), ‘Rejected’ (if the recipient does not accept the courier or if the recipient is
not available in the address permanently) or ‘Delivered’. The DeliveryTester should call
the corresponding method available in the DeliveryDB to perform the above mentioned
operations.

Note : Use the Tester and Bean classes developed as part of Java programming module.

ER/CORP/CRS/LA22/006 Version 1.0 Page 6


© Infosys Technologies Limited Advanced Java Programming Project Specification

Note:
• The method should call the Sterling_Delivery Stored Procedure and
insert the record into the table
• public int saveDelivery(Delivery delivery, char status) should throw
saveDelivery(..) InvalidOrderException

4.5. Class Design for Invoice Module

This module is used to generate the invoice for a given month of the particular customer.
The business logic to calculate the invoice amount is as follows. The invoice amount is the
total amount to be paid for each order. The invoice amount is calculated based on the
weight of each courier booked by the customer in a particular month. The InvoiceTester
should call the saveInvoice method in the InvoiceDB which in turn would call the stored
procedure which generates the invoice.

Note : Use the Tester and Bean class developed as part of Java programming module.

InvoiceDB

+saveInvoice(in invoice:Invoice):Invoice

4.6. Class Design for Report Module

This module is used to generate the report on the Orders placed by the customer. This
module should display the menu with two options of selecting a) report on orders which
are not closed and b) report on the status of the order given the orderid.
When (a) is chosen, the application should display the list of orderId’s whose status is
either Pending or Accepted.
When (b) is chosen, create the user interface to accept the orderid for which the status
has to be retrieved. Once the user inputs the OrderId, the application should display the
status of the Order.

Note : Use the class and methods supplied for Java Programming Module project. Create
the required classes and the methods required for this module. The methods should call
the corresponding methods in the SterlingDAO class.

ER/CORP/CRS/LA22/006 Version 1.0 Page 7


© Infosys Technologies Limited Advanced Java Programming Project Specification

Merits
1. The presentation logic and business logic are decoupled
a. The presentation logic is separated and coded in the client application and
business logic in the data store classes
b. A change in any one of these will result in changes only in the corresponding
classes. For example, changes in the database do not affect the client
application as the Data Store Classes abstract the database from the rest of the
application
c. Programmers with different skill sets can be engaged for the development and
maintenance of each of these
2. The client application gets an Object Oriented interface to interact with the database

Demerits
1. The client application has coupling with many classes as it has to interact with too
many classes (Data Store classes and Entity classes).
a. A change in the interface of any one of these classes will result in a change in
the client application
b. The programmer who writes the client application should know about a lot of
classes

Design Option 3:

The client interacts with the data store classes through a DAO (Data Access Object) class. A
Façade class provides a unified interface to a set of interfaces in a subsystem. Facade defines
a higher-level interface that makes the subsystem easier to use.
SterlingDAO

CustomerDB OrderDB DeliveryDB

InvoiceDB DeliveryListDB

Presentation Data Store Classes


Tier DB
Wrapper

Customer Order Delivery Invoice


Entity / Bean Classes Database
Business Tier

SterlingDAO

+saveCustomer(in customer:Customer):int
+retrieveCustomer(in customerId:int):Customer
+retrieveOrdersNotClosed(in employeeId :int):List
+retrieveOrderStatus(in orderId:int):char
+retrieveOrder(in orderId:int):Order
+saveOrder(in order:Order):int
+saveDistribution(in dateOfGeneration:Calendar):int
+saveDelivery(in delivery:Delivery, in status:char):int
ER/CORP/CRS/LA22/006 Version 1.0 Page 8
+saveInvoice(in invoice:Invoice):Invoice
© Infosys Technologies Limited Advanced Java Programming Project Specification

Merits
1. The presentation logic, business logic and persistence logic are decoupled
a. A change in any one of these will result in changes only in the corresponding
classes
b. Programmers with different skill sets can be engaged for the development and
maintenance of each of these
3. The client has to interact only with the façade class instead of interacting with each
of the data store class

Note: Use design option 3 for the project because it is the most
maintainable design

5. Guidelines
• All the methods in the DB classes should re-throw the SQLException to the calling
method
• The User defined Exceptions should be handled in the client side in the console
application
• All the modules after accepting the data, should process it and display appropriate
messages both in case of success as well failure
• Java help should be generated describing all the classes and its members
• Below is the responsibility of the individuals in the group.

Individual Responsibility
Trainee 1 CustomerDB, SterlingDAO
Trainee 2 OrderDB
Trainee 3 DistributionDB, Reports
Trainee 4 DeliveryDB, InvoiceDB

• The group should finally integrate the project before evaluation


• Submission Guideline
o Create a folder as Group<GroupNo>
 E.g. if you belong to Group 11, the folder name should be Group11

ER/CORP/CRS/LA22/006 Version 1.0 Page 9


© Infosys Technologies Limited Advanced Java Programming Project Specification

o Copy paste the entire project into the folder


o Drag and drop the root folder into the submission path that would be given

ER/CORP/CRS/LA22/006 Version 1.0 Page 10

You might also like