Web Development with MyEclipse and JBoss – Part 1
Web Development with
MyEclipse and JBoss
Part 1 - J2EE Application Modeling
with MyEclipse UML
The WebStock Case Study
The WebStoThe WebStock Case Study
Study
Module 1
By Karim Djaafar
Senior Consultant
Author of
“Developing J2EE Applications with Eclipse and JBoss”
Paris, October 2005
J2EE Application Modeling with MyEclipse UML
Web Development with MyEclipse and JBoss – Part 1
Table of Contents
The WebStock Case Study ................................................................................................. 1
Section 1 ........................................................................................................................................ 4
Before you start ............................................................................................................................ 4
Prerequisites ................................................................................................................................ 5
Section 2 ....................................................................................................................................... 6
Developing J2EE applications using MyEclipse tools in an iterative process ................ 6
Introduction .................................................................................................................................. 6
Using an iterative and incremental process for developing J2EE applications ....... 6
Developing J2EE application with MyEclipse tools ..................................................... 8
Section 3 ........................................................................................................................................ 9
The WebStock Application ....................................................................................................... 9
WebStock Architectural Design ...................................................................................... 10
The Database Schema ....................................................................................................... 11
Section 4 ...................................................................................................................................... 13
Modeling WebStock with MyEclipse UML ......................................................................... 13
Overview ............................................................................................................................. 13
Getting started with MyEclipse UML ............................................................................ 13
User Interface Overview.........................................................................13
Creation of the domain model of use case study WebStock.............. 16
Creation of our first UML diagram........................................................16
Creating Use Cases Diagram for the application.................................20
Creating a Class Diagram for the application...................................... 27
Forward Engineering - UML Class Diagrams to Java Code.............. 30
Reverse Engineering.................................................................................32
Creating a Custom Stereotype................................................................32
Adding attributes for the Order entity..................................................33
Building Associations between classes..................................................38
Conclusions ................................................................................................................................ 44
Acknowledgements ................................................................................................................... 44
References ........................................................................................................................... 44
Figures
October 2005 J2EE Application Modeling with MyEclipse UML
Web Development with MyEclipse and JBoss – Part 1
Figure 1, a classic development process .................................................................................. 7
Figure 2, a typical iterative process .......................................................................................... 7
Figure 3, MyEclipse Workbench coverage of the J2EE life cycle ...................................... 8
Figure 4, WebStock Technical Architecture ......................................................................... 11
Figure 5, Main Modeling perspective inside MyEclipse ................................................... 14
Figure 6, UML Repository creation ........................................................................................ 18
Figure 7, Initializing the WebStock UML Project ............................................................... 19
Figure 8, Main UML toolbar .................................................................................................... 22
Figure 9, Toolbox for use case modeling .............................................................................. 22
Figure 10, Properties tab of use case artifacts ....................................................................... 24
Figure 11, The actor and the associated use case “Browse Parts in Stock” and
association line ........................................................................................................................... 25
Figure 12, The extend use case “dealership Inquiry of WebStock Central’s
Inventory” ................................................................................................................................... 26
Figure 13, The UML Class Diagram Editor toolbar ............................................................ 28
Figure 14, The WebStock UML tree view ............................................................................. 29
Figure 15, The Class Diagram with six newly created classes, without relationships 30
Figure 16, the wizard for UML Forward-Engineering generator in action ..................... 31
Figure 17, The result java classes after the generation from the webstock model ....... 32
Figure 18, Creating a custom Stereotype with MyEclipse UML ...................................... 33
Figure 19, WebStock logical data model diagram ............................................................... 37
Figure 20, Defining the association direction ...................................................................... 39
Figure 21, Configuring the multiplicity of an association ................................................. 40
Figure 22, Setting the Multiplicity of an association ......................................................... 40
Figure 23, The complete WebStock class diagram .............................................................. 43
Tables
Table 1, A Use Case template of “Local Dealership Inquiry” .......................................... 21
Table 2, UML notation for use case modeling ..................................................................... 24
October 2005 J2EE Application Modeling with MyEclipse UML
Web Development with MyEclipse and JBoss – Part 1
Section 1
Before you start
J2EE application development is a complex process that can be eased by using
the UML modeling tools found in the MyEclipse Enterprise Workbench
development suite. In the requirements definition phase MyEclipse UML
(MyUML) provides UML modeling tools as well as UML repositories for visually
modeling applications with industry standard diagrams. The MyEclipse Visual
Web Designer includes directed, wizard driven processes for the development of
web components and Enterprise Java Beans (EJB).
This white paper is the first in a series of three installments covering the
integration of MyEclipse into the J2EE application development cycle. With
MyEclipse we will manage the application development cycle from project
inception to deployment on the JBoss Application Server. In this first white
paper we will focus on the first stage of the process, project inception, using the
WebStock sample application and case study. This white paper details the usage
of the MyEclipse UML (MyUML) development tools of the MyEclipse Enterprise
Workbench to model and design a J2EE application. The modeling methodology
used in this case study will be focused on the usage of UML diagrams to model
the operational functionality and structure of the WebStock application.
In this whitepaper the following topics will be covered:
• The High Level Description of the WebStock Case Study during the
analysis phase of the project
• The MyEclipse UML tools that fully exploit UML features and make it
possible for database modeling and design within the MyEclipse UML
Perspective. We will see how to setup UML tools, how to create a UML
Model Repository and how UML facilitates the design of the WebStock
application.
• How to create and document Use Case Diagrams and Class Diagrams for
the WebStock application
• Skeleton Code Generation, Reverse Engineering, and Round Trip
Engineering from the design model
October 2005 J2EE Application Modeling with MyEclipse UML
Web Development with MyEclipse and JBoss – Part 1
Prerequisites
There are a few prerequisites for using this tutorial; moreover, it will help if you
are familiar with relational database basics. In particular you should be familiar
with the design concepts of normal forms and entity relationships. It will also
help if you have some knowledge of the Unified Modeling Language (UML),
especially use case diagrams and class diagrams, as these are used within the
MyEclipse® tools as virtual equivalents for entity relationship diagrams.
October 2005 J2EE Application Modeling with MyEclipse UML
评论0