(Oracle) J2EE Design Patterns.pdf

(227 KB) Pobierz
Using J2EE Design Patterns
Using J2EE Design Patterns
Using J2EE Design Patterns
Introduction
May 2002
OTN developers have implemented the Virtual Shopping Mall (VSM), a sample application that
demonstrates design patterns for building J2EE applications. A software design pattern describes an
approach to solving a recurring programming problem or performing a task. The design patterns
discussed in this article can improve the performance of J2EE applications over the Internet or an
intranet, and make them more flexible and easier to maintain.
Documents
Download
l The VSM sample
download (JAR file,
553 KB) includes
installation
instructions and
complete source
code.
l View the source
code online.
l View an online
demo of the VSM in
action.
The following links provide background information that will
help you understand this sample application.
l
http://otn.oracle.com/sample_code/tech/java/ejb_corba/vsm/htdocs/vsmhome.html (1 of 2) [17.9.2002 17:13:05]
357143522.004.png 357143522.005.png
Using J2EE Design Patterns
Copyright © 2002, Oracle Corporation. All rights reserved.
http://otn.oracle.com/sample_code/tech/java/ejb_corba/vsm/htdocs/vsmhome.html (2 of 2) [17.9.2002 17:13:05]
357143522.006.png
About The VSM Sample Application
Using J2EE Design Patterns
About the VSM Sample Application
The Virtual Shopping Mall (VSM) sample application enables vendors to set up online shops, customers to browse through the
shops, and a system administrator to approve and reject requests for new shops and maintain lists of shop categories.
l About VSM User Roles
l Database Schema
l Conclusion
About VSM Users
The application identifies three types of users—Mall Administrator, Shop Owner and Mall Customer—each with different
privileges.
Mall Administrator The Mall Administrator is the superuser and has complete control over all the activities that can be
performed. The application notifies the administrator of all shop creation requests, and the
adminstrator can then approve or reject them. The administrator also manages the list of available
product categories. The administrator can also view and delete entries in the guestbook.
Shop Owner Any user can submit a shop creation request through the application. When the request is approved by
the Mall Administrator, the requester is notified, and from there on is given the role of Shop Owner.
The Shop Owner is responsible for setting up the shop and maintaining it. The job involves managing
the sub-categories of the items in the shop. Also, the shop owner can add or remove items from his
shop. The Shop Owner can view different reports that give details of the sales and orders specific to
his shop. The Shop Owner can also decide to close shop and remove it from the mall.
Mall Customer A Mall Customer can browse through the shops and choose products to place in a virtual shopping
cart. The shopping cart details can be viewed and items can be removed from the cart. To proceed
with the purchase, the customer is prompted to login. Also, the customer can modify personal profile
information (such as phone number and shipping address) stored by the application. The customer can
also view the status of any previous orders, and cancel any order that has not been shipped yet.
The following use-case diagram shows how each type of user interacts with the VSM application.
http://otn.oracle.com/sample_code/tech/java/ejb_corba/vsm/htdocs/vsmdemo.html (1 of 4) [17.9.2002 17:13:26]
357143522.007.png 357143522.001.png
About The VSM Sample Application
http://otn.oracle.com/sample_code/tech/java/ejb_corba/vsm/htdocs/vsmdemo.html (2 of 4) [17.9.2002 17:13:26]
357143522.002.png
About The VSM Sample Application
Database Schema
The figure below shows the database schema for the VSM application.
Conclusion
The Virtual Shopping Mall (VSM) sample application shows how design patterns can simplify enterprise development tasks, and
demonstrates approaches you can use to implement common J2EE design patterns. If you're interested in other approaches, you can
visit OTN to learn how Oracle's J2EE-compliant Business Components for Java (BC4J) framework provides off-the-shelf
implementations of numerous design patterns you would otherwise have to code by hand. The article Simplifying J2EE and EJB
Development with BC4J provides more information.
http://otn.oracle.com/sample_code/tech/java/ejb_corba/vsm/htdocs/vsmdemo.html (3 of 4) [17.9.2002 17:13:26]
357143522.003.png
Zgłoś jeśli naruszono regulamin