Jpetstore study through the basic usage WSAD.ROSE.WEBSPHERE

Copyright notice: You can freely reprint, reprint, and be sure to retain the link below:
Author: moyunhe
Source: Product Matrix WebSphere and IBM Forum

Preface <br /> Although IBM gave up WSAD, ROSE continued development (replaced by the Rational Software Architect), but as a generation of classic ROSE, to this day remains a powerful tool for system modeling.

As for WSAD, I began to use from 4.0 through the example of IBM's Red Book and the tutorial, I gradually mastered the JSP, EJB, WebService technology.

For beginners, WSAD is very easy to use:
English menu easy to install with Websphere test environment itself, does not require complex configuration
IBM Redbook rich examples and tutorial tutorial does not require extra operating environment and plug-ins



In this paper, jpetstore (struts + ibatis) example of the basic usage of WSAD introduction and use ROSE to set up jpetstore use case model, data model, WEB model, the final will be transformed into jpetstore with spring + hibernate implementation, can be used as WSAD, ROSE beginning of the Getting Started tutorial.

First, jpetstore brief introduction

As we all know, SUN blueprint J2EE application company, petstore pet store has a lot of versions, jpetstore detailed version of the introduction can be found in Based on struts + spring + ibatis lightweight J2EE Development .

Personally, I think, jpetstore version of the design has a lot of places worthy of study, it is recommended you carefully read its source code.

jpetstore main features:

BeanAction all through the implementation of the Action, to do the very IOC, to facilitate the expansion of the system (such as an increase BeforeAction and the interceptors AfterAction).
Through LocalThread technology, Struts in Action solved the problem of thread-unsafe.
Packaging ActionContext all request parameters (Parameter), Session (Session), Servlet Context (ServletContext), etc., do not need specific parameters of the Ways.
ActionForm and Action combined, the performance of layers inside the Bean has a number of methods can be.
Bean layer can easily use POJO objects.
To do because of the IOC, on BaseBean, BeanAction a little transformation, persistence layer, business layer, presentation layer directly throwing error abnormal BeanAction can be captured at all unusual for the unification of errors and unusual treatment.

Two, using WSAD to run jpetstore

The first step: in the DDL script used to build tables and data.

Step Two: After the start WSAD, set up the project

1. Jpetstore because there are documents, select the file -> Import

War file selection (you can also extract the war, select File System):

Jpetstore study through the basic usage WSAD.ROSE.WEBSPHERE

Click "Finish" after the war file selection (see annex).

2. "New" project



Named jpetstoreWeb



Upon completion, set up a dynamic WEB project.

3. Into java file

In the "Java Resources" Import Right Choice, a similar, select Import File system, select src folder (jpetstore.war in, unzip it).

Works was built up.

4. Propertiesdatabase.properties modify documents, such as, in the case of mysql database

driver=org.gjt.mm.mysql.Driver
url=jdbc:mysql://localhost/jpetstore
username=root
password=root


The third step: <br /> to run the project right-click "jpetstoreWeb" project, select "run on the server"



WebSphere because WSAD test environment with all the default can be.

IE running at http://localhost:9080/jpetstoreWeb/

Console right there is "server", you can start or stop the server.

Step four: Reconstruction Project

1. Right com.ibatis.jpetstore.persistence.iface.AccountDao, select "Rename", such as for IAccountDao (my personal habits, interfaces to I at the beginning), all cited AccountDao the java file, AccountDao also all the changes the name of the. Dao is also some remaining renamed.

2. Open com.ibatis.jpetstore.service.AccountService, select "Reconstruction" -> "extract interface", named IAccountService, the formation of both interface and implementation files, all references AccountService also modified.

Step five: Export EAR file.
Two, Websphere5.1 run at jpetstore
Webshpere enter the management console, select the installation of a new application, import and publish jpetstore.ear, it can run IE directly (http://localhost:9080/jpetstoreWeb/).

Three, jpetstore used for modeling ROSE

This part of the model, first of all through the reverse engineering ROSE instrument (Reverse Engineer), and then proceed to generate collation.

(1), UseCase by Example



Normal user (user) can search Products (searchProducts), view the Product Category (viewCategory), view the Product (viewProduct), view the Product (viewItem), register a new account (newAccount), landing (sign-In).

After landing the user (signedUser) can be written off landing (sign-Out), Edit Account (editAccount), the product item Add to Cart (addItemToCart), delete products from my shopping cart project (removeItemFromCart), the number of modifications to (updateCartQuantities), New Order (newOrder), see Order (viewOrder), View Cart (viewCart), settlement (checkout).

(B), data model



jpetstore the data model can be divided into three categories:

1. Product-related:
Product Category (CATEGORY)
Products (PRODUCT), Products can also be said that classification of a single product of the small (ITEM), a detailed description of the specific property of the Product supplier (SUPPLIER)
Product inventory (INVENTORY)

2. User account related to:
User account (ACCOUNT)
User Password (SIGNON), ibatis pure form in order to demonstrate the usage of related.
User Profiles (PROFILE), storage of personal information users.
BANNER information system (BANNERDATA)

3. Order Related:
Users Order (ORDERS)
Order status (ORDERSTATUS)
Order details (LINEITEM)

(C), WEB model

WEB model the various modeling tools has always been weak, ROSE modeling capabilities of the WEB is also weak and sometimes failed to convey the accurate meaning.

1. Add, modify account



2. Browse Products



3. Order



4. Shopping Cart (abbreviated)

Model for the WEB, with the struts of the navigation map (NitroX generation, part of shot), will be more clear.



(D), Class Diagram



Blue box spring + hibernate through the implementation. Can see that the performance of AccountBean layer is called Service-oriented interface, when using hibernate implementation changed O / R mapping, they only need to modify the implementation type of interface (DAO persistence layer), the performance level of the procedure does not require any modifications.

Resources:
Annex 1: ROSE, jpetstore.mdl
[ Download file ]
Annex II: jpetstoreWeb works (excluding spring.jar, hibernate3.jar, too)
[ Download file ]
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Jpetstore study through the basic usage WSAD.ROSE.WEBSPHERE

  • Do not say you understand project management

    [Introduction] to draw a blueprint , and then architecture in a building block, such as the management of projects for software development project management. Today's software developers, but also should be an engineer, rather than artists. Firs ...

  • Eclipse to run using the specified JVM m2eclipse plugin can not find tools.jar

    Used the m2eclipse plug-ins using struts2 when com.sun necessary to rely on the default-tools.jar, specifically because at the struts-annotations bag designated default-tools.jar <profile> <id> default-tools.jar </ id> <activatio ...

  • ruby MBARI large patches Performance Evaluation Report

    Before JavaEye news ruby memory leak culprit - the specter of a detailed analysis of the current pointer Ruby official version (MRI version) causes memory leaks. Brent Roman today issued a Super patch , Which contains 6 patch file to resolve the Ruby ...

  • Struts + Spring + Hibernate practice

    Tools: Eclipse3.1, MyEclipse4.03, Tomcat5.5.9, Properties Editor plug-ins, MySql4.1.13 New construction: the name for the login Create Struts framework Create index.jsp, add a link to login.jsp Press Ctrl + N, to create login.jsp, LoginAction, the us ...

  • JUnit Unit Testing Summary

    Read some of the unit test article, from the article in the interception of a number of information, which could be considered in the learning process, a summary of it! See future! Unit testing code is not used to prove you are right, but in order to ...

  • jBPM Development Getting Started Guide

    Although the workflow is still immature stage of development, not even a recognized standard. But its application has already been launched in the Express, indicating the market's demand for job-flow framework are urgent and enormous. Backgrounds of o

  • Openfire Plugin Developer's Guide

    Introduction Openfire features plug-ins are enhanced. This document is a guide to developers to create plug-ins. The structure of a plug-in Plug-ins Plug-ins openfireHome stored in the directory. When deploying a plug-in jar or war file, it will auto ...

  • How the primary key agent-hibernate

    Existing Table A, B Statement: A, B field id-based keys. A: [id, name] B: [id, Aid, title] B and A's set up a many-to-one relationship because of A, B two tables are the primary key id field so add B when Hibernate will automatically retrieve id ...

  • myeclipse plugin

    myeclipse plugin

Leave a Reply

Recent
Recent Entries
Tag Cloud
Random Entries