Lab 10

Detailed Design

Objectives

In this lab, you will carry out a detailed design for the modules you’ve chosen, which include

-  Select appropriate HTML tags to layout the required static and dynamic elements in the JSP page

-  Determine properties needed in the form bean class and the mapping between these properties and the dynamic elements in the JSP page

-  Specify the logic in the execute method in the corresponding action servlet and the operations expected from one or more business manager classes involved

In this lab, we will start to put everything together. Our focus now is to display the contents in the right format assuming we can retrieve them from the database via the business managers. (Let’s simplify our architecture to take off the DAO layer at least temporarily.) As an outcome from this design activity, you should specify what the business managers need to provide for your page and in what manner.

Diagramming the Roundtrip Transaction

Let’s get started with drawing an interaction diagram to have a clear picture about what components are involved and the interactions between them.

1.  Open the CBTS Interface Design.doc file in the project folder, and use the diagram as an example to draw (by hand) a similar diagram here. Identify the business managers involved in the transaction and the operations expected. Label the order in which each operation is carried out.


Design the Modules

2.  The JSP page. Write a HTML file that will display the required elements in an appropriate format, using sample data items as placeholders for values that will be delivered by JSP expressions. Submit a screenshot of the static page. Then modify it into a .jsp file with jsp tags to replace the placeholders.

3.  The form bean. Use the class notation below to specify attributes needed in the form bean. Make sure you follow the naming convention: the attribute names should match exactly to the property names in the JSP page, and the form name should be the JSP page name with the Form suffix.

<enter class name here>
- <attribute-name>:<type>[=<default-value>]
- ...

4.  The action servlet. Your servlet should have the name which is the JSP page name with Action as suffix. There is only one method execute is required, although you can use any helper methods that you feel need. The template for the execute method is specified as below. Concentrate on how to generate the nextPage based on the information passed in from the prevPage. Identify services needed from the business managers.

public BaseForm execute(BaseForm prevPage) {

YourForm page = (YourForm) prevPage;

//retrieve info from the prevPage

InfoType info = page.getInfo();

...

//generate result needed to populate nextPage

BizMgr bizMgr = BizMgr.getInstance();

ResultType result = bizMgr.genResult(info);

...

return new NextForm(result);

}

5.  Specify services needed from the business manager(s). These will include retrieving and processing data from the database, and perform actions such as randomly select and shuffle a set of test questions.

Due Date

November 18, at beginning of class.