Mapper Logo
.

1. MapperXML Overview

Overview of MapperXML Component
figure 1.1 - Mapper Architecture

1.1 Architecture

MapperXML is a presentation framework for web applications. The MapperXML presentation framework(fig 1.1) is based on the Model-View-Controller pattern. The MVC components use models which can bind to simple java ValueObjects and Collections. The framework is extensible for other presentation applications (reporting, data exchange, etc) by extending and implementing appropriate containers, components and subcomponents. The overall architechure is very flexible through the extensive use of subcomponents. All Components and Containers are made up of subcomponents which can be easily replaced or extended to provide new behavior.

1.2 Web Application Approaches

MapperXML uses a different approach to building web applications. Many web programming languages involve mixing HTML and programming code in the same unit. This forces the person writing the code to know HTML and programming. It also produces code which is difficult to maintain. Although design patterns have evolved to reduce this problem, they have created new problems. Current JSP Model 2 (fig 1.2) design patterns advocate using a Servlet as the controller and moving as much code as possible to Beans which will be invoked by the JSP. This approach still leaves some code in the HTML and fragments the programming unit (Servlet+JSP+Bean(s)).

JSP Model 2 Approach
figure 1.2 - JSP Model 2 Approach

MapperXML use some of the designs pioneered by the Enhydra project and the XMLC subproject. The MapperXML approach has three important features. The first is the role of the ServletApp(Servlet). The ServletApp acts as a very high level application controller and delegator. The real work is done in the ServletForms. The ServletApp examines the incoming request and invokes the appropriate ServletForm to handle the request (fig 1.3).

MapperXML Approach
figure 1.3 - MapperXML Approach

The other feature is how MapperXML produces the HTML or XML response. MapperXML uses a prototype XML document which is loaded into memory as a org.w3c.dom.Document(DOM). The DOM is then manipulated to produce the desired result. Runtime values can be substituted for prototype values in the DOM (fig 1.4). The DOM is then rendered as a character stream and sent back to the client. The prototype XML/HTML document does not contain any code. The only requirement is use of an "ID" attribute to identify the elements which will be modified at runtime.

MapperXML DOM Approach
figure 1.4 - MapperXML DOM Approach

The final feature is the use of individual MVC components within the ServletForm. These components are very similar to Java Swing(tm) components. These components can respond to events in the http request (Controller), receive values from the http request and store them in a Model/ValueHolder, and render their values to the DOM (View) (fig 1.5). MapperXML includes a variety of components to build web applications (fields, buttons, etc).

MapperXML MVC Components
figure 1.5 - MapperXML MVC Components

.