To be able to answer that question with confidence, I decided to work on some examples to somehow measure the benefits with regards to development productivity. In my examples I used different metrics such as Number of Steps required to implement, Lines of Code, Cyclomatic Complexity, etc. In this article I present one of the examples I worked on including number of steps required as metrics. Note that this is not a very scientific approach for measuring the benefits, but is a good start and is simple enough to describe in this blog.
The example consists on implementing a common Ajax scenerio for processng input validation. The scenario is implemented using two solutions or approaches: plain JavaScript and the Swan Application Framework. I then compare the amount of steps required to implement each and get the metrics to compare each approach.
Processing Input Validation Scenario
Validate the data entered by the user and provide feedback as soon as possible without waiting for a full page submit. The validation should be executed on the server side.
Solution 1: Plain JavaScript
This solution uses plain JavaScript and pretty much shows what a developer would have to do in order to implement this scenario without the aid of any framework or RIA Generation Tool such as Swan. Figure 1, illustrates the steps required by a developer to implement this scenario.
This implementation requires at least 8 steps, besides designing the page, to handle the input validation:
- Create function to be called when onkeyup event is triggered
- Create XMLHttpRequest
- Make Server side request to process event
- Process validation on the server
- Create XML data to send back as response
- Create callback function
- Parse response XML
- Update DOM
This solution uses Swan Framework and I used the IDE tools to implement it. Figure 2, illustrates the steps required for implementing the same functionality but now using Swan.
This implementation requires at least 3 steps, besides designing the page, to handle the input validation:
- Bind onkeyup event to call server side method
- Process input validation
- Update validation message
Metrics
As mentioned at the begining, I'm using the number of steps required to implement the Ajax Scenario as metrics. So here are the results:
- Plain JavaScript Approach: 8 Steps
- Using Swan Tools and Framework: 3 Steps
- Savings: 62%
Summary
Using a good RIA Framework and application builder like Swan speeds up the development process by reducing the amount of work required to build an Ajax based RIA, saving IT time and money which is very important specially with the Financial times we are leaving today.




