SurfDOM Web Application Framework

What is it?

The SurfDOM Web Application Framework is an Asp.Net application backed by a PostgreSQL database. Asp.Net is Microsoft's technology for delivering dynamic websites using the power of the .Net framework. PostgreSQL is a powerful, enterprise level, relational database system.

How Does it Work?

The Asp.Net application has a single page for all of the normal site content and functions. There are several static html pages that are used when the site is down for maintenance, when an unhandled error occurs, and when no page can be found in the application, but all other requests use this single application page.

The single application aspx page may be a completely empty shell with just an empty head and body tag, or it may have some static content with named div elements that are used as targets for the generated content. How this is initially set up depends on the requirements of your web site. If you have a lot of common content on all pages, it is better to have this content defined in the main application page and just replace the parts of the page that change.

Each page request is redirected to the single application page and the requested page and any query string is mapped to content stored in the database. This content is used to generate html for the various targets on the page and this html is inserted into the targets on the page and the generated page is returned.

Three types of content can be defined in the database:

Static Content

Static content consists of strings of (x)html that are stored in the database and returned verbatim to the page target. It is simple to edit and maintain, but is not dynamic and can only be changed by editing.

Template Content

The String Template language is used to define template content. This provides dynamic content with variables that can be replaced at when the application is running. It allows repeating content like lists and tables to be generated, as well as content that needs to change depending on the current state of the application - like menus, user specific data, etc.

The source for the variables used in the template may be:

  • Queries against the database
  • Application state variables like the current user details
  • The results of function calls
The source of this data is defined in an Xml document which is also stored in the database as part of the content.

Simple editing of the structure of the html in the template is possible, although it is often the underlying data that is changed rather than the way it is displayed. For example the source of the data could be a query against the catalogue tables to display catalogue items and new catalogue items may be added or existing ones updated.

Object Content

Object content consists of a view defined using Xml and a content source Xml document similar to the one used by template content items. The view usually defines a form or editor for collecting or changing data, while the source defines the tables or objects that will process this data, for example to send an email, make an order or update the catalogue.

Catalogue Content

The application database also has separate tables for storing the catalogue data. There is a catalogue group table, for grouping together related catalogue items and a catalogue item table where the details of the catalogue items are stored. Each catalogue item may have an image file associated with it and may have static html content associated with it, describing the item. The catalogue items can also have prices linked to them and may be linked to each other.

The catalogue table structure can also be used for other things not related to the catalogue. It is useful whenever you need to display information about groups of related items. For example it could be used to display staff details with a photo of each staff member, news articles, and many other things.

It is also possible to associate attributes of various sorts to catalogue items. Imagine you have an item in your catalogue that is available in different sizes that do not affect the price of the item. You can attach a list of sizes to the item that can be used to populate a selection list for the user making the order. Multiple attributes may be added, for example size and colour. This means you only need to maintain a single item and price, rather than multiple different catalogue items for the same thing.

Read More About the Benefits this Application Can Provide For You


Contact Us to find out more or to get a quotation for your site.