|
Helping ordinary people create extraordinary websites! |
Use Continuations to Develop Complex Web ApplicationsBy Abhijit Belapurkar2005-04-22
User-Centered Navigation From the outside, the continuations-based approach cannot be differentiated from an MVC architecture. The user is free to go back to any previously submitted Web page, change any data required, and resubmit the form via the browser. The difference is on the inside, in the amount of code-juggling required to get the navigation to work correctly. The continuations-based approach requires no additional effort for this, because a continuation id is always associated with each submitted page. The server just has to look up the correct continuation for a given submitted page and ask it to resume. Further suppose that the user is viewing a page. In terms of the so-called tree of continuations, this page is "marked" by a certain "continuation node." If the user hits the Back button once to return the page submitted previously, the marker in the continuations tree is moved up one level and set to point to the parent node of this node. This walk up the continuations tree happens each time the user hits Back. Now suppose the user stops on a certain page, re-enters data, which may or may not be the same as the data previously entered on this page, and resubmits the form. This causes the marker in the continuations tree to move down one level to point to a child node. However, because the application logic may have decided to show a different page based on the newly submitted data, the child node may actually be a sibling of the node that the marker was pointing to during the upward walk. Continuing in the same vein, the path back down the tree will lead to a different set or the same set of continuations being encountered, depending on the data submitted by the user. Tutorial Pages: » A Programming Paradigm to Simplify MVC for the Web » What is a Continuation, Anyway? » Problems in Conventional Web development » The Case for Continuations » User-Centered Navigation » You Make the Rules! » The Continuations Repository » An Example Application » Web Continuations in Apache Cocoon » The Application Sitemap » The Application Logic » Understanding the Application Logic » Resuming the Continuation » JavaScript vs. the Java language » Continuations in Java code » Pros and Cons of Continuations » Conclusion » Resources First published by IBM DeveloperWorks |
|