OZONE Web Application Framework

Synopsis

OZONE will be a complete and powerful object-oriented MVC framework for developing advanced web applications in PHP5. It will by default have support for XHTML/CSS, Unicode, page templates, xml-defined form validation, object-based (xml-defined) database interaction, user/group management. The design (webflow) inspired by Apache Jakarta Turbine allows separation of content-generators, view (templating) and controllers. The framework will be ready to use out-of-the-box with a sample application included. The internal design follows Java coding standards and makes extensive use of new PHP5 features. Parts of the project are already developed and being tested but not released in any form yet.
Project Details

OZONE will be a powerfull modern PHP5-based object-oriented MVC application framework. It will have the following features (some are already implemented):

ADVANCED WEBFLOW, TEMPLATES

The main components of the application that are used in processing the user request are:

  • Actions - PHP objects responsible for taking actions, e.g. inserting/modifying data in database, changing user session storage, controlling form processing etc. Actions are not responsible for content generation but can change the Template/Screen e.g. to produce an error message, or put certain data into content-generation context. Within a single Action class several Events (specific sub-actions) are possible to be defined.
  • Screens - PHP objects that generate context for the template. Developer should simply inherit from the base Screen class and implement certain abstract methods and e.g. pull required data from the database and insert into web context.
  • Templates - OZONE Framework uses Smarty as the powerful template engine. Prepared context is passed to templates and the output is generated. Templates are not involved in any request-processing but solely responsible for visual presentation of data. Templates are divided into several categories:
    • Layouts - define general XHTML page layout defining the structure of the page (i.e. navigation elements and the 'screen placeholder' for the main content)
    • Screen Templates - templates for the main content, specific for each of different pages requested
    • Navigations - elements used as navigation elements, menu elements - without accompanying context-generation classes, static elements
    • Modules - just like Navigation elements but with corresponding context-generation classes (e.g. poll boxes)
screen_view.png

Figure 1. Example page layout on the screen.

Each http request can define Action/Event that will be called before Screen is rendered. Each regular request specifies the template of the main content. Based on this template specific Layout is used which is populated with required elements such as Navigations, Modules and the main content. Any of the elements: Action, Screen, Screen Template can request to change Layout, used CSS, JS or other rendering parameters.

activity_diagram.png

Figure 2. Main content-generation (Screens) and action (Actions) classes.

Apart from those - SecureActions, SecureScreens (elements requiring user authorisation that the developer should inherit from), macros (with my own Smarty extension), template services (as e.g. LinkService creating web links inside application, PageService defining CSS styles or JavaScript scripts used, meta tags and some other HTML page properties), and others are available.

Webflow is based on the Apache Jakarta Turbine framework concept. It is however a compromise between performance and configurability - most of the solutions used are hard-coded but provide maximum freedom within them. The non-questionable benefit is that OZONE will work out-of-the-box and will be ready to develop web applications after easy configuration.

activity_diagram.png

Figure 3. General (simplified) diagram of the webflow.

With the design presented the controllers, content-generators and views are absolutely separated providing a good design for development teams.

XHTML/CSS DEFAULT SUPPORT

Provided templates will fully conform to W3C standards.

CACHING

Caching will be implemented to increase performance. The caching mechanism will be flexible enough to provide caching for separate screen components as well as whole (rendered) screens.

INTERNATIONALIZATION

Each of the messages defined can have multiple language versions. Template block functions also will allow to define (inline) content valid for the language chosen. Unicode is natively supported in PHP5. This will allow to create international websites without any extra design issues.

ABSTRACT DATABASE OBJECT MODEL

The use of database requires the developer to define database (tables, columns) via simple xml configuration files. After processing - SQL commands are generated to create or alter existing database structure and PHP classes are generated to interact with the database. An basic example use of such classes is:

$book = new DBBook(); // creates new database book object
$book->setTitle("PHP Application Development"); // set one of the properties
$book->save(); // save object = inserts row into database

Objects can be also pulled from the database. One can also predefine often used queries. More advanced features like: foreign keys, primary keys management will be available. At least one of MySQL and PostgreSQL will be supported out-of-the-box with planned support for both (+ perhaps SQLite and Oracle, but not a priority). The design is inspired by Apache Jakarta Torque tool which results in very similar structure of configuration files and API of classes generated.

FORM TOOL

One can define forms via xml configuration files - their rendering properties (depending on specific form template macros), help messages, error massages, labels and validation rules. User-defined validation rules are also supported.

USER/GROUP MANAGEMENT/PERMISSION SYSTEM

Nested groups that can have multiple permissions assigned will be supported. User registration/login/logout and session management will be supported out-of-the-box. Also user session storage (via object serialization) is supported.

The above features overview is not complete but covers main advantages of the OZONE framework. OZONE should be able to be used as a core-logic for almost any web application/website. In some future other components such as WebServices or RAD-like tools will likely be created.

LICENSE

The OZONE Framework will be available under a GNU Lesser General Public License (LGPL) which will make it suitable for both free software developers and commercial applications.

CODING STANDARDS AND OBJECT MODEL

OZONE uses object oriented design and Java coding standards. It uses most of the new features of PHP5 such as class autoloading, SimpleXML, new Object design (much closer to Java) and does not inherit any of the "old" PHP4 patterns where new approach is available. It is a great benefit since most of already present frameworks were designed for use with PHP4 or older.

OZONE will provide PHP web developers with unique tools such as abstract OO database layer and advanced templating (based on Smarty). On the other hand it will be core-only framework but allow creating additional components easily . The main benefit of OZONE will be design - fully object oriented - power and flexibility. Its design is inspired by the great Apache Jakarta tools that set standards in the web development world.

In terms of design and functionality OZONE is (will be) also similar to Prado but extensively uses Smarty templates instead of xml-based view components. It should also have shorter learning time.
sites powered by ozone

IN THE PRODUCTION

So far we are using OZONE in two production environments. So far it works great - all features mentioned above work 24/7. One site is an open community-driven photography gallery with over 50k page views per day. The link is http://www.fotoforum.pl. The site is in Polish but an international version should be ready soon.

The other project is wikidot.com - large wiki farm. For this project OZONE has undergone radical design changes and now mainly uses AJAX for data exchange. This makes the above description "a bit" out of date. ;-)
Look at http://www.wikidot.com to see the most current version of OZONE in action.

BTW: This page is also hosted by wikidot.com ;-)

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.