configurations are set by the developer at the first tier
and enforced into XML based on a schema. When
the policies are formed they are sent to the CM via
the SOAP messaging protocol (W3C, 2004). SOAP
is a messaging protocol that provides a way for ap-
plications to communicate with each other over the
Internet, independent of platform, which serves our
purposes exactly. Additionally, this protocol is light-
weight, requiring a minimal amount of overhead and
occurs over HTTP.
The CM receives the policies, via HTTP and SOAP
from the PM and interprets the information contained
within the policies. This information remotely calls
handlers that define the files to be retrieved from the
STR, based on the indexing system within the STR.
It then sends this information to the STR for file re-
trieval. The CM receives the desired XML file, un-
marshalls the XML in order to extract the necessary
Java abstract class information. Castor, is used to per-
form this task (W3C, 2004). These unmarshalled Java
programs are the desired abstract Java class informa-
tion for use in the creation of an MVC based web ap-
plication.
The STR is the storage repository and interface for
the abstract Java classes. A native XML database is
used as storage medium (W3C, 2004) (Berkely DB,
2004). Xpath is used to query for information and
it supports DOM and SAX. The lack of alternatives
and the undesirable results obtained with a relational
database resulted in our decision to use this technol-
ogy. Indexing, matching that of our policy informa-
tion, leads to fast retrieval of desired files from the
database. These XML files are securely sent back to
the CM for processing.
4 COMPARATIVE
IMPLEMENTATION
An example of how the proposed management of the
model would fit into a real life situation will better
help to illustrate the concept of storing code as con-
tent. A comparison of the “normal” way of writing
this model and a look at how we propose to handle the
model will yield a clearer understanding of our frame-
work. If we look at a simple web development based
on the MVC design paradigm which manages an on-
line employee database for a company. The model
functionality provides us with the ability to store, re-
trieve and edit information in a database about our
employees. The controller was written using Jakarta
Struts with the view written using JSP’s and cascad-
ing stylesheets.
Since we’re dealing with an employee that we want
to insert, we need a way to store information about
this employee that we could hand off to a business ob-
ject (the model layer of MVC). Our model layer will
be responsible for doing the actual insert. So the first
thing we need is a class representing our employee.
We’ll make a bean that has just a couple of fields and
appropriate get and set methods. The object shown
in ’EmployeeDTO’ class will transfer stored informa-
tion from one part of our application to another, and
is therefore called a Data Transfer Object (DTO) or
Value Object. We will create an ’EmployeeService’
class to handle the small amount of business logic we
have.
The main classes used in the Struts framework
are those of org.apache.struts.action.Action. The Ac-
tion classes are the true concrete bridges between the
client’s request and the business layer. Each Action
class will handle one particular type of business op-
eration the client wants to perform. When we sub-
mit our JSP page the Action Servlet and Request-
Processor will find this Action class which we asso-
ciated with the /insertEmployee action in the struts-
config.xml file and the execute method will be called.
Since the /insertEmployee action uses the Employ-
eeForm the InsertEmployeeAction will have this form
bean of type ActionForm, so we first cast this into
type EmployeeForm. Now we want to get the infor-
mation in our EmployeeForm into the EmployeeDTO
so we can pass that off to our Model layer. We created
an instance of EmployeeDTO and then we can use
BeanUtils to transfer the data from EmployeeForm
into the EmployeeDTO. BeanUtils.copyProperties(
employeeDTO, employeeForm ). After copyProper-
ties() the now populated EmployeeDTO is passed off
to the service object and the model layer takes over.
The insertion of data is done by the EmployeeService
class and a collection of Department is returned.
From this illustration we can see that the model is
the logical operator of the system. It performs the ac-
tually desired operations on the data. In this case the
interaction with a database. In comparison to coding
this, our framework would “plug” this model com-
ponent in from a repository of model classes based
on the configurations needed which are specified in
an XML policy configuration file. This would give
a level of abstraction in the model that is not present
using the above methods.
In the above example important information per-
taining to the functionality of the model is essential
information for model selection. Pre-defined classes
are stored in XML format in an XML database. These
files are indexed so as to relate their functionality. For
example, a file would have JDBC drivers and knows
that the transport medium to the controller will be
using JavaBeans and is indexed accordingly. These
files, when selected by the “Controlling Model” in
our Framework, are unmarshalled from XML. Our
framework would plug the model into place. Utiliza-
tion of our framework allows for better re-use of the
A NON PROPRIETARY FRAMEWORK FOR POLICY CONTROLLED MANAGEMENT OF THE MODEL IN THE
MVC DESIGN PARADIGM
453