Development Values of ColdFusion MX on J2EE
We have already discussed some of the benefits of deploying ColdFusion MX 7 on J2EE. Developers also gain from using ColdFusion when deployed on top J2EE. ColdFusion MX7 gives developers new tools to rapidly develop Java-based applications and to extend enterprise systems with new functionality at a fraction of the cost in time and resources when compared to straight Java development.
Deploying Rich Internet Applications in Java
ColdFusion MX 7 comes with many beneficial application services, including Flash Remoting, charting and graphing, and full-text searching. These services are integrated into the ColdFusion MX scripting environment and can offer feature-rich interfaces with little effort for the developer. For example, you can leverage e-commerce applications by using Flash animation to display highly visual productssomething that is difficult to do with Java alone. Or provide graphical components to portal interfaces for displaying analytical data in charts and graphs. Content-management systems can be extended with full-text searching capabilities, and management of these systems can be done with ColdFusion's advanced file-scripting techniques. With ColdFusion MX 7, rich user interfaces can be built that integrate with back-end components, thereby extending and enhancing the Java application layer.
Extending the Platform
Today's businesses need to interact with their partners both internally and externally at "Internet speed." These demands cannot always be accomplished using existing tools in the allotted time. Many Java application servers come with prebuilt components for implementing the following:
- E-commerce
- User profiling and user experience management
- Business and application integration
- Strong cryptography and public-key integration and security
- Web Services
- Portals
- Content management
- Business process management
- Customer relationship management
- Order processing and billing
- Legacy system integration
Chapter 31, "Working with Gateways," to pass this information to the order processing system via the Java Messaging Service (JMS). The message could kick off a request to your order-processing system to complete order processing in the supply chain. JMS can implement a publish/subscribe architecture where orders are published. Message subscribers pick up the orders for further processing.A BPM layer could be implemented to provide management for processing orders through the enterprise. The BPM layer could offer visibility of these orders to administrators and management, to ensure that the orders are processed correctly and efficiently. BPM enforces business rules and helps to make certain that data in the enterprise retains its integrity.Business portals provide users with a one-stop shop for managing information in the enterprise. ColdFusion, with its many GUI features and services, can play a major role in portal application development. Use ColdFusion to build new Web services to expose business processes to a corporate portal, and to help monitor business health. These portal elements can be very dynamic using ColdFusion capabilities such as charts and graphs. ColdFusion can also call existing application components, pulling and displaying important business information into intuitive user interfaces.
Ease of Development
Developing applications for J2EE with ColdFusion gives you the power, scalability, and reliability of J2EE, without the complexity. ColdFusion can reuse Java application components, and it simplifies integration through ColdFusion's scripting language. Why reinvent the wheel when you can extend it instead?The interoperability of ColdFusion, along with its powerful features, helps developers to build ColdFusion applications using prebuilt components. Also, Macromedia has added capabilities for ColdFusion developers to build their own Java components. Other Java application servers can use ColdFusion MX 7's enhanced and much more interoperable Web services. ColdFusion pages can be called by JSP pages, and vice versa. This eases development of J2EE-based applications with ColdFusion MX's available services.
Leveraging Diverse Developer Skill Sets
Developers are like economists. Place 50 developers in a room and ask them to provide a solution for a relatively simple business problem, and you will more than likely receive 50 different responses. The good news is that having 50 options to choose from allows you to choose the best, most long-term solution for solving the problem.This is true of ColdFusion as well. Over time, every developer will migrate to using a tool set that makes him or her more efficient and more flexible in developing solutions. This increases morale and employee longevity and, ultimately, productivity. If your business has decided to support J2EE technology, many of your developersespeciall238 and user interface designersmay feel slighted and will become less productive due to the huge learning curve with Java. Placing ColdFusion in their hands will help to eliminate this anxiety and allow for flexible, powerful development. Using ColdFusion in your J2EE architecture creates a larger tool set for your enterprise, increasing the potential for more viable solutions, both economically and timewise.
Using J2EE Built-In Security Features
J2EE application servers offer security features that are not inherently available in ColdFusion. These features provide enhanced capabilities to secure the entire Web architecture in a clustered environment. J2EE application servers can maintain security on many layers in the architecture.IBM's WebSphere Application Server, for example, implements security at very granular levels utilizing existing LDAP-enabled directories, third-party authentication methods, and other services across the cluster. Security can be invoked for specific EJB methods or for specific Web site applications. This architecture allows centralized management and is efficient. All applications on the server can have security attached and deployed, thus providing a tighter, more closely controlled environment. This architecture helps strengthen security across the enterprise by enforcing controls at virtually every layer within the application.
Improving Web Site Scalability
Many methods are available for improving Web site scalability. Some of these methods, such as tiered infrastructure, may not necessarily involve deploying on J2EE, but can be implemented through careful planning with any Web site. This section concentrates on improving Web site scalability when deploying on J2EE.
Tiered Infrastructure
Traditional ColdFusion applications consisted of many pages o219 and code that performed many functions, including user interface, application logic, and database queries. The ColdFusion Web pages would typically perform two of these functionsuser interface and application logic. Al225 and ColdFusion Markup Language (CFML) code was placed into ColdFusion Web pages and displayed to the user. Application logic was also handled by CFML code, and all calls to the database server were initiated using the <CFQUERY> tag. ColdFusion Web pages would essentially handle all interaction between the user and the database. Figure 4.2 illustrates traditional two-tiered, page-based Web architecture.
Figure 4.2. Traditional two-tiered page-based Web architecture.

Figure 4.3. Multi-tiered J2EE Architecture with ColdFusion.
[View full size image]

Native Load Balancing and Failover
Macromedia JRun, Sun ONE Application Server (formally iPlanet), BEA WebLogic, and IBM WebSphere Application Server all offer native load-balancing support with their products. Load balancing can be performed at the Web server tier, the application server tier, or a combination of these tiers. Web server plug-ins and application server services control load balancing and failover. Choosing between load-balancing methods provides greater flexibility when designing for scalability. These J2EE application servers all have functions for creating redundancy on many levels within the Web site architecture, including components, systems, and for external network connectivity.Macromedia JRun offers native loading balancing and failover capabilities through the Jini service. Jini is a J2EE networking service that lets Java applications communicate easily with disparate distributed devices and objects. JRun clusters can be created and managed through the JRun Management Console (JMC). J2EE Connectors are installed on the Web server to connect natively to the application server. These connectors can help maintain session state.A combination of Web-server and application load balancing can be utilized to provide further application partitioning and stability. Application servers provide services for connection pooling, Java Virtual Machine (JVM) pooling, object-level load balancing, and automated deployment.JVM pooling is the process of creating multiple copies of an application server, components, JSPs, or servlets (sometimes called cloning). These clones can be run on the same physical machine or on several machines. JRun offers this option through the JMC to create any number of JRun instances. Using Jini, JRun services are clusterable ; therefore, ColdFusion running on JRun is clusterable as well. Connection pooling is the process of maintaining relational database connections. Maintaining these connections increases the availability of database services.Web server plug-ins or server applications can provide load balancing by monitoring workloads sending traffic to least-worked servers. This can be implemented by component, server, or a round robin configuration. EJB components can be clustered across nodes within a single server or across