November 2007

Created 30th November, 2007 03:31 (UTC), last edited 30th November, 2007 05:06 (UTC)

Next month I'm formally taking over the maintenance of a web application written in VB.NET. Visual Basic isn't my favourite development language, but it has been interesting to look much more closely at how ASP.NET handles things and what is the same and what is different with FOST.3™.

ASP.NET separates content from actions through a complex interaction of different files. At the front end is an .aspx file which contains markup, including special markup that can be referenced by the code that sits behind in a .aspx.vb file (for deployment all of the code gets compiled into a DLL so only the .aspx files are deployed to the server).

For example, an .aspx that does a post code lookup might include the following that needs to be filled in depending on the result of the query:

<asp:Label id="LBLdeliverypostcodemessage" runat="server"></asp:Label>

Behind this in the .aspx.vb is some code that can fill this text in:

If objInterimResults.IsError Then
    LBLdeliverypostcodemessage.Text = objInterimResults.ErrorMessage
Else
    LBLdeliverypostcodemessage.Text = “Click on the address that most closely matches yours”
End If

FOST.3™ also uses special markup but it aims to allow everything to be done as declaratively as possible. All of the basic CRUD operations can be accomplished without writing any code. For example, the form that I'm using to write this entry is just the default form generated by the framework.

The markup for the top part of this page is the following:

=<FOST:contextField field="Context!FSLib::Content::Page.displayName" />=

<div class="Page-Details">Created <FOST:contextField field="Context!FSLib::Content::Page.created" />,
  last edited <FOST:contextField field="Context!FSLib::Content::Page.lastUpdate" /></div>

The markup is a mixture of Mediawiki style markup together with XML like extensions. The markup can call C++ functions directly and can embed Mahlee™ Javascript for execution on the server.

ASP.NET handles a lot of the tricky HTTP interactions that are needed so that the code style is much closer to that of desktop applications rather than traditional web applications. FOST.3™ hides HTTP in a different way — by making as much of the site building as possible totally declarative. For example, the search form retains its search term not because there is any code to do that, but because the default behaviour of any input item is to remember what was entered.

In order to do this FOST.3™ imposes its object model on you. The trade off seems fair to me because you get so much for very little. As well as having the framework automatically generate a usable create and modify forms and object browsers you also get a huge library of pre-built components ranging from the content system to business libraries for things like billing and accounting. FOST.3™ works very hard to make it as simple as possible to share functionality and to let you use its object libraries.

When you do need more control over what is happening then FOST.3™ exposes the full object model via COM which makes it very easy to use via classic ASP. The next step is to expose the same object model via a .NET assembly so that it plays nicely with ASP.NET too.