History - silverorange/swat GitHub Wiki

As a company, silverorange is experienced in developing web applications. These applications include (not exclusively) corporate intranet software, web commerce platforms, weblogs and web based photo galleries.

The S-Series

Initially silverorange programmed in ColdFusion. silverorange developed a web application toolkit for ColdFusion called the S-Series. Unfortunately, ColdFusion as a language is not well suited to developing large scale applications. To achieve the functionality of Swat in ColdFusion would be an arduous task. Additionally, ColdFusion requires the Windows platform and many firms will not, or would rather not work with Windows servers for web applications.

The PSeries

Around the time PHP4 was released to the world, silverorange switched development from ColdFusion to PHP. A new toolkit called the PSeries was developed. It borrowed heavily from the S-Series but being written in PHP, the toolkit was more flexible. The PSeries is a set of classes of data-bound controls and widgets.

The PSeries is a good development platform but it is not by any means excellent. PSeries classes do enable rapid application development and rapid prototyping, but there are several PSeries design decisions that make it a difficult toolkit to work with.

The largest problem with PSeries code is tight coupling with the database. PSeries widgets were designed to co-exist with a relational database from the beginning. Widgets and controls in PSeries code are tied directly to database fields. This makes it easy to develop straightforward applications where all the controls represent database fields, but makes it difficult to write code where the database is not used at all, or where custom behavior is desired. Abstraction of the PSeries database layer was added only after the PSeries had been developed.

Another design flaw in the PSeries is the amount of code duplication. Because of its data-bound nature, a completely separate set of widgets is needed for search widgets. Essentially, all the display and validation code for data editing controls is duplicated in the search controls. Code duplication among widgets means fixing a bug in or adding a feature to one set of widgets doesn't automatically fix or enhance the other set of widgets.

A further problem with the design of PSeries code is the lack of a standard coding style. Method names and variable names in the PSeries do not follow a consistent naming scheme; they change based on who wrote the particular piece of code. Developing with the PSeries requires knowing a large variety of non-standard and poorly documented behavior. These behaviors are difficult to remember and result in a steep learning-curve for the PSeries.

Finally, the PSeries was written when PHP4 was a new technology. PHP4 does not allow for basic object oriented concepts such as method scope, interfaces and proper constructor/destructor mechanisms. Consequently, in the PSeries there are several classes that should be defined with interfaces, and several methods within classes that should be private.

Enter Swat

PHP5 supports more powerful object oriented mechanisms than PHP4. With PHP5's release, silverorange decided it was time to create a new, properly designed web toolkit. This toolkit is Swat, and it aims to fix the shortcomings of the PSeries.

Swat is one part of a web application framework consisting of three layers:

  1. a web-based widget renderer and rudimentary form processor (Swat)
  2. a database abstraction layer (MDB2)
  3. a set of application specific data objects to linking user interfaces to the database.

To create a new web application in this framework, the largest task is writing new application specific data objects; however, data objects are easily reused throughout the application. This framework allows web application developers to write less code, and to write simpler code. Furthermore, the application developed in this framework may run on almost any database compliments of MDB2 package.

The design of this framework allows one or more of the three layers to be replaced. For example, If an application cannot use MDB2 for some reason, a custom XML storage layer could be swapped in place of MDB2 and the widget rendering and processing layer would not need to be rewritten. The ability to change the database layer without changing the rendering layer makes Swat adaptable to future technology. In other words, Swat's lifespan is not dependent on other technologies.