Enterprise web programming

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

Pre-SWS task 2013-2014c1

Preparation task (Task A)

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

  1. It must provide a shared online contact list facility.
  2. The details about a person include:
    1. their username (comprising at least 6 alphanumeric characters), which must be present and must be unique among all active users
    2. their password, which must never be displayed by the system
    3. their real name (identifying their firstname(s) and lastname separately), which must be present
    4. their address, including a valid postcode if it is in the UK
    5. 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
    6. their email address, which must be present and in a valid format
  3. A user must be able to create a new user account by providing the information above.
  4. Only valid records shall be added to the database. If the user enters an invalid record, the system indicates to the user where invalid data has been entered and provides them with an opportunity to correct it.
  5. Once a user record has been created, it can only be altered by someone who provides the username and password, or is logged in using those.
  6. Any logged in user can search or browse the records of all users. Someone who is not logged in cannot view any records.

Validation of records 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 each 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.