8.6. Configuring the Altura Merchant Operating System Framework

Today, when a visitor comes to CatalogCity.com or another of Altura's sites, the content and applications presented on the Web page are delivered through the use of HP Bluestone Total-e-Server. Java Servlets running on Total-e-Server manage the interactions between the Web interface and Altura's Microsoft SQL Server database farm.

“We're using plain Java technology with servlets,” explains Jordan Zimmerman, Altura's senior software architect. “We are not currently using EJBs or JSPs for the main application, though we do use JavaMail and JDBC. We were originally going to recode all our original scripts in C++, but thankfully we discovered Java Servlets, which offered a much better platform for what we were doing. There's a rich set of APIs for building Web pages, and many of the mundane tasks associated with handling HTTP requests don't have to be coded from scratch. This saved us six months to a year, at least.”

A team of two Altura engineers started the process of rewriting the entire application framework—including the multivendor shopping cart, personal accounts, checkout routines, and utilities—in the Java language in December 1999. Within four months, 85 percent of Altura's site had been rewritten and was running on HP Bluestone.

8.6.1. A Structure of Servlets

Altura's AMOS framework actually relies upon a small number of servlets—not even a one-to-one ratio of servlet to Web page. Partially based on model-view-controller and partially based on Model II, the AMOS framework is something of a coding-model smorgasbord. A controller servlet called cc serves up all the site's pages based on URL parameters. In fact, the same servers, the same database, and the same code delivers 20 to 30 different Web experiences, and all these experiences arise from the same implementation of the cc object.

“A Web request comes into the cc servlet and creates an internal class called cc_request,” Zimmerman explains, “which manages all the logic of the application—from analyzing URL parameters to performing database queries and building pages around the resulting information. cc_request is essentially the broker for all the classes subsequently developed to support the application.”

There are, in fact, three objects that form what Zimmerman calls the “trinity” at the core of the AMOS framework.

“Even more fundamental than cc_request,” says Zimmerman, “is an object called cc_site, which Altura International uses to build Web sites. Each of the Altura-powered sites, whether CatalogCity.com, gifts.com, or any other, is a singleton in memory that extends the cc_site object, and each of these instances contains the non-request-related data that comprise a site—its name, various options as to what kind of site to display, cache paths, and the images that make up the site.

cc_request is the second object in the trinity. A cc_request object is created for every request to the site. It contains request-specific data that isn't particular to any site—browser information, URL parameters, and so forth. It looks at cookies and loads in the correct shopper objects, and it looks at the parameters coming in with the request and determines which kind of request it is. In all of our URLs, you'll see a parameter called main. That's what we call the 'context' and that's how we know what page to deliver. We have many contexts—main=ccn, main=product_categories, main=gift_center, and many others. The main=ccn context has subcontexts—ccn_last_request, ccn_checkout, ccn_account, and others.”

Figure 8.5. Altura's High-Level Software Architecture


Typical URLs appear as follows:

http://amos.catalogcity.com/cc.class/cc?main=ccn%5Fprivacy&ccsyn=1

http://amos.catalogcity.com/cc.class/cc?main=departments&trk=HomePageSale&pcd=561885&ccsyn=173

cc_request keys off the main parameter to create the third object in the trinity called cc_site_request,” Zimmerman goes on to explain. “For each unique site and each unique context, cc_request creates a unique cc_site_request class to handle that request. It is objects that extend cc_site_request—in fact, that deliver the content displayed to the user in response to a request. So if the site they're looking for is shopping.NBCi.com, an NBCi.com version of cc_site_request gets the shopping.NBCi.com page. If the request is for www.catalogcity.com, a catalogcity.com version of cc_site_request gets the catalogcity.com page. The pages are all created dynamically based on the request itself.”

As cc_site_request builds the page, it calls on some common code that Altura developers call the page shell, which interacts with the cc_site_request object to determine the kind of information that should go in the header, the left navigation bar, and elsewhere on the page. Through this interaction with the page shell, the cc_site_request object builds the entire page in memory. If the page has no user-specific information in it, it will be written to disk as an HTML file (also as a GZIP file) on Altura's high-speed, full-page cache server.

The AMOS framework can also cache any object using both memory and physical disk storage. The site typically runs two instances of HP Bluestone Universal Business Server on each of its 16 application-server systems and the cache is shared among all of them. When an object is loaded in memory, it is also written to cache, and the next time the object is needed, AMOS first looks for it in the cache. If found, the cached object is used instead of creating the page, running a query, or performing whatever action precipitated the need for the cached object.

Altura developers have also built a set of utility classes to provide additional support at different points in the process. cc_query, for instance, bundles the myriad APIs and classes of JDBC into one class. It handles everything the AMOS framework needs in the area of querying the database—from formulating the query to managing the transaction. Another class—cc_loaded_query—holds an entire results set of a query in memory, where it can be readily reused or cached.

Figure 8.6. Data flow within the AMOS Architecture


Other objects include abstractions for each shopper, called cc_shopper, cc_shopper_address_book, cc_shopping_cart, and so on. All these are stored in the Java session and accessed as necessary during a shopper's visit to the site.

8.6.2. The Role of XML and JSPs

In addition to the Java servlets and Java classes that comprise the Web application and the multivendor shopping, cart, Altura is using XML and JSPs. At any moment, Altura enables visitors to purchase merchandise from more than 600 merchants, and those merchants provide their content to the site via XML. Altura's custom-built, Java-based content-management system moves XML docs into the SQL Server database.

Altura has built numerous intranet and extranet tools using JSPs.

  • Merchandising Management Tool. Internal Altura employees and employees who work for syndicated mall owners (such as Readers Digest, owners of gifts.com, and NBCi, owners of shopping.NBCi.com) use JSP-based tools to manage the merchandising content and layout of their sites. They have control of which products display on the home page, in advertorial sections, and in departments. They can even define new departments and populate them.

  • Content Management Tool. Merchants, mall owners, and employees can upload, change and remove products or product attributes. Merchants can change a product price, product description, categorization, or inventory detail through the use of this browser-based tool.

  • Promotional Tool. This tool allows Altura's marketing group and Altura's mall owners to create custom coupon codes that can be used as incentives for shoppers. Promotional coupons might offer free shipping, a percentage off an order, or a free product with each purchase—and these coupons can all be created using this tool.

Altura's IT managers envision creating more tools with JSPs, and note that many of their pure HTML and C developers are initially more comfortable developing JSPs than they are in taking the leap directly into programming in the Java language. They can use JSPs and all the existing class libraries that have been developed in Altura to create powerful tools very quickly, without having to move immediately into the Java language itself.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset