Home / Articles / Adobe ColdFusion / Developing a ColdFusion/J2EE Solution

Developing a ColdFusion/J2EE Solution

Chapter Description

This article kicks off in the midst of fictional Sonic Systems' web project. It shows how the aim in creating a project blueprint was to eliminate the possibility for changes in the architecture during development, and to help development go as smoothly as possible.


In beginning development, the first step was to determine the overall architecture, including the folder structure, component usage, and styles to use. The largest part of this was for

Victor to determine what component and application elements would be used for what part of the application. This would determine how modular the application would be, and who would develop what and in what order.

Component and Application Elements

ColdFusion MX brings a number of new possibilities to the design of this application. It had always been Project Omega's practice to develop applications that were as modular as possible. This allowed for easy changes in the future as needs changed and new ideas arose. One of the challenges was to determine where to use what types of modular components. Victor could now choose from Enterprise JavaBeans, regular JavaBeans, Cold-Fusion components (CFCs), custom tags, or included files. That doesn't even include non-J2EE (such as COM objects) and ColdFusion possibilities. But even before he determined what technology to use, he needed to determine how to break up the application.

Victor decided that he would have low-level components for accessing basic information, such as XML registries. Above that, he would use custom tags to perform tasks that should be modular but at the same time accessed SESSION or APPLICATION variables. In general, these custom tags wouldn't contain too much layout; anything that had more than a modicum of user interface included should be developed as an included file.

At this point, Victor's objective wasn't to decide exactly what components, custom tags, etc. the team would need to create, but rather to determine what types of information would need to be done using what types of elements. Here is what he concluded:


User information component(s) will need to return information about a user but not set it to SESSION scope or otherwise interact with the application.

User PSML component(s) would be responsible for reading a user's PSML file and returning relevant information, as well as writing and saving any changes to the appropriate XML files.

Registry component(s) would be responsible for retrieving information stored in the PSML registries.

Custom Tags

Authentication. This will allow for "locking down" secure information.

Session storage. Custom tags will be needed to write user information to session. This will include the design information highlighted by Ernie as well as other information that the user will need to access.

Portlet generation. The actual generation of portlets would probably best be done using custom tags.

Included Files

Static page drawing. Any templates that will participate in drawing the page but not contain substantial dynamic information. This section would include headers/footers and style sheets, as Ernie suggested.

Dynamic page drawing. Other templates will need to be created in order to "draw" a page dynamically for the user. This can include laying out the numerous portlets on a page or drawing any dynamic navigation elements that may be included in this application.


The portal application itself will allow a new component type, the port-let. This will be used for providing the add/edit/delete interfaces.

After determining all this, Victor had Rhonda send a memo to the development team outlining the details of what needed to be created and what the directory structure would be.

Application architecture for Sonic Systems portal

Date: June 3

To: Project Omega Development Team

From: Rhonda

Subject: Application architecture for Sonic Systems portal

We're off! It's time to begin development on the Sonic portal project. You should all have a copy of the blueprint. This memo will define how things will be done and who should do them. If you have any questions about functionality, contact Victor; about design, contact Ernie. I can field any other questions, or even serve as intermediary for design and functionality programs—just let me know what you need.

The following directories and templates will be used for the portal application (where Y is the Web root directory):


The root directory of the application. This will contain the Application.cfm and the index.cfm templates—the controller pages of this application.


This directory will contain the components of the application.


This directory will contain the style sheets of the portal. Default.css will be the default.


This directory will contain all images—subdirectories can be created, if necessary.


This protected directory will contain the database and XML registries.


This protected directory will contain dynamic templates that are included, such as the log-in and the administrative menu template.


This protected directory will contain portlets—subdirectories can contain whole portlet applications.


This protected directory will contain users' PSML files, in the appropriate subdirectory.

This protected directory will contain design information, such as includes, in the appropriate subdirectories.


This protected directory will contain any custom tags for this application.

The following tasks will be done in the following order:

  1. Create CF_PORTLET custom tag for rendering individual portlets, and registry.cfc to read PSML registry entries.

  2. Create demo information for testing, including demo portlets, anon user PSML, and demo registry.

  3. Create component to read user PSML files.

  4. Create writer(s) to set user preferences to SESSION.

  5. Create page-drawing mechanisms—the Controllers.

  6. Attach into full application.

  7. Create Administrator and single-sign-on portlets.

  8. Create "real" portlet registry and user to test.

And so, development began...

7. Portlet Rendering | Next Section Previous Section