Section 16.1. Application Overview

   

16.1 Application Overview

Our example will be a complete store, by which I mean it has a catalog with categories and subcategories of products. Products in this store can have options associated with them. For instance, a clothing item could have size and color , while a computer can have hard drive size and RAM. This is a feature that is often required by real e-commerce sites, but it is rarely demonstrated. The relational database handles the work in join tables for defining option sets, each of which have a number of options. There is some extra work required in the checkout and order retrieval process to handle the options facet of the application.

An ArrayList stores the items in a user's cart in the session object. The checkout process includes forms for billing and shipping. The shipping form prepopulates with the information passed from the billing form, because they are often the same. Then the user is shown everything in his or her cart and the shipping and billing info , and he or she provides credit card information. The complete order is sent to the database. It is then retrieved by the merchant using a JSP that you can put in a password-protected administration area.

The application runs off of Tomcat 4 and uses a MySQL 3.2 database, but it could be easily ported to other platforms.

I am grateful for the work of Vic Miller ”he contributed in myriad ways to this application.

16.1.1 ColdFusion Modeling

Because it can be tedious writing a database application of much complexity in Java, it is not a bad idea to demo the application in ColdFusion before writing it in Java. This has a couple of benefits. First, it means you can ensure that your database works, and it allows you to tweak it easily. Then you can start getting data out of the database from your ColdFusion templates. Then, once you've got everything just as you like it, you can still use a good portion of the SQL queries you've written. This process assumes somewhat that you are on a small team and have a lot of the responsibility for putting up the app. If you have a different person to design the database, write the queries, do the JSP, and write the Java classes, then performing a demo before writing probably is of little benefit.


   
Top


Java for ColdFusion Developers
Java for ColdFusion Developers
ISBN: 0130461806
EAN: 2147483647
Year: 2005
Pages: 206
Authors: Eben Hewitt

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net