CSC/ECE 517 Summer 2008/wiki3 7 SHOP PAT
Problem Definition
Shopper pattern. The idea of a "shopping cart" is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative.
Introduction
One of the most popular activities on the Web is shopping. Online shopping carts can provide much more than their offline namesakes, such as making it easy to change the quantity of an item in the cart. It has much allure in it that one can shop at ones leisure at anytime. Customers can compare prices with a click of the mouse and buy the selected product at best prices.The shopping cart is a very well known and international metaphor. The main purpose of Shopper Pattern is to assist the consumer to obtain a collection of items from a set of providers which is achieved by introducing low coupling between the consumer and the provider. This pattern allows users to first collect all the desired products and then pay for them all at once or whenever they want. Consumers can easily search through a large database of products and services and see the actual prices including shipping before they decide to purchase.
Participants
- Consumer: Provide a list of items required to the shopper. While viewing the description of the product, the consumer is allowed to add the items to their shopping bag. The user is always shown with the current contents in the bag and also the total cost. In this way, the user is always aware of the cost before hand including the shipping charge.
- Shopper: Accepts the shopping list from the consumer and search for the multiple providers for the respective items. Shopper may search the item on different basis ex: Brand name, lowest price, highest price etc according to the consumers choice. http://www.answers.com/topic/shopper
- Provider: It keeps multiple items and make it available to shoppers. At the same time assist the shopper in locating the other providers. http://www.google.com/search?hl=en&rlz=1T4SUNA_enUS281US281&defl=en&q=define:Provider&sa=X&oi=glossary_definition&ct=title
- ItemRequest: Requested item by the consumer is identified.
- Item: The things that a provider owns, described by an item request, requested by a consumer, and the shopper obtains. http://www.google.com/search?hl=en&rlz=1T4SUNA_enUS281US281&q=define%3Aitem
Implementation
A sequence diagram which illustrates how each objects or processes operate one with another and in what order is given in Figure 1. A wide variety of application implementations are supported by
Shopper pattern. There are two main keys to implement the shopper pattern.
- Traversing the set of providers: Shopper pattern can be used in multiple situations.Providers are grouped into an aggregate object and in a simple list. Aggregate is known by the consumer and stored in a global variable. When the providers are arranged as arbitrary graph topology,one or more provider is known as consumer and stored in global variable. These approached can be achieved through strategy pattern.When the shoppen object is traversed with the strategy object,the set of providers are located itself. startegy object has some idea about some of the providers or it achieve this knowledge from consumer.A provide is able to create a factory o ra iterator where,provider provides a simple interface to shopper pattern.
In case when providers are arranged in a form of graph topology,each provider support a traversing strategy or iterator to request the list of providers.Infinite looping should be prevented in case of cyclic graphs.
- Obtaining requested items at a provider:
Steps to remember in designing
- Standard icons and conventions: The icons or a relevant word is a very nice approach to navigatethrough the web sites.The text should be explicit to itself.More than multiple lines of link appears to be two different links. Main links should be attractive and visible that helps user to find easily on the page.
- Avoid irrelevant links: On the page of searching for a books there should not be the links of TV,toys etc.In place of that the links related to books should be there.User may need multiple options to search for a book and require multiple option from where he can order the book.
- Reveal structure: The structure of searching the items should be attractive and user friendly with multiple options.In the book example the structure should provide the otion where user can search on the basis of multiple option.For ex: search by first name, last name,year etc.providing a toolbar option is very relevant idea where user can navigate the site very easily.
- Leave breadcrumbs:
- Don't bury information: The page on the site should not be farther than three clicks away from any other page. For example.For ex : buy the item, jump to related items, search for another item, purchase items in your shopping cart, and manage your account.
- Don't be mysterious: Things on the page should not be hidden.Like when user click somewhere then something pops up and before clicking there was no link or icons to navigate.
- Provide help: There should be help on searching the required pages or facility of keyword search.User should have the adjustable search criteria.
Usage
- Used when one or more products are bought by the consumer.
- Used when one or more instance of a product are bought by the consumer.
- Used when the consumer wants to shop later.
- Used when the consumer wants to pay the total amount later.
Advantages
- Shopper pattern helps in decoupling the requesting object from the object that provide the requested items.
- The responsibilities can be moved for provider objects.the requesting application will not need to be modified.
- The provider objects can be rearranged without modifying the requesting application.
- Optional items can be optimized in such a way that the processing time will be required only if the item is present in the list.