Ze Framework

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Ze framework is a simple, lightweight, powerful java framework used develop browser based web applications.[1][2][3]

Basic design[edit]

There are basically two event which user can generate while working with any browser based web application.
1. Clicking on a link to see an other web page. (Actually to see some data on that web page)
2. Submitting some form to send data to the server to be processed.
The idea behind this framework is to handle separately and effectively these two events.
Requesting to view a web page is called View event and requesting to submit data to server is called Action event.

Detail Design[edit]

Configuration file[edit]

The framework uses a simple, clearly readable and easily understandable XML file for configuration. The file is based on a XSD which is provided with the distribution of the framework. The framework uses jaxb API to read and parse the XML file along with the XSD.

Carrier classes (Model)[edit]

The framework uses carrier classes to transfer data between controller and view and vice versa.

View event[edit]

The framework provides facility to configure loader class for particular view. The loader classes are used to load data which is to be displayed on web page. The loader loads data into model classes which is configured for this event, now the framework gives control to the view and the view would fetch the model's data and would display on the web page.

Action event[edit]

The framework provides facility to configure handler class for particular action. The handler classes are used to process the submitted data. When the event occurs framework sets the submitted data into configured models for this event. The handler class processes the data of the models and returns a view name. The framework finds the view name from configuration file and generates a View event.

Validation[edit]

The framework provides facility to configure validator classes. Here, two types of validators are available. 1) action validator and 2) view validator. Action validator validates incoming data and populates validation error list which will be displayed on web page later. The validator returns boolean value to decide that weather the next validator would be called or not. View validator validates requesting view that the view is eligible to be displayed or not. The validator returns other view name is current view should not be displayed otherwise null.

Exception handling[edit]

The framework has configurations like global exception handling for all views and actions and specific exception handling for an action or a view. If an exception occurred during data loading or data processing and the exception or its base class is mapped for handling, then the framework calls the registered exception handling class to process something on occurring the exception and after that the framework dispatch to the configured web page for the exception.

Application Properties[edit]

A developer can configure application properties file for the application developed using the framework. That would be a standard java property file. Developer can save it on any accessible file system.

Life cycle handlers[edit]

The framework can have life cycle handler classes. There are tree types of life cycle handlers 1). Initializer 2). Destroyer 3). Request processing handler. When application is initialized the Initializer would be called. When application is going to be destroyed the Destoyer would be called. And, in each request generation the Request processing handler would be called.

Buit-in Custom Tags[edit]

The framework has sufficient set of custom tags. The custom tags would be used on web page to display model data, to set form data into model, to loop, to create html form elements, to create link etc.

Other features[edit]

The models can have properties like any primitive type, any wrapper type, java.lang.String, java.util.Date, any user defined object and array of any of above type. If a model have a user defined object as a property then the user defined object can have any of the above properties without any exceptions. So, we can go to as much depth as we like by defining user defined objects. The custom tags are designed to handle the depth scenario.

The custom tags which reads form and writes to models has facility for configuring date format, number format and time zone. When submission of a form the date value and number value would be as a string. If the property of some model is java.util.Date and/or any primitive/wrapper number type then framework has to convert that string values. So, developer can specify date format and time zone in which the string value should be entered by a user. The same can be done by developer for number type. When the date and number values need to be displayed on web page it should be converted into string from java.util.Date and/or primitive/wrapper number type. For, this purpose also date format, time zone and/or number format specification are needed.

References[edit]

  1. ^ "Ze Framework". sourceforge.net. Retrieved June 8, 2014. 
  2. ^ Panchal, Manan (April 29, 2014). "Ze Framework - A simple and lightweight java framework for web applications". blogspot.com. Retrieved June 8, 2014. 
  3. ^ "Ze Framework - A simple lightweight java web application framework". JavaRanch. May 29, 2014. Retrieved June 8, 2014. 

External links[edit]