Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Primary Presentation


Diagram in MS Visio format

Element Catalog

servicelocator::web:Package. Belongs to the servicelocator package of the components module.
waf::view::template: The template service assembles multiple JSP pages and Web resources into a single composite view. Refinement view is available.

under the namespace waf::controller::ejb

action:The classes in this package implement an EJB action following the command design pattern.
action::<<interface>>EJBAction:Base EJB action interface. Follows the command design pattern.
action::actions::ChangeLocaleEJBAction:Changes the locale attribute of the StateMachine.
StateMachine:This class is a responsible for processing Events received from the client tier. Af part of the WAF framework the events are generated by web actions. The State Machine ties all EJB components together dynamically at runtime thus providing support for reusable components. This class should not be updated to handle various event types. This class will use ActionHandlers to handle events that require processing beyond the scope of this class. The mapping of the event names to handlers is mangaged by the JNDI key contained in the Event::getEventName() which is looked up from an environment entry located in the EJB Deployment descriptor of the EJBClientController. A second option to event handling is to do so in the XML file.
waf::event: Package that includes all the base classes that handle EJB and Web tier base events. Refinement view available.

under the namespace waf::controller::web

<<interface>>ComponentManager:Defines the services that need to be accessed from the web tier. It is loaded at startup. Can initialize objects used in the presentation tier
action:The classes in this package implement an Web actions following the command design pattern.
action::<<interface>>HTMLAction:Interface to request handlers on the web tier
action::actions::ChangeLocaleHTMLAction:HTMLAction that processes changes in language
DefaultWebController:Default implementation of the WebController interface.
EventMapping:Mapping between an Event and the necessary EJB Action Class
flow:Package that handles the flow of UI events from the user. Classes in this package are used and initialized through java. ServletContext
flow::<<interface>>FlowHandler:Base interface to flow handlers on the web tier.
flow::ScreenFlowData:Carries the default screen and the mappings of its exceptions.
flow::ScreenFlowManager:Maps the request URL to the page for the web-templating mechanism.
MainServlet:Procesess HTTP commands, like Get and Post, i.e, it matches a url to a mapping object that contains information about the current screen, the HTMLAction that is needed to process a request, and the HTMLAction that is needed to insure that the propper screen is displayed.
RequestProcessor:Web tier controller for the sample application. Processes all requests from the Main.jsp and generates the necessary data-modifying events which are sent to the WebController

Variability Guide

None.

Other Information

About the Design

The WAF, Web Application Framework, provides the framework for a Model-View representation of the application. The waf::controller::web package is the view, and the waf::controller::ejb package is the model. They interact in several ways:

  • Direct invocation. The ComponentManager in the view calls the EJBControllerLocalEJB directly.
  • Indirect invocation. The model uses the waf::event package to receive and send messages to the view.

Events and actions are closely related:

  • HTMLActions create Events. Each HTMLAction creates one type of event.
  • Events carry information about the phenomena. Events do not know about actions.
  • For every type of Event there can be just one unique type of EJBAction that uses it as input.

This separation promotes flexibility and scalability as it reduces the cohesion between classes and it even allows classes from other packages to "hear" this events, without changing any code in the model.

Comments in the Code

There are a couple classes with incorrect comments in the source code:

  • waf::controller::web::DefaultWebController
  • waf::controller::web::WebController

They both refer to an inexistent class called waf.controller.ejb.ShoppingClientControllerEJB. Apparently they forgot to update it to waf::controller::ejb::EJBControllerLocalEJB, which would still be wrong as waf::controller::web::WebController does not refer to it!!!

Related Views

Back to the Pet Store SAD main page

  • No labels