Java Developer's Guide to E-Commerce with XML and JSP by Bill Brogden and Chris Minnick Our plan for this book was to provide the typical Java developer with sufficient information on XML and the Java tools for manipulating XML that he or she could create e-commerce applications. We don't attempt to provide whole solutions that you just drop in to a web-site because every site has different requirements. We observed that there were two things about XML that gave developers a lot of trouble. The complex rules for creating XML, and the process of deciding how to describe data within these rules. Therefore the first two chapters are devoted to these topics. Essentially, chapter one goes over the rules for creating XML and chapter two goes over the design decisions that you have to make when applying XML to a particular kind of data. Creating a data set in XML that is large enough to demonstrate various programming techniques can be very time consuming. We provide an entire catalog for an imaginary on-line store on the CD so you can avoid this drudgery. Chapters three through six demonstrate how Java servlet and JSP technology can provide for searching and presenting these items, creating a shopping cart function and handling orders. Given a particular data description in XML, the next big decision a developer has is whether or not to use the DOM or SAX approach. We provide several examples of both styles. The DOM approach is indicated whenever you have data that is accessed frequently and that occupies a reasonable amount of memory, as with the product catalog. The SAX approach is indicated whenever you have data that can be quite bulky and is accessed infrequently. In chapter seven we used both DOM and SAX to provide for administering a survey, recording, and analyzing the results. This is one of my favorite chapters because XML makes a great way to create the survey script. The DOM of the script stays in memory so running a new user through the survey takes very little computer power. The results of the survey are of course recorded in XML, but the analysis is done using the SAX parser. This application is ideal for SAX for several reasons: only a single pass through the data is needed to gather statistics, analysis is not done very frequently, and it doesn't matter how large the accumulated response file gets. I have some more information, including an example survey at this site: http://www.lanw.com/books/javaxml/ I will post some more about other chapters later in the week. Bill
I notice that you use the somewhat clumsy DOM for all your internal models. Would you consider the lighter and more java-specific JDOM if you were writing this system again, or was there a reason you rejected it ?
How much detail do you go into on the design decisions of the second chapter? I find it easy enough to understand XML's rules (your first chapter, I guess) but difficult to understand how and when to use XML. The way you demonstrate how to approach a problem using both the DOM and the SAX models seems pretty useful to me but I am a beginner at XML so would it be easy for me to follow along?
posted 18 years ago
I've read the book, and yes, it is easy to follow along. The choices between DOM and SAX, the development of DTDs, and the implementation of the code to do it all are very clearly explained and documented. The book is very focussed on devlivering a particular peice of software (the example e-commerce system) and as a result seemed more "real" than many other books which skirt around the subject.
William, Reading this thread gave me some questions about the book. What level of experience/knowledge is assumed of the reader? in Java? Servlets/JSP? XML? I would consider myself fairly capable with Java, very comfortable with servlets/JSP, and grasping the concept of XML (though not quite the application). I'm not particularly interested in "ecommerce" but I am generally interested in XML/XSL, what do you think the book's biggest benefit would be for me? Andrew
posted 18 years ago
There is no introduction to java, so I guess you need to be familiar with Java and its use. It doesn't use any "fancy features" of java - it seems to be written for java 1.1. XML (DOM, SAX and DTD) is introduced in some detail, as are the servlet and JSP APIs, so no particular XML knowledge is necessary, but it wouldn't hurt. The bulk of the book walks through the implementation of a basic e-commerce site with a catalog, shopping cart, survey system, newsfeeds etc. using servlets, JSP and XML.