CS 486: Global Knowledge Networks

Download Report

Transcript CS 486: Global Knowledge Networks

CS 772: Global Knowledge
Networks
V. “Juggy” Jagannathan
CSEE, West Virginia
University
Feb 18, 2002
Design for HTML Production
Chapter 12
Based on the book: “Enterprise Java with UML”
OMG Press, John Wiley and Sons, 2001.
Design Goals


Goal 1: Support Modular Construction of Views
Goal 2: Keep HTML Production Simple
–
–
–


Hide the actual tags and options
Hide all browser-specific behavior
Enable natural development of user interface
Goal 3: Support Preferences
Goal 4: Extensibility and Encapsulation
Design to Goals

To Support Modular Construction of Views
–
The composite design pattern


“Composite objects into tree structures to represent part-whole
hierarchies”
Page
–
–
Table
 Image
 Text
Applying Composite



Pg 329, figure 12.1
Pg 329, figure 12.2
Pg 330, figure 12.3
Design to Goals

Keep HTML production simple
–
Browser-specific HTML


–
The Abstract Factory Design Pattern


–
–
Pg 331, figure 12.4
Requires the client module to know which implementation is
suited for which browser.
“Provide an interface for creating families of related or dependent
objects without specifying their concrete classes” [Gamma, et al
1995]
Pg 333, figure 12.5
Design Evaluation
Producer factory – Pg 334, figure 12.6, pg 335, figure 12.7

Pg 336, figure 12.8
Design to Goals

Support for preferences
–
Preferences alternatives



A method (property) for
each preference with
getters and setters
Use java.util.Properties
object – name-value
pairs
First method uses
compile time checking the second does not
<<Interface>>
IHtmlProducer
+getHtml() : String
+setPreferences(properties: Properties)
Design to Goals

Design for Extensibility and Encapsulation
–
Encapsulation

–
Producer factory registration – pg 339, figure 12.10
Evaluation of package dependencies


Pg 340, figure 12-11
Pg 341, figure 12-12
Detailed UI Design

Login Screen
–
–
–
–
Pg 340, fig 12-13, 12-14
Pg 343, fig 12-15
Pg 344, fig 12-16
Pg 345, fig 12-17
Implementation
HTML Production
Implementation









IHtmlProducer.java
ComboBoxProducer.java
FormProducer.java
PageProducer.java
SubmitButtonProducer.java
TableProducer.java
TabularInputFormProducer.ja
va
TextFieldProducer.java
TextProducer.java






IconcreteProducer.java
ProducerFactory.java
FormProducerGeneric.java
PageProducerGeneric.java
TableProducerGeneric.java
TabularInputFormProducerGe
neric.java
Design for the TimecardUI
Package
Chapter 13
Based on the book: “Enterprise Java with UML”
OMG Press, John Wiley and Sons, 2001.
Design Goals


Extensibility – delegate all HTML production to
HTML Producers and not the servlets
Testability
Review Prior Steps


Architectural constraints – pg 375, fig 13.1
Review Analysis model – pg 376, pg 377, pg
378, pg 379, pg 380
Design for Login Use Case

Figure 13.7, pg 382