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. 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
Consequences
- 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 nee dto be modified.
- The provider objects can be rearranged without modyfying the requesting application.
- Optional items can be optimized in such a way so that the processing time will be required only if th eitem is present in the list.
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.
- 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.