CPE 4001 Distributed Programming using Java
Assignment One
Semester 2, 2002
Introduction
The Chapstick shopping centre is one of Australia's largest shopping
centres and hosts a large number of shops of different kinds.
Chapstick already has an extensive Web site, but is contemplating
moving towards an online system to support ecommerce activities.
Their new system will require a complete separation of presentation
from logical aspects, so they are looking at a traditional
client/server system that can later be modified to use other
middleware technologies. They expect a system to be structured
so that changes to clients, servers or middleware technology
can be done as easily as possible.
This assignment has graded levels. The simplest version will be given
a Pass if done satisfactorily, but to gain higher grades more features
will have to be added.
Details
You will need to implement a client and one or more servers
using a socket-based protocol.
The client will need to be able to make the following requests
to the Chapstick central server:
-
What types of shops are currently in the shopping mall?
The response should be a list such as:
Men's apparel, Giftware, Toys/Games, etc.
-
For a given shop type, what shops of that type are in the
mall?
-
Where is a particular shop located? This should be in
"map coordinates" such as F15
-
For a particular shop, what is its catalogue?
The result should be a list of items sold by the shop
and the price of each item
-
Buy an item from a shop. The purchase request should
include some credit card information
-
Errors should be handled appropriately
Deliverables
You should hand in the following
-
A statement of which level of assessment you are aiming at,
and the parts you have completed
-
A specification of all messages between client and server(s).
This specification should include enough details about message
formats that someone else could implement a client or server
(in any language, not just Java) to handle the messages
-
Finite state transition diagrams where appropriate
-
UML diagrams showing the classes and their linkages
-
Hard-copy listings of all classes for each client and server
-
Electronic copies of all classes for each client and server
-
Instructions about how to install and run each client and server
You will be asked to demonstrate your system during a tutorial.
Assignment levels
General comments:
-
Your clients can use a text-based interface, reading from
System.in
and writing to System.out
,
or can use a graphical interface with AWT or Swing objects.
It does not matter which you choose, the mark will not depend
on the user-interface style
-
The quality of classes and of code for methods will be assessed.
Poor quality code will lose marks. In particular, sloppy indentation
will be regarded as an indicator of erroneous code.
-
Consistency between specifications, diagrams and code will be
checked
Pass level
A client talking to a single server. The server handles
all of the Chapstick requests.
The server keeps lists of the shops, of their types
and has a catalogue for each shop.
All of this can be done using local files and/or
lists and tables kept in memory.
All clients and servers will be written in Java. However,
you should not assume that the other end of a communication
channel will be in Java - it could be in some other language
such as C# or Perl. So do not use any Java-specific techniques
such as serialising Java objects.
This level demonstrates that you can specify a protocol for
communication between
a client and a single server and implement this protocol in a
simple way.
Extra level
The specification given above will gain a Pass grade if done
satisfactorily. Higher grades will be given
on completion of additional functionality.
Each additional function will gain an extra grade
(to a maximum of HD). The
additional functions are
-
JDBC
-
All databases are managed by a database system such as Access,
Oracle or MySQL. The server communicates with the database by
JDBC calls.
This level shows that you can manage a typical 3-tier system
with presentation, logic and database handled separately.
-
Multiple servers
-
Each shop runs its own server. Chapstick will forward
certain requests (such as catalogue) directly to the
shop's server rather than maintaining information
on its own server.
This level demonstrates that you can deal with a multi-tier system
with many servers at the backend
-
Security
-
All sensitive accesses are performed using security mechanisms,
such as encryption and validation. Each server
should be able to validate its identity using certificates
This level shows that you can handle the authorisation, security
and privacy issues that can arise
-
Web access
-
Web access to the Chapstick service should be made available.
This will mean a CGI script/Java servlet/etc that can act
as a client to the Chapstick server. This will involve
a set of Web pages and HTTP backends to handle form requests.
This is in addition to an ordinary client, not as a replacement
This level will add alternative access mechanisms to the service,
which makes it Web-accessible to humans
-
Version control
-
The client should be downloadable from a Web page as a JNLP (Java
Network Loader Protocol) application. This will allow the client
code to be downloaded/upgraded and run.
This level will help with version control issues. In order to use it,
you will need to understand and use a formal specification document.
-
XML
-
Messages should be sent as XML messages, using JAXB
(or equivalent such as XStream) to marshal
and unmarshal them. In this case, you will also have to specify the
DTD or schema of each document.
This will give practice in using XML, including writing DTDs or schema.
Final level
The final level will be the sum of all extensions. For example,
adding separate shop servers with JDBC backends and a Web frontend
will be worth a High Distinction - unless things like code quality
pull it down. Similarly, separate shop servers (using local files),
a client downloaded by JNLP and authorisation and encryption security
would also be worth an HD.
Group size
This assignment (and the next one) may be done in a group
of two.
While you may do this assignment individually, the marking
scheme will be the same as for a group of two.
You are encouraged to work in a group, with each partner doing
one side each of the protocol, in order to discover the value
of clear protocol specification.
Due date
The assignment is due by 12 noon, Monday 12 September, the beginning of week 9.
Jan Newmarch (http://jan.newmarch.name)
jan@newmarch.name
Last modified: Sun Jul 24 18:18:46 EST 2005
Copyright ©Jan Newmarch
Copyright © Jan Newmarch, Monash University, 2007
This work is licensed under a
Creative Commons License
The moral right of Jan Newmarch to be identified as the author of this page has been asserted.