| Sign In/My Account | View Cart |
Reshaping IT Project Delivery Through Extreme Prototyping
Pages: 1, 2, 3, 4
If you examine closely the dynamic prototype that is being suggested here you will see that it is advantageous to represent an HTML page as a Page object in memory. This Page object parallels the physical HTML page: it will have data on it, it will have actions on it, etc. Consider the following code:
public class MyWebPage
{
//Concentrate your data in one place
MyWebPageData;
//ui controls
uiControl1;
...
//Population etc
onload(){}
postback(){}
//Actions on the page
action1(){}
...
}
public class MyWebPageData
{
//data only
field1;
list1;
object1;
...
}
All the data on a web page is encapsulated into a page object. This approach has the following benefits:
Consider the following architecture in Figure 2, where an action on a web page is directly accessing the DAO objects and manipulating them for a certain business purpose.

Figure 2. Actions directly using DAOs
In this scenario, the Action class is responsible for two things. On one side, it interacts with the UI of which it is part of. On the other side, it interacts with business logic. There is a distinct advantage in separating these two concerns. If the action class can postpone the business concern through a stub or a service, then the UI can be built independently of the business service. This will allow division of labor and hence quick deliverables by throwing more people at it.
With this thought in mind, let me re-architect Figure 2 into Figure 3:

Figure 3. Actions using services
The key features of this design are:
This can be further enhanced by introducing a static wrapper for the services, as in Figure 4:

Figure 4. Actions using services via a static wrapper
IServiceInterface will define services. There may be a couple of these interfaces in the whole project.The key concept in dynamic prototyping is to build the system (as much as possible) as if there is a services layer implementation from the start fulfilling the contract. Initially, the implementation is going to be using some mechanism to simulate the contract. The static wrapper or an equivalent scheme can nicely package the interfaces into some sort of a distributor, where multiple implementations can co-exist. The article Server-Side Typed Event Distributors further explores these ideas and points to an architecture where each method of an interface can be gradually refined for a final implementation. Under this architecture, the static wrapper will look more like Figure 5:

Figure 5. Design of static distributor of services
The finer points of this architecture are: