Chapter 10. Building the Storefront

 

This chapter covers

  • Securing GWT applications
  • Dealing with security in the client
  • Building a drag-and-drop system

A bookstore is one of the only pieces of evidence we have that people are still thinking.

Jerry Seinfeld

In the last chapter, we looked at a basic CRUD application for a database of books. In this chapter, we’re going to take that application and turn it into the basis of an Ajax storefront that can sell the books listed in the database. While a basic database of books is OK, you’ll likely have multiple interfaces to your data—a customer-facing storefront for buying the books in the database is a good example.

There are a few things we need to do to the chapter 9 application to make this happen. First, we need to secure our administration tool and create a separate service for customers. Next, we need to build a drag-and-drop system using only the GWT APIs. Also, because the storefront is the customer-facing portion of our application, it should be pretty—we’ll look at adapting a JavaScript library to create reflections for our cover images, as if they were sitting on a reflective surface (see figure 10.3). Finally, we’ll bring it all together and construct a basic shopping cart system.

10.1. Securing GWT applications

10.2. Building a drag-and-drop system

10.3. JSNI special effects

10.4. Summary