Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

Use Continuations to Develop Complex Web Applications

By Abhijit Belapurkar
2005-04-22


JavaScript vs. the Java language

This brings me to the end of the continuations-based sample application developed in JavaScript. It is also possible to develop the same application with an alternative Cocoon flow interpreter that works with pure Java language, allowing you to write the entire application logic as a single Java program. I'll show you how the Java interpreter works in a moment, but first I'd like to consider the arguments for and against writing the program in Java language.

The most common argument against using JavaScript in place of the Java language is that the latter is a more widely known and used language with extensive IDE support, an extensive catalog of design patterns and so on. In support of JavaScript, it is dynamically typed and makes rapid prototyping (in the form of quicker write/update-deploy-test cycles) possible. As a language, it is already known to a large number of Java developers from its usage on the client browser side and is very easy to pick up in any case. JavaScript is an object-oriented language, and the Rhino implementation has very good integration with the Java platform. It is possible to access and reuse any Java class or object that exists in the application. Therefore, even with the core flow implemented in JavaScript, it is possible to implement the actual business logic in the Java language (with the classes being accessed from within the JavaScript flow at the appropriate places).

In short, no one option is very obviously better than the other, and it is entirely to your personal preference to decide which of the two languages you should be using to develop your continuations-based applications. And fortunately, Cocoon lets you choose either option.

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


 | Bookmark
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT