Enterprise web programming

Modules ENTWA (Level 6) and APSW (Level 7)

Pre-SWS task 2012-2013c1

Preparation task (Task A)

Your task is to implement a web application that has the following functionality:

  1. It must provide an online airline booking facility.
  2. A booking consists of a flight and a passenger.
  3. The information entered about a flight must include the following:
    1. The flight number (consisting of 2 letters followed by 1-4 digits, e.g. BA963), which must be present.
    2. The date of the flight (in the format dd/mm/yyyy, e.g. 09/01/2009), which must be present.
  4. The information entered about a passenger must include the following:
    1. A username (comprising at least 6 alphanumeric characters), which must be present and must be unique among all active passengers.
    2. Their real name (identifying their firstname(s) and lastname separately), which must be present.
    3. Their address, including a valid postcode if it is in the UK.
    4. Their phone number, which, if present, can validly be in any one of the formats illustrated below (where spaces are not significant):
      1. +44 (23) 92846438
      2. (023) 92846438
    5. Their email address, which must be present and in a valid format.
  5. If the user enters an invalid booking, the system indicates to the user where invalid data has been entered and provides them with an opportunity to correct it.
  6. If the user enters a valid booking, it is added to a session-scope list and the complete contents of the list displayed to the user.

Validation of bookings must be done.

Notes

You must develop your solution using HTML and Java EE components as appropriate.

The code written should be of "good quality", viz. exhibit good layout and readability, and possess good structure (using classes, packages and inheritance where appropriate; keeping separate tiers distinct). User interfaces should be clear and accessible, and require minimum effort on the part of the user to perform the most common operations. The reuse of existing code is encouraged (including publically available/open-source material), but must be acknowledged. Aim to keep the length of your methods short.

Advice

  1. Think carefully about the design of objects to represent the entries. What properties should they have and what type should the properties be? What other operations (methods) should be applicable to an address book entry object?
  2. The Model-View-Controller (MVC) pattern is a good way of structuring a web application, as is layering. Think carefully about how you can structure your code to achieve this separation.
  3. Use the online documentation and your reference books.
  4. Don't leap into coding. Make sure you have a feasible design for your solution before you start programming it.
  5. Allow plenty of time to integrate separately developed parts of the program. It is often only at this stage that you find flaws in the design.
  6. You may reuse code taken from elsewhere (including textbooks and the web), but such code MUST be clearly distinguished and the source of it MUST be acknowledged by a comment in the program listing.
  7. Develop your code in small parts. Test each part as you implement it. Run your program frequently – don’t add more than about 10-15 lines of code (at maximum) without compiling it to check what you’ve done. Use the breakpoint debugger to run the program to find out whether variables have the values you think they should have. Think carefully about the design of each part of your program. Don’t reject well thought out code just because you get compilation errors – work out why you’ve got an error and correct it, don’t throw away the good with the bad. Don’t be over ambitious.

Constraints

Resources

The example applications I have used in lectures and practicals.

You may find it useful to use some of the Java Collections Framework classes (java.util.*).

You may use any SQL-compatible database management system such as Apache Derby (shipped with NetBeans 5.5 or later) or MySQL. You should chose to use JPA to intermediate your database operations.

Deliverables

  1. There is no formal deliverable for this task, however you will need to bring an electronic version of your work along to the SWS.
 

Last updated by Prof Jim Briggs of the School of Computing at the University of Portsmouth

 
The enterprise web programming modules include some material that was formerly part of the WEB1P and WEB2P units.