Designing Cocoon Applications
The previous chapters discussed how Cocoon provides a complete XML platform for building applications. We looked at how solutions developed with Cocoon can meet the challenges facing today's modern application architectures. We also presented some examples for small applications and built a personalized news portal using Cocoon concepts and technologies.
Cocoon is not a platform specifically aimed at only one application area, such as a portal. Cocoon can be used to build a variety of applications and solutions. Because we have been using Cocoon as a base for the paid work we do, we have built web sites and portals and have also used Cocoon to build front ends for databases, XML processing systems, and integration systems for different hosting environments, such as those used for Application Service Providing (ASP).
It is our experience that learning to use Cocoon to build these types of applications takes time, because the philosophy behind the solution is different from the way Internet applications are commonly built, using scripting languages such as ASP and JSP or dedicated software solutions built using servlets or other components.
We have included this chapter to provide additional background information and tips that we hope will help you if you want to develop a more advanced Cocoon application, such as an Internet portal. A lot of this information will not be completely new if you have read through the book. However, we have often heard people say, "There is so much in Cocoon. What do I actually need if I want to build a certain type of application?" The aim of this chapter is to provide this information in a different context so that you can then go back to where we originally explained it for the full details.
Before getting into the different types of applications you can build with Cocoon, we will start with some general points that are important when designing any type of software solution. Although this might seem to be a long list of things to think about, remember that you will probably only need to look at individual points when you start building real applications, such as a new Internet portal for a major client. That being said, it is always a good idea to start with a concept of what you will do.
The Application Concept
Few people can cook exotic meals without a recipe. The recipe gives you an idea of what the result will look like, what ingredients you need, and how you should prepare the dish. Using a recipe as a concept for your meal is common sense.
When you build an application with Cocoon, a concept that includes the points discussed in the following sections helps you plan your solution and prevents you from making some of the more common mistakes. The following sections define the system functionality, the application architecture, and aspects such as performance and presentation design.
While thinking about these points, you can also try to work out which of the described Cocoon technologies will be important for what you want to do and whether you perhaps need to write additional components. We will also provide some guidance for the times when, even after you've done all this, things still don't work as you expected. We will start with probably the most common question asked of any application: "What's it supposed to do?"