uml china 讲座 all-in-one design tool powerdesigner10.0 与模型驱动开发

94
UML China 讲讲 All-in-One Design Tool PowerDesigner10.0 讲讲讲讲讲讲讲 王王王 PowerDesigner 王王王王王 [email protected] 2004 王 3 王 25 王

Upload: derora

Post on 06-Jan-2016

119 views

Category:

Documents


7 download

DESCRIPTION

王晓昀 PowerDesigner 首席架构师 [email protected] 2004 年3月25日. UML China 讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发. 议程. 我的简介 为什么要使用模型 驱动开发 工具 PowerDesigner 简介 PowerDesigner 与业务流程建模 PowerDesigner 与对象建模 PowerDesigner 与数据建模 PowerDesigner 与 XML 建模 PowerDesigner 的 共同 功能 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

UML China 讲座All-in-One Design Tool

PowerDesigner10.0 与模型驱动开发

王晓昀 PowerDesigner 首席架构师[email protected]

2004 年 3 月 25 日

Page 2: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

2

议程

我的简介 为什么要使用模型驱动开发工具 PowerDesigner 简介 PowerDesigner 与业务流程建模 PowerDesigner 与对象建模 PowerDesigner 与数据建模 PowerDesigner 与 XML建模 PowerDesigner 的共同功能 PowerDesigner 10.0 的新功能介紹 PowerDesigner 与模型驱动开发 PowerDesigner 的路线图

Page 3: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

3

我的简介

• 我的名字是王晓昀 (WANG Xiao Yun)• 我于 1978 年上北京大学 . 只上了三个月 .• 我于 1979 年去法国上学• 1986 年大学毕业后在巴黎的 SDP 软件公司工作• 1988 年开始开发 PowerDesigner• 1989 年开发在法国出卖 AMC*Designor• 1991 年开始在美国出卖 S-Designor• 1995年 Powersoft 买下了我们的 SDP 公司• 1995年 Sybase 又买下了 Powersoft• S-Designor和 AMC*Designor 的名字改为 PowerDesigner和

PowerAMC• 从 1995 年到现在我一直负责 PowerDesigner 的设计和开发• 我在法国生活了 25 年 . 我现在还是中国人

Page 4: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

为什么要使用模型驱动开发工具

Page 5: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

5

为什么要使用模型驱动开发工具 ? Would You Build a House Without a Blueprint?

• The Architect will do the first high level drawings to validate the concept with its client He will then make a detailed plan for the Builders

• The Builders will take this blueprint and optimize it based on technical constraints

Page 6: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

6

开发软件的问题

• How to improve application quality, reduce development time and ease maintenance?

• How to model business-driven application?

• How to design applications in such way that they are easy to change?

• Different techniques (E/R, UML, BP Modeling) have forced corporations to buy different tools, raising communication and co-ordination issues

• Lack of central place to store and manage models

Page 7: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

7

模型驱动开发工具

• To improve application quality, reduce development time and ease maintenance– Use Modeling tool to analyze and design the applications

– Use Modeling tool to generate the specification

– Use code generators to generate the database, the application code

– Use repository to store models and manage versions

• To model business-driven application and allow applications to be easilly changed– Use Business Process Model, UML and Data Model together

Page 8: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 简介

Page 9: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

9

PowerDesigner 的历史

1989

(v1)

1990

French, CDM only

1991

V3 EnglishCDM & PDM

1992

v4Enterprise

edition

1994

v5Modules

ProcessAnalyst

1996

v6Maturity releaseDataWarehouse

Old Releases, focus on E/R modeling and extensions

New generation, UML and new techniques

1999

v7first UML

diagram (Class)

2000

v7.5added newrepository

2001

v8.0More UML(Use Case,Sequence)

v9.0More UML(Activity,

Component)Datawarehouse

EJBBusiness Process modeling

2002

v9.5All UML diagrams

UML profilesBP Modelingextensions

2003

v10.0SOA.NETMDA

Powersoft Sybase

Page 10: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

10

Gartner 说

PowerDesignerMarket share in 2002 was 39%

(Document Gartner August 2003)

PowerDesigner在数据建模上占世界第一位

Page 11: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

11

Gartner说 PowerDesigner 在数据建模上占世界第一位

Data Modeling‘Magic Quadrant’ 2004

PowerDesignerMarket share in 2002 was 39%

(Document Gartner August 2003)

Quest Softw are3%

Others26%

Sybase39%

Computer Associates21%

Embarcadero8%

Popkin Softw are3%

Note: Quest Software resell an OEM version of PowerDesigner under the name ‘QDesigner’.

Page 12: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

12

BP Modelingat version 10

2004 quadrant

Object Modelingat version 9.5.22003 quadrant

OOAD & BPA Market OverviewGartner modeling quadrantsOOAD & BPA Market OverviewGartner modeling quadrants

ChallengerVisionnary

Page 13: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

13

不同的建模技术

Source: Gartner

数据建模 (E/R, DFD)

面向对象建模 (UML)

商业流程建模 (BPA)

Page 14: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

14

Gartner 说三个建模技术要连结在一起

• Gartner research note decembre 2003

• Strategic Planning, SPA-21-5951 - M. Blechar

Predicts 2004: BPA, UML and Data Modeling Converge

« Techniques such as business process analysis are converging to

provide technical architects, business modelers, developers and

database designers consistency, productivity and quality via

reuse and code automation. »

« …Vendors such as Sybase (PowerDesigner) and … offer single

products that span all three markets. Most UML modeling tool

vendors already have some BPA and database design support in

their tools, and vice versa. … »

Source: Gartner

Page 15: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

15

PowerDesigner Key Features

• Good Business Process Modeling support• Full UML Modeling support• Complet Data Modeling support• XML Modeling• Integrated BP, UML & Data Modeling• O/R Mapping• Repository• Report generator• Customizable code generator (Java, EJB, Web Service,

C#, VB .NET, PowerBuilder, XML, BPEL4WS, …)• VBScript and OLE automation support

Page 16: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

16

数据建模 (E/R)

面向对象建模 (UML)

商业流程建模 (emerging standards)

IT 用户分析员 设计师 DBAs

最好的建模技术是整合式建模

IT 用户分析员 设计师 开发人员

商业用户CIOs

整合式建模 = PowerDesigner

三个建模技术要连结在一起

Page 17: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

17

PowerDesigner 的体系结构Maximum coverage

O/R Mapping数据模型

(E/R)面向对象模型

(UML)

商业流程模型(Targets: ebXML,

BPEL4WS, Sybase IO)

商业流程模型

资料库 (optionnel)

数据库 Persistence Management

ApplicationServers

IntegrationServers

- Metadata- Profiles- Model-to-ModelGeneration- MDA- Report- XMI…

- Free Model- XML Model

编码生成

IDE

Page 18: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

18

O

/R M

app

ing

PowerDesigner的模型

概念性数据模型

物理数据模型

数据库

Script DDL SQL

Java, C#, VB.Net,PowerBuilder,WSDL, …商业流程模型

ebXMLBPEL4WSIO

GenerationReverse engineering

Synchronization

Import/ExportODBC

面向对象模型

XML 模型

XML DTDXML Schema

New

Page 19: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

19

Modeling in Development Cycle

BusinessRequirements 分析 设计 开发 测试 Deployment Maintenance

商业用户 IT 用户 分析员 设计师

开发人员 , DBAs, Administrators, etc

Team work, Change management, Methodology,Documentation, Reuse

Roles

Control points

PowerDesigner coverage 今天

PowerDesigner coveragePowerDesigner coverage 明天明天

Page 20: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

20

Exemple of PowerDesigner Object-Oriented Model (UML)

Page 21: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

21

Industry Endorsement – Customer Adoption

• PowerDesigner is already used by many public and private organizations worldwide

• Total today over 50,000 users at 30,000 sites worldwide – we are doing something right!

• Examples of strengths in specific areas:– Financial Community embraces PowerDesigner

– France– Germany– UK– USA

– French market – 80% market share – and they know about design!

Page 22: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

22

Hurwitz on PowerDesigner 9.0

• Comprehensiveness: ‘… a rich all in one modeling environment…’

• Deployment flexibility: variety of languages and target platforms

• Developer resources: Sybase Developer Network

• Life-cycle management: integration with IDE

• Developer productivity: ‘… a solid set of wizards and tools to speed development tasks such as EJB creation, object/relational mapping (O/R map), report generation, and a customizable user interface’

Ease-of-use

Comprehensiveness

Deployment Flexibility

Developer Resources

Life-Cycle Management

Developer ProductivityAids/Wizards

Adherence to Standards

Benchmark Rating – Overall Rating 8.0

0 2 4 6 8 10

Page 23: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

23

• Competitive DifferentiationPowerDesigner 9.5

Business Process Modeling

Data Modeling

Object Modeling

Repository

IBMRational

Rose

ComputerAssociates

EmbarcaderoBorlandTogether

Competitive Differentiation – PowerDesigner 10.0

Erwin is a declining

leader

E/R Studiotechnical

limitations

UMLvisionary

Describelimited

awareness

Leaderfor

developers

+ +

- + +

UML only,IT style

Sterling, BPwin

products

No No

limited &complex

limited

two overlappingproducts

(Platinum/Sterling)

limitedintegration issue

due to multiple products

usabilityissues

integration issue due to

multiple products

– – – –

– – – –

Page 24: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

24

• Competitive DifferentiationPowerDesigner 9.5

Business Process Modeling

Data Modeling

Object Modeling

Repository

Sybase PowerDesigner

Competitive Differentiation – PowerDesigner 10.0

Challenger with specific offering

Leadermature technology proven over years of success

Complete offering with version 10.0showing growth in market and technology

Most complete and integrated design-time enterprise repository in the industry

Page 25: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

25

• Best integrated BP, UML, Data modeling tool

• No.1 Data Modeling tool, better than ERwin

• Very good UML modeling, better than Rose

• Best O/R mapping support

• Best Repository

• Very good report generator

• Extensible (code generator, profile, VBScript, …)

Repository

Competitive Differentiation – PowerDesigner 10.0

Page 26: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 与业务流程建模

Page 27: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

27

Why Using Business Process Modeling?

• It is not technical; it is easy to use.

• Business users can use it to:– Describe the current business processes

– Define the future business processes

– Optimize business processes

– Improve ROI

• BPM can be used to design and generate BPM and workflow standards (ebXML, BPML, XPDL, …)

• BPM can be used to design and generate Web Services orchestration standards (BPEL4WS, …)

Page 28: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

28

Why We Use BPM instead of UML?

• BPM tool is essentially for business users. It should be very easy to use.

• UML is more technical and more complex. It is good for designing applications but not for describing business processes.

• We offer well adapted tools for different usages instead of forcing all users to use UML.

Page 29: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

29

Business Process Model Concepts

• Start

• End

• Process

• Flow

• Decision

• Synchronization

• Organization Unit

• Resource

• Service provider, interface, operation

• Data

Process

OrganizationUnit_1

Resource_1

•Predefined Symbols

New

Page 30: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

30

Example of a High-Level BPM

• Describe system architecture

Order Check Stock Process Order

ERP

Order Fulfillment SystemOrder Fulfillment SystemOrder Fulfillment SystemOrder Fulfillment SystemOrder Fulfillment System

Place Order

Verify Customer Ship Product

CRM Order Management

Notify User

Page 31: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

31

Example of a Detailed BPM

OrganizationUnit_1 OrganizationUnit_2

USPS Packet

FedEx Packet

Inventory

Create Order

Process Corporate Order Process Order

Check Stock

Ship US Postal Ground

Confirm Order Shipment

Ship FedEx Overnight

Overnight Delivery?

Corporate Order?

START

FINISH

Business Process Model

Model: Order Management ProcessPackage:

Diagram: Order Process DiagramAuthor: Sybase, Inc. Date : 3/23/2004

Version : 9.0

Swimlane

Page 32: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

32

PowerDesigner 10.0 BPM Features

• Simple user-interface• Custom symbols, predefined symbols tool palette• Support Simulation (use Simul8)• Support Service-Oriented Architecture (SOA)• Generate/reverse engineer BPEL4WS• Generate Sybase Integration Orchestrator model• Generate/reverse engineer ebXML• Import/export data from/to OOM and CDM• Export UML Activity diagram using VBScript• Swimlane• CRUD matrix (Create, Read, Update, Delete)

New

New

New

Page 33: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

33

Support Simuation (new in V10)

• Use simulation to optimize business processes (costs, delay, resources)

• Define Simul8 specific properties

• Generate Simul8 models

• Reverse engineer Simul8 properties

Page 34: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

34

Support Service-Oriented Architecture (SOA)

• Support Service provider, Service interface and operation

• Import WSDL, UDDI browser

• Assign service operation to process

• Web Services assembling

• Design, generate, reverse engineer BPEL4WS

[crs:NegativeCredit]

[bpws:getVariableData('loanOffe...]

[otherwise]

receiveInputassign2 Process_2

assign3

assign4

invokeUnitedLoan receive_invokeUnitedLoan

invokeStarLoan receive_invokeStarLoan

assign5

assign

<<switch>>

<<merge>> replyOutput

client

LoanFlow

creditRatingService

UnitedLoanService

StarLoanService

Page 35: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

35

Generate Sybase Integration Orchestrator Model

• Define IO specific Business Process Model in PowerDesigner

• Generate IO model

• Refine IO model

Define Requirements

Analyze and Design

Business

Define IO Specific Model

Generate IO Model

Refine the Model with IO

[Business Error]

checkProductAvailability

submitOrder

receiveOrder sendOrderStatus<<Map>>setStatus

[Yes]

[False][False]retrieveProductInfo <<Single Rule>>

Is Product Available

<<Fault>>

<<Assign>>setProductId

<<Assign>>setProductDescription

<<Assign>>setSysErrorCode

<<Assign>>setSysErrorMessage

<<Assign>>setInvErrorCode

<<Assign>>setInvErrorMessage

<<Single Rule>>

<<Fault>>

Page 36: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

36

Support ebXML BPSS

• Design, generate and reverse engineer ebXML Business Process Specification Schema (BPSS)

• Generate Private Process Options for Process Server

• Process Server can import the generated ebXML BPSS.<<BinaryCollaboration>>

OrderCollaborationCO

sellerbuyer

buyer seller

[Business Error]

<<BusinessTransactionActivity>>

OrderBTA

<<BusinessTransactionActivity>>

ShippingNoticeBTA

<<BusinessTransactionActivity>>

PaymentNoticeBTA

Page 37: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 与对象建模

Page 38: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

38

Why Using UML?

• Visually define and communicate the structure and behavior of an application

• Represent systems using Object-Oriented concepts

• Link OO concepts to executable code

Page 39: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

39

Brief Overview of UML

• UML is defined by OMG.• UML consists of 9 diagrams:

– Static– Class diagram– Object diagram

– Dynamic– Use Case diagram– Sequence diagram– Statechart diagram– Collaboration diagram – Activity diagram

– Implementation– Component diagram – Deployment diagram

Page 40: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

40

UML Support in PowerDesigner

• PowerDesigner supports all nine UML diagrams

• PowerDesigner supports UML 1.4

• Future version of PowerDesigner will support UML 2.0

Page 41: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

41

Use Case Diagram

• A Use Case Diagram describes the Actors, the Use Cases and the interaction between the Actors and the Use Cases.

<<includes>>

<<includes>>

Logon

Logoff

CustomerShip To Address

Purchase

Display Catalog

List Orders

List Cart

News

Shipping

Page 42: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

42

Collaboration Diagram

• A Collaboration Diagram describes the interaction between objects (instance of classes) by exchanging messages.

• Collaboration Diagram can be used to identify classes and operations

2.2: OK

1: Login

Customer<<JSP>>

Main page

<<Servlet>>

Validate Login<<Servlet>>

Display Catalog

4: Purchase

2.2: OK

3: Product List

2.1: Error

1: Login

Customer

<<JSP>>

Main page

<<Servlet>>

Validate Login

Display Error

<<Servlet>>

Display Catalog

Add in Shopping Cart

Page 43: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

43

Sequence Diagram

• A Sequence Diagram describes the interaction between objects and how the messages are exchanged over time.

• Sequence Diagram is used to identify classes and operations

open

4: Purchase

2.2: OK

3: Product List

2.1: Error

1: Login

<<JSP>>

Main page

<<Servlet>>

Validate Login Display Error<<Servlet>>

Display Catalog Add in Shopping Cart

Customer

Page 44: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

44

Activity Diagram

• An Activity Diagram describes the logic and the control flow of a Use Case, an Operation or another Activity.

[No]

[Yes]

Main Page

Login

Display Catalog

Purchase

Select Product

OK?Login Error

Purchase Products Action Steps

Check Out

Page 45: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

45

Statechart Diagram

• A Statechart Diagram is used to model the States and Transitions of a Class

Intial

Play

Pause

Page 46: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

46

Object Diagram

• An Object Diagram shows the relationships between Object Instances

:Customer

idname

= 101 = "XiaoYun Wang"

:Order

iddate

= 1 = 3/25/2004

Page 47: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

47

Class Diagram

• A Class Diagram defines the Classes, Interfaces, Attributes, Operations, Relationships, Inheritances, …

• A Class Diagram can be used to define persistent objects, control objects and user-interface objects.

• A Class Diagram can be used to generate the Physical Data Model and the application implementation code.

0..*peripheral

0..1personalcomputers <<Persistent>>

parallelPeripheral

+++

periphIdperiphCodeNamevendorName

: String: String: String

++++

registerPeriph ()testPort ()testPwSupply ()testMotherBd ()

: void: void: void: void

printer

++

laserprintSpeed

: boolean: int

+ printPage () : void

scanner

++

flatBedresolution

: boolean: int

+++++

preview ()registerPeriph ()testPort ()testPwSupply ()testMotherBd ()

: void: void: void: void: void

Peripheral

++++

registerPeriph ()testPort ()testPwSupply ()testMotherBd ()

: void: void: void: void

peripheral tester

+++

test #testNametestDate

: int: String: java.util.Date

+ printReport () : void

Computer

++

serial #ownerName

: String: String

Page 48: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

48

Component Diagram

• A Component Diagram can be used to define the components you need to create for an application

• A Component can use Classes, Interfaces

• PowerDesigner uses Components to represent EJBs, Servlets, JSPs, ASPs and Web Services

Product

EntityBean_CMP

GetProductList

Servlet

GetProductPageJSP

Page 49: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

49

Deployment Diagram

• A Deployment Diagram is used to define the deployment architecture

• Deployment Diagram shows the Nodes (machines, servers), the Component Instances deployed in a Node and the Links between Nodes

<<J2EE Server>>

Jaguar

easerver.sybase.comCustomerBeanOrderBeanProductBean

<<Web Service>>Web Service158.126.19.3

<<Database>>CRM

Page 50: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

50

Object/Relational (O/R) Mapping

• Generate a Class Diagram from a Physical Data Model with O/R mapping

• Generate a Physical Data Model from a Class Diagram with O/R mapping

• Manually define complex O/R mapping

• Generate select, insert, update, delete SQL statements

• Use O/R mapping to generate EJB CMP (WebLogic, WebSphere, EAServer), JDO, Cocobase, .NET (future)

Page 51: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

51

O/R Mapping Example

Generate O/R mapping when generating a PDM from an OOM

Use O/R mapping to generate SQL

Page 52: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

52

Java Support

• Provide wizards to automatically create EJBs, Servlets, JSPs, Web Services

• Generate and reverse engineer Java code

• Generate collection management accessor functions

• Generate deployment descriptors

• Generate O/R mapping descriptor for WebLogic, WebSphere, EAServer, JDO, JBoss (future)

• Generate project files for JBuilder and Eclipse

• Generate Ant script to compile, package and deploy J2EE application

Page 53: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

53

<<EJBEntity>>CustomerBean

{abstract}

-----

idnameemailphoneejbContext

: java.lang.Integer: java.lang.String: java.lang.String: java.lang.String: EntityContext

++++++++

<<Constructor>> CustomerBean ()ejbActivate ()ejbLoad ()ejbPassivate ()ejbRemove ()ejbStore ()setEntityContext (..)unsetEntityContext ()

: void: void: void: void: void: void: void

<<EJBPrimaryKey>>

CustomerPK

- id : java.lang.Integer

+++

<<Constructor>> CustomerPK ()equals (..)hashCode ()

: boolean: int

<<EJBRemote>>

Customer

<<EJBLocal>>

CustomerLocal

<<EJBRemoteHome>>

CustomerHome

+ <<EJBFinderMethod>> findByPrimaryKey (..) : Customer

<<EJBLocalHome>>

CustomerLocalHome

+ <<EJBFinderMethod>> findByPrimaryKey (..) : CustomerLocal

Example of EJB

EJB wizard

EJB Classes and Interfaces

Customer

EntityBean_CMP

EJB Component

Page 54: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

54

.NET Support

• Reverse engineer C# and Visual Basic .NET code

• Reverse engineer .NET binary code in C# or VB .NET

• Generate C# and VB .NET code

• Generate collection management accessor functions

• Generate Visual Studio .NET project files

• Create Web Services for C# or VB .NET (.asmx files)

Page 55: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

55

Code Generation

• Templates and macros based code generator

• Generate Java, C#, VB .NET, VB, C++, PowerBuilder, …

• User could add their own code generation templates

C# code preview

Page 56: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 与数据建模

Page 57: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

57

PowerDesigner Data Modeling Overview

• No.1 Data Modeling Tool

• PowerDesigner separates data modeling in Conceptual Data Model (CDM) and Physical Data Model (PDM)

• PowerDesigner uses Entity-Relationship (ER) notation for CDM

• A CDM is independent of database

• A CDM can generate several PDMs

• A PDM is database specific

Conceptual Data Model

Domain Specific Physical Data

Model

PDM for Oracle

PDM for Sybase

PDM for SQL Server

PDM for MySQL

High-Level Data Model

Logical Data ModelOracle

Sybase

MySQL

SQL Server

Page 58: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

58

PowerDesigner Conceptual Data Model

• Use Entity-Relationship (ER) notation.

• Support Business Rules, Domains, Data Items, Inheritances and Relationships.

• A CDM can generate one or several PDMs.

• After a PDM is generated, users can denormalize and optimize a PDM, change the CDM again and regenerate the PDM. PowerDesigner will use the Merge Model function to resolve conflicts

Page 59: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

59

Example of a Conceptual Data Model

composes0..n

composed of0..n

Subcontract1..1

0..n

0..n

Uses0..n

1..1 0..n

Is manager of0..1

0..n

supervises0..1

0..n

0..n

Is member of1..n

1..1

1..n

1..1

0..n

1..1

1..n

Division

Division numberDivision nameDivision address

<pi>

Idtf_1 <pi>

Employee

Employee numberFirst nameLast nameEmployee functionEmployee salary

<pi>

Idtf_2 <pi>

Customer

Customer numberCustomer nameCustomer addressCustomer activityCustomer telephoneCustomer fax

<pi>

Idtf_3 <pi>

Project

Project numberProject nameProject label

<pi>

Idtf_4 <pi>

Team

Team numberSpeciality

<pi>

Idtf_5 <pi>

Task

Task nameTask cost

<pi>

Idtf_6 <pi>

Material

Material numberMaterial nameMaterial type

<pi>

Idtf_7 <pi>Participate

Start date (par)End date (par)

Activity

Start date (act)End date (act)

Page 60: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

60

PowerDesigner Physical Data Model

• Supports more than 45 major databases

• Supports Logical Data Model using the <Logical Model> DBMS

• Supports indexes, keys, stored-procedures, triggers, views, referential integrity

• Supports permissions and synonyms

• Supports denormalization (split tables, merge tables, copy columns) for optimizing performance

• Generate and reverse engineer database

• Synchronize database with PDM (modify database or modify PDM)

• Estimate database size

• Test data generation

Page 61: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

61

PowerDesigner Physical Data Model

• View data

• Data Warehouse modeling– Star schema, Snowflake schema

– Multi-dimension diagram (cubes)

– External data source

• Import/export PowerBuilder extended attributes

• Generate Object-Oriented Model with O/R mapping

• Import Object-Oriented Model and generate O/R mapping

• Generate XML Model

Page 62: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

62

Example of a Physical Data Model

emp_id = sales_rep

code = fin_code_id

id = cust_id

id = prod_id

id = id

code = code

emp_id = dept_head_id

dept_id = dept_id

sales_order

idcust_idorder_datefin_code_idregionsales_rep

integerintegerdatechar(2)char(7)integer

<pk><fk3>

<fk2>

<fk1>

sales_order_items

idline_idprod_idquantityship_date

integersmallintintegerintegerdate

<pk,fk2><pk><fk1>

customer

idfnamelnameaddresscitystatezipphonecompany_name

integerchar(15)char(20)char(35)char(20)char(16)char(10)char(12)char(35)

<pk>

fin_code

codetypedescription

char(2)char(10)char(50)

<pk>

fin_data

yearquartercodeamount

char(4)char(2)char(2)numeric(9)

<pk><pk><pk,fk>

product

idnamedescriptionsizecolorquantityunit_price

integerchar(15)char(30)char(18)char(6)integernumeric(15,2)

<pk>

department

dept_iddept_namedept_head_id

integerchar(40)integer

<pk>

<fk>

employee

emp_idmanager_idemp_fnameemp_lnamedept_idstreetcitystatezip_codephonestatusss_numbersalarystart_datetermination_datebirth_datebene_health_insbene_life_insbene_day_caresex

integerintegerchar(20)char(20)integerchar(40)char(20)char(16)char(10)char(10)char(2)char(11)numeric(20,3)datedatedatechar(2)char(2)char(2)char(2)

<pk>

<fk>

Page 63: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 与 XML 建模

Page 64: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

64

XML Model

PowerDesigner 10 introduces a new XML Model Design, generate and reverse engineering XML Schema and

DTD Special diagramming tool

Horizontal and vertical styles

Graphical tools for tree diagram

Expand and collapse nodes

Preview XML Schema or DTD Convert XML Schema to DTD and DTD to XML Schema Define mapping between XML Model, PDM and OOM Generate XML Model from PDM or OOM

Page 65: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

65

Example of a XML Model

Page 66: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 的共同功能

Page 67: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

67

PowerDesigner 的共同功能

• Compare and merge models

• Free Model

• Complete Model-Driven Architecture (MDA) support for all models

• Report generation

• Repository

• Profile

• Code generation

• VBScript

• OLE automation

Page 68: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

68

Compare and Merge Models

• The model merge window is used when generating model, generating database, reverse engineer database, consolidate model in repository, …

Page 69: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

69

Model-Driven Architecture (MDA)

Model-Driven Architecture (MDA) is defined by OMG Main ideas:

Separating specification with implementation Specifying a system that is independent of a platform Transforming a platform independent system specification into

a specific platform Code generation

PSM 1

PSM 2

PIM

PSMTransformation

Rverse Transformation

Transformation

Transformation

Rverse Transformation

PIMTransformation

Code

Code

Page 70: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

70

Complete MDA Support for All Models

Extend metamodel using profile for all models Stereotype and criteria Extended Object, Extended Link and Extended Collection for all models Events handlers Custom commands

Model-to-Model generation Model transformation script

Code generation Code generation templates GTL language (macros) VBScript

New

New

New

Page 71: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

71

Report Generation

• Generate complete report in HTML, RTF formats

• Support English, French, Chinese, …

Page 72: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

72

Repository

• PowerDesigner has an enterprise repository for model sharing and versioning– Consolidation/Extraction of Models and other non-

PowerDesigner files

– Object level versioning

– Branching, Configuration

– Security

– Comparing versions

– Use relational database

Page 73: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

73

Profile (Extended Model Definition)

• Similar to UML Profile; applies to all models• Can be used to extend an existing model type• Stereotype and criteria• Extended attributes, objects and collections• Code generation templates

– Generation Template Language (templates & macros)

• Custom symbols• Custom tool palette• Custom checks• Custpom popup menus

Page 74: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

74

Code Generation

• Code generation templates

– Generation Template Language (templates & macros)

• All PowerDesigner code generators are defined as templates (Java, C#, VB .NET, PB, ebXML, BPEL4WS, SQL, XML, …)

• You could modify existing code generation or define your own code generation

Page 75: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

75

VBScript

• You can use VBScript to control PowerDesigner (query objects attributes and collections, create objects, import/export models, generate code, generate reports, …)

• You can define menu items to launch VBScripts

• You can use VBScripts to define model transformation

• You can use VBScripts to define Design Patterns

• There is a VB Script samples directory

Page 76: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

76

OLE Automation

• OLE automation can be used by a program outside of PowerDesigner

• You can use any language (VB, VBA, VB .NET, C#, PB, C++, JavaScript, Java, …) that supports COM to work with PowerDesigner

• You can create your own user-interface

• There is an OLE automation samples directory

Page 77: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 10.0 的新功能

Page 78: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

78

PowerDesigner 10.0 的新功能

Business Process Simulation using Simul8 Service-Oriented Architecture (SOA) Round-trip .NET Support Complete MDA support New XML Model Support Pocket PowerBuilder 1.5 Integration with PowerBuilder 10 (V10.1) Integration with Eclipse (V10.1) Other Improvements

Available February 9, 2004

Page 79: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

79

Integration with PowerBuilder

Support Pocket PowerBuilder 1.5 Reverse engineer Pocket PowerBuilder 1.5 code Design and generate Pocket PowerBuilder code using Class

Diagram

Plugin for PowerBuilder 10 (V10.1, April 2004) Integrate PowerDesigner 10.0 into PowerBuilder 10.0 IDE Create a Class Diagram from a PowerBuilder target Navigate Between Class Diagram and PowerBuilder

browser Open PowerBuilder painter from Class Diagram Regenerate PowerBuilder application

Page 80: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

80

Example of PowerDesigner Plugin for PowerBuilder 10

Page 81: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

81

Integration with Eclipse

Plugin for Eclipse (V10.1, April 2004) Run PowerDesigner inside Eclipse IDE Support all type of models (CDM, PDM, OOM, Business

Process Model, XML Model) Synchronize Java code with Class Diagram Generate Java, EAServer Web Service and IO projects Automatically import or refresh generated Java project or

IO project

Page 82: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

82

Example of PowerDesigner Plugin for Eclipse

Page 83: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

83

Other Improvements

Support IDEF1X notation Bitmap join index for Oracle Multiple databases for DB2 Support Apache Axis Support EAServer 5.0 Composite view for process, package Committee process symbol Improve ebXML support Support PNG image format in report …

Page 84: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 与模型驱动开发

Page 85: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

85

模型驱动开发

• How to use PowerDesigner Business Process, UML and Data models in application analysis and design?

• Some software engineer processes are too complex (RUP, CMM, …)

• Each company should carefully select a process and adapt it to its own needs based on– Type of application

– Size of team

– …

Page 86: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

86

A Typical Process for Developing New Application with PowerDesigner

Define the architecture of the system using BPM or Free Model

Define a detailed Business Process Model

Use simulation to optimize the Business Process

Analyze the new systems using UML

Design the new systems using UML

Create the database

Define components using UML

Assemble the services using BPM

Create User-Interface uisng an IDE

Generate a Physical Data Model

Generate the code from UML

Use an IDE to develop and test the code

Page 87: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

87

Example of How to Use UML for a New Application

• Define Use Case Diagram– Identify classes

• Define Collaboration Diagram and/or Sequence Diagram– Identify classes and operations

• Design Class Diagram

• Generate a report and use the report as a specification

• Generate a Physical Data Model with O/R mapping

• Optimize the PDM

• Generate the Database

• Define classes implementation in Class Diagram

• Generate the code and O/R mapping

• Use an IDE to finish the implementation, compile and test

• Reverse engineer the code to update the UML model

Page 88: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

88

Example of How to Use UML for an Existing Application

• Reverse engineer existing code to create a Class Diagram

• Reverse engineer existing database to create a PDM

• Understand the existing application’s logic

• Define Use Case Diagram

• Define Collaboration Diagram and/or Sequence Diagram

• Improve Class Diagram

• Generate a report and use the report as a specification

• Modify the Database

• Improve classes implementation

• Generate the code and O/R mapping

• Use an IDE to finish the implementation, compile and test

• Reverse engineer the code to update the UML model

Page 89: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

PowerDesigner 的路线图

Page 90: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

90

PowerDesigner 的路线图

PowerDesigner 10.0• Strong BP Modeling• IO support• Round-trip .Net support• Complete MDA support• XML model• Pocket PowerBuilder support

Beyond Minerva

• Improved enterprise features

• UML 2.0

• Use MDA to generate complete application

• Design Pattern

Advanced BP Modelingrelease

Advanced Enterprise Modeling release

Q4 2003 Q1 2004 1H 2004 2H 2004 2005

10.1PowerBuilder 10 &Eclipse Plugins

PowerDesigner Minerva• Process decomposition diagram• Requirements management• Impact analysis• XML & Web Service in databases• Replication Server support• MobiLink support• Support J2EE 1.4• Integration with Visual Studio .NET• Enhancements for existing features• Support Unicode

Enterprise Modelingrelease

Page 91: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

91

结论

PowerDesigner 10.0 有更大的整合式建模功能 使用 PowerDesigner 可以大大缩短开发时间 PowerDesigner 10.0 是全球最好的整合式建模工具

Page 92: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

92

More Information

Microsoft Windows Script online help Can be downloaded from http://msdn.microsoft.com

PowerDesigner VBScript online help Accessible from PowerDesigner help menu

PowerDesigner Advanced Documentation Accessible from PowerDesigner help menu

OLE Automation samples OLE Automation\*.*

PowerDesigner Metamodel Examples\MetaModel.oom

Page 93: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

93

More Information

PowerDesigner 网站 :– http://www.sybase.com/products/enterprisemodeling/powerdesigner

Sybase China PowerDesigner 网站 :– http://www.sybase.com.cn

CodeXChange:– http://powerdesigner.codexchange.sybase.com

Newsgroup: news://forums.sybase.com/sybase.public.powerdesigner.general

Page 94: UML China  讲座 All-in-One Design Tool PowerDesigner10.0 与模型驱动开发

UML China 讲座All-in-One Design Tool

PowerDesigner10.0 与模型驱动开发

王晓昀 PowerDesigner 首席架构师[email protected]

2004 年 3 月 25 日