|
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
General Java An Airline Ticket Store Using Java and ColdFusion
An Airline Ticket Store Using Java and ColdFusion
By: Ajit Sagar
Jun. 1, 1999 12:00 AM
Due to the plethora of alternative technologies available in the computing arena today, designing an enterprise application involves choosing between technologies based on feasibility, applicability, cost, availability and several other factors. No solution is "the right one." The hard part is to figure out which technology to use to provide a particular functionality. The challenge is to take competing and complementary technologies and make them play nicely together. This is the first in a series of articles on some of the prominent technologies available to build a simple Internet-based Ticket Store application. This application offers online purchase of airline tickets as well as goods sold in airports. Our discussion is focused on two popular technologies: Java platform components (Java Applets and Servlets, RMI and JDBC) and Allaire Corporation's ColdFusion application server. The modules implemented using Java technologies will be presented here and in three subsequent issues of Java Developer's Journal. The modules implemented using ColdFusion will be discussed in Volume 1, issues 46, of ColdFusion Developer's Journal. One objective of this design is to illustrate how Java Servlets can be used as access mechanisms in server modules that serve up data to front-end storefront modules implemented in ColdFusion. A simple protocol for exchanging name-value parameters between a Java Servlet running in the middle tier and a ColdFusion engine running in a front-end tier will be used for this purpose. I'm assuming that readers are familiar with the Java technologies mentioned earlier. Knowledge of ColdFusion is not assumed for the JDJ articles. This article will concentrate on the modules that constitute the application, the technologies used to build the store and the "protocol" for sending data back and forth between the Java components and the ColdFusion templates. Please note that this is not a real-world application, but one I put together to demonstrate how components and services implemented in an application server (like ColdFusion) and the Java platform may be used to build a distributed e-commerce application. This application will evolve over the next few months. Readers are encouraged to provide feedback if they'd like to take part in defining the scope and design of this application.
The Online Ticket Store The software components that make up the Online Ticket Store, their functions and the technologies used for their implementation are illustrated in Table 1. Only the modules used for ticket transactions are listed. The modules used for building the virtual store will be discussed in a future article. We're not too concerned about the airline's back offices. Our focus on the back office will be limited to the access mechanisms used for the services offered by the back office. For example, how an airline prices and reserves tickets is beyond the scope of this article. However, the format in which a back office accepts a reservation request and the format of the response will be defined here and in subsequent articles. The transport mechanism (RMI/CORBA/other) will also be discussed and implemented, although security issues involved in transporting the data will not.
The application modules are illustrated in Figure 1.Application Framework
Java Servlets and ColdFusion Before describing the access mechanism, I'll elucidate why specific modules are implemented in ColdFusion while others are implemented using different Java technologies. ColdFusion is an application server whose most important feature is its ability to connect to data created and maintained in other applications. It allows the building of dynamic queries on the fly to retrieve data from such applications. It achieves this through the use of a very flexible tag-based markup language. This makes it an ideal tool for creating dynamic Web application components such as shopping carts, account management modules, purchasing modules, customer profiles, etc. Servlets, on the other hand, excel at making server-side services available to the client in a dynamic and interactive fashion. Servlets can be used to efficiently access a variety of services offered across different tiers of a distributed architecture. Servlets basically serve HTML to the client. They also bring access control and enhanced security into the equation. They are closely tied to the Web server they run in and thus help extend the server's capabilities to the client. One thing they're NOT designed for is building sophisticated GUIs. They are primarily "HTML servers."
Typically, ColdFusion-based applications and Java Servlets can be used in conjunction if the division of functionality leverages these strengths. In our application, all data pertaining to the customer should reside in the ColdFusion components and be presented to the customer in a snazzy and sophisticated user interface. However, when back-office services like ticket price/availability quotes need to be dynamically accessed (e.g., for submitting a request for a ticket quote), Java Servlets provide an ideal access mechanism to these services. The Merchant Server tier uses the Service Access tier: This is based on the premise that the airline back-office services are publicly published as RMI/CORBA services. The Service Access tier dynamically queries the various airlines for the ticket price/availability and returns a quote based on some predetermined selection rules. The Service Access tier also maintains a database that captures each interaction with the Application Service tier. This database can be used for statistical analysis in the future, after the data has been accumulated over a period of time. The data would be valuable to the airline agencies. For example, if most customers have been rejecting an airline's quotes because the price is too high, the carrier would probably want to be aware of this fact.
Implementation
Before we define the protocol for communication between the Merchant Server and the Service Access tiers, let's examine the information we'd like to pass between the two. A typical end-to-end transaction in this system would have the following steps. Please note that for this transaction we're not making use of the Customer Profile Manager, Travel Profile Manager, Shopping Cart and other components that are a part of the application implemented in ColdFusion: Here, we'll just look at the classes that will implement this scenario.
The logic in these example classes is hard-coded. The actual implementation will be developed in subsequent articles. The classes used for the basic scenario are: The flight quote requested from the client is simple and doesn't contain all the fields necessary to process the actual flight request that will be used in our application. In fact, the TicketQuote only contains a single field, which is the price for the flight. The refined classes for the application will be discussed in the next part of this article series.
Environment Reader Feedback: Page 1 of 1
Latest Cloud Developer Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week
Breaking Cloud Computing News
|
|||||||||||||||||||||||||||||||||||||||||||||||||