The goal of this assignment is to begin exploring client/server systems that use HTML Forms and Java Servlets. Themes that will be emphasized are using a Model -View - Controller design, DataBeans, and appropriate division of function in appropriate components for ease of programming and potential maintenance. A key technology is JDBC.
The basic application is an address book. It should supports access to the address book through a conventional Web browser, and it should support multiple users. Thus, your design should include user registration, login and login creation, and the address book function, itself -- that is, adding, deleting, and updating entries as well as searching for entries. The addressbook should include the following information for each individual included:
- name
- address (able to handle several forms: i.e., house, PO box, apt., office, rural address)
- city
- state
- zip
- home phone
- office phone
- fax phone
- cell phone
- e-mail address
- url
The server must be able to report errors and null results to the client. It should provide persistent storage for the data in the form of database tables.
The client, implemented as HTML forms, should provide a user interface that allows users to register as a user, create a login, login, interact with the addressbook, and logout. It should also include a portal or welcome page. The visual appearance is left to your discretion, but should be orderly and attractive.
As with all assignments, presentation is important. Be sure you include a project description (goals, overall function, instructions for using your system) and systems description (the design of the system and its components, the relationships between components or component groups, and any unusual design choices. You should also provide links by which to run your system.
To simplify the project, it has been divided into three separate subprojects, each with is individual deadline. These are described, below.
Phase 1: Views
Create View components that generate each of the individual forms that comprise your application. These should include the following:
- welcome
- register
- create login
- login
- AB application
- logout
Each view should be implemented as a Java class and called from a control servlet (a "demo" servlet, in this case). Each view should provide a means for returning comments and/or error messages. Views are expected to make effective use of DataBeans.
Documentation for this segment of your overall project is expected.
View Components and Demo Servlet
Phase 2: Control
Create a Central Control Servlet and three specialized Support Servlets. Collectively, they provides control and navigation among the views in response to Form buttons, pass data to one or Model components, and received data back from the Models. They should provide function to support the following:
- maintain state between user requests
- determine the desired operation
- create a DataBean to carry user data, transfer values to the bean, and perform any validity checks available at this stage
- call the appropriate Model method
- check results
- prepare returned data for display, if necessary
- update state, if necessary
- transfer to the appropriate view
Your Control servlets will, of course, use your View components, developed earlier. They should prepare and use DataBeans, including passing appropriate beans to the Views that require them.
Although the emphasis in this assignment is on Control and Navigation, you need to complete a tentative design for your Model components. You should separate overall function into separate components (e.g., Models for registration, login, and application functions). You should design an API for each in which you specify the methods that will be provided to support its function, including input parameters and return types. These methods, of course, will be the way your Control component interacts with the Model(s) component(s).
Model components should be implemented as "stubs." They should implement appropriate interfaces with respect to method signatures, including any DataBean parameters that will be required. However, each method may simply return a valid response, perhaps including "made up" or representative data. In the next iteration of the assignment, "stub" function will be replaced by full implementations that process and return actual data.
Documentation for this segment of your overall project is expected.
Provide a link to begin executing your Control servlet.
Phase 3: Model
If the earlier phases of the project, concerned with View and Control functions, were done properly, this phase should be concerned largely with the Model. It provides the actual semantic function or "business logic" for you application, in this case, comprised mainly of interactions with a DBMS.
Use JDBC to interact with your personal MySQL database. You will need to login to MySQL and manually create your tables. I strongly suggest that you also spend time experimenting with SQL commands to perform the various functions your Model methods will be performing (e.g., adding and deleting entries, searching, etc.) Thereby, you will see the kinds of strings you will need to generate in your Model.
Be sure that your application can support multiple simultaneous users, keep their respective data separate, and support multiple windows from multiple simultaneous users.
Be sure to check the result of the database transaction and generate appropriate return types (e.g., DataBean or other value). Be sure to include provisions so that the user can be informed of the error, either directly by a message generated by the Model or through a convention that allows the Control component to recognize the error and generate an appropriate message.
Provide documentation for the project. Revise earlier segments, as necessary, so that the documentation is complete and unified.
Provide a link to access your application.
You can run a reference implementation below. You can register and create a new user account and login, or you can login with login name guest and password guest.