The Scimpi Framework
We have spent the last few months creating a new web development framework, which we have called Scimpi - see http://www.scimpi.org. No doubt your immediate thought will be: surely there are too many web frameworks already, why create another one? Well, unlike a project rationalisation I saw today on SourceForge, it was not because I wanted to brush up on my coding. We wrote it because Naked Objects is currently ignoring the biggest development area going; that of web applications. What Naked Objects currently offers is a unique choice of generic user interfaces that give the user complete, yet controlled, access to a complex domain model. What can’t be done with the framework is to create an interface that is more ’scripted’, that guides the user through specific tasks. While the generic user interfaces are ideal for the problem solver working within a complicated domain, they are not optimal for the typical process follower working within a simpler domain, or when working on small isolated task within a larger, more complex, system. For the latter type there tend to fewer options to offer and fewer possibilities to cater for. Therefore, such an interface will tend to be more prescriptive, but obviously there is some overlap between the two categories. While the generic interface involves absolutely no work to make it available, using a conventional web application framework to create a browser based user interface, however, requires an inordinate amount of work by comparison. Typically it would require the writing of controller and bean classes, crafting of JSP pages that access those beans and writing configuration files to tie these things together. Not only that, but there are also things like validation, security and internationalisation to be considered. Doing all this seems too much like hard work, particularly when you can already do everything that the domain model permits through the generic interface that magically appeared when simply exploring the domain model.
To make web application development simple there should only be one file per page, and each page should only detail what is absolutely necessary, keeping them short yet readable. For example, if I want to show an object then I should not need to work through each field laying out labels and content; simple markup that says ’show object x’ should be all that is needed. Hence Scimpi was designed to process HTML pages with additional markup that dynamically generates HTML snippets to include with the static markup. Each dynamic tag interacts with the Naked Objects framework and generates suitable markup to allow tasks like displaying and editing objects, running actions, building tables etc., to quickly build up dynamic web pages. There are controllers within the system and others can be added, but these are specialised devices, rather than a mandatory part of process. Also, as there are no new controllers to be written and the only interactions are defined within the the HMTL markup, there is no need for any configuration files, which just link together those disparate parts. This may seem at odds with the contemporary web application development process, but in reality all you are doing in defining Scimpi pages is detailing how your users will interact with the system, and this is no different than directing a user in exactly how to the use the generic user interface to complete a task.
In creating this framework we specifically chose not to use JSP as the mechanism to create the pages as these allow, and potentially encourage, code to be included. Scimpi pages need no code, they rely solely on the behaviour provided within the domain model. The pages are therefore simply HTML pages with additional markup.
Just to show how simple the process is here are a couple of example pages.
File 1: example1.shtml
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/screen.css"/>
</head>
<body>
<swf:run-action object="service:claims" method="allClaims"/>
<swf:table/>
</body>
</html>
Screen shot 1: a table generated from the results of the allClaims method
File 2: example2.shtml
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/screen.css"/>
</head>
<body>
<swf:run-action object="service:claims" method="findClaims">
<swf:parameter number="1" value="city"/>
</swf:run-action>
<swf:short-form/>
</body>
</html>
Screen shot 2: a form generated from an findClaims action with an included parameter
File 3: example3.shtml
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/screen.css"/>
</head>
<body>
<swf:action-form object="service:claims" method="findClaims"/>
</body>
</html>
Screen shot 3: an entry form for running the same findClaims action, where the parameter is now prompted for
I now have to start looking at other things, but the first release is going to be made available on SourceForge shortly. For the moment the documentation and framework can be downloaded from the Scimpi website. (See http://scimpi.org/downloads/index.shtml for both addresses.)
Comments(2)

