Presentation is loading. Please wait.

Presentation is loading. Please wait.

EN04 Object-Oriented Modeling with PowerDesigner 9.5 Xiao Wang PowerDesigner Chief Architect, EBD

Similar presentations


Presentation on theme: "EN04 Object-Oriented Modeling with PowerDesigner 9.5 Xiao Wang PowerDesigner Chief Architect, EBD"— Presentation transcript:

1 EN04 Object-Oriented Modeling with PowerDesigner 9.5 Xiao Wang PowerDesigner Chief Architect, EBD xwang@sybase.com

2 Agenda Introduction to modeling Brief Overview of Object-Oriented Modeling and UML PowerDesigner 9.5 overview Designing an Object Model for a Java application Creating J2EE components Creating Web Service Components Creating.NET applications Reporting and Repository Conclusion

3 Why Modeling? 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 optimise it based on technical constraints

4 History of Modeling & Design Modeling techniques has been created a while ago under the name CASE (Computer Aided Software Engineering) What is recognized has effective modeling and design today?  Database Modeling (Data Modeling), using E/R (Entity/Relationship) techniques (standard), for IT users  Application Modeling using UML (Unified Modeling Language) techniques (standard), for IT users  Business Process Modeling using emerging techniques, for non IT users

5 Problem Statement How to effectively model business-driven application? Different techniques (E/R, UML, BP Modeling) have forced corporations to buy different tools, raising communication and co-ordination issues between business analysts, IT analysts & designers and application developers Lack of common framework to store and manage models and design induce inconsistencies across applications and reduces ability to re-use existing software Heritage from CASE and complexity of techniques and tools generate high costs in learning curve

6 Our Vision An Enterprise Modeling and Design solution  That will empowers our customers to model software that meets the needs of end users  Fits the description of the business processes  Enable IT users to perform analysis and design, and application development

7 Brief Overview of Object-Oriented Modeling Why Use Object-Oriented Modeling?  Visually define and communicate the structure and behavior of an application  Represent systems using OO concepts Abstraction: Describe using relevant characteristics Encapsulation: Combine Data and Methods Inheritance: Supertype/Subtype Polymorphism: Overloading and Overriding  Link concepts to executable code

8 Brief Overview of UML UML is defined by OMG. UML consists of 9 diagrams :  Static Class and Object diagrams  Dynamic Use Case, Sequence, Statechart, Collaboration and Activity diagrams  Implementation C omponent and Deployment diagrams

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

10 Activity Diagram An Activity Diagram describes the logic of a Use Case, a function or another Activity.

11 Collaboration Diagram A Collaboration Diagram describes the interaction between objects by exchanging messages.

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

13 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 implementation code.

14 Example of a Class Diagram in PowerDesigner

15 Component Diagram A Component Diagram can be used to define the components we need to create for an appliacation A Component can be using Classes, Interfaces, Operations EJBs, Servlets, JSPs and Web Services can be represented as Components

16 Object-Oriented Modeling Best Practices >Create an Analysis Object-Oriented Model (OOM) first >Create Use Cases >Create Collaboration Diagrams (identify classes) >Create Sequence Diagrams (identify classes, operations) >Create Architecture Diagram using Collaboration Diagram or the Free Model >Create Class Diagram >Generate an Implementation OOM or refine the analysis OOM >Create implementation components (EJBs, Servlets, Web Services) >Generate the code >Complete the code with an IDE >Reverse engineer the code to synchronize the model

17 Repository Source Sybase Repository Business centric IT centric PowerDesigner 9.5 Overview Architecture and Summary of Features Development Analysis & Design Business Analysis Business-centric Control Flow diagram Entity/ Relationship modeling (and DW extensions) UML modeling (all diagrams) RDBMS structures Object Relational mapping Java,.Net, XML, PB... support IDEs & App Server support Templates, Generic Generators, UML profiles, model-to-model generation…

18 PowerDesigner What’s new in 9.5 (1/3) Data Modeling  Database denormalization (table split or merge, copy columns) UML/Object modeling  Full UML support (all 9 diagrams) Openness/Flexibility  UML profile (sophisticated stereotypes): extension of meta classes, customs symbols, custom checks, extended attributes, templates…  Model to model generation (logical model, several level of abstraction)  ‘Free Model’ – graphical model customizable BP Modeling  Custom symbols, data (entity & items), swimlanes, CRUD matrix, CDM generation from BP Model

19 PowerDesigner What’s new in 9.5 (2/3) Enhanced Web Services support  Design and reverse-engineer (UDDI browser for meta data extraction) Web Services  Deploy for Java and.NET Enhanced J2EE support  Servlet & JSP General improvements  VBScript (repository, reports)  Repository (logs and better property sheets)  Custom symbols (shape, gradient, bitmap)  Improved HTML report generator

20 PowerDesigner What’s new in 9.5.1 (3/3) Improve Web Services support (Web Services deployment for J2EE (JSR109 specification)) Support new application servers (IBM WebSphere 5.0, BEA WebLogic 7, Apache Tomcat 4) Integration with IDEs (JBuilder 7, Ant) Support PowerBuilder 9.0

21 The PowerDesigner Object-Oriented Model The PowerDesigner 9.5 OOM supports:  All the 9 UML diagrams.  Java, C#, VB.NET, C++, PowerBuilder, IDL, VB6, XML and WSDL  Round-trip Java generation/reverse engineering  EJB including O/R mapping, Servlet, JSP  Web Services for Java and.NET  Data Model generation  O/R mapping

22 Designing an OOM for Java Create a Class Diagram Design packages, classes, interfaces, attributes, operations, … Preview the Java code Implement the Java methods using an IDE Generate the Java code Reverse engineer Java classes Iterative round-trip engineering

23 Defining Packages Packages in UML:  A logical container for objects that belong together  Provides a way to partition and manage work  Provides namespace scope for objects Packages in Java:  Directory structure containing objects Classes are known by their Package (path) and class name Packages in PowerDesigner:  Add model management capabilities  Ideally a container for related objects

24 Defining Classes Generated Code: /************************************************* * Module: Item.java * Author: xwang * Modified: Friday, June 28, 2002 11:39:00 AM * Purpose: Defines the Class Item *************************************************/ package Product; import java.util.*; public class Item { public int itemNumber; public java.lang.String itemName; public double itemPrice; public int getItemNumber() { return itemNumber; } public java.lang.String getItemName() { return itemName; } public double getItemPrice() { return itemPrice; } The Item Class

25 Defining Generalizations >Generated Code: /************************************************* * Module: Product.java * Author: xwang * Modified: Friday, June 28, 2002 11:39:00 AM * Purpose: Defines the Class Product *************************************************/ package Product; import java.util.*; public class Product extends Item { public java.lang.String category; public java.lang.String getCategory() { return category; } /** @param newCategory */ public void setCategory(java.lang.String newCategory) { category = newCategory; } Generalization (Inheritance)

26 Defining Attributes

27 Defining Operations Create operations Generate default constructor, static initializer Generate default getters and setters Add operations defined in a parent classes or interfaces

28 Implementing an Operation

29 Defining Associations Associations are the relationships between classes Implementation depends on the definition of:  Multiplicity: Is this a single reference or array?  Navigability: Is there a reference variable?  Visibility: Visibility of the reference variable  Role Names: Name given to the reference variable

30 Defining Interfaces >Generated Code: package Product; import java.util.*; public interface IItem { int getItemNumber(); java.lang.String getItemName(); double getItemPrice(); } package Product; import java.util.*; public class Item implements IItem { public int itemNumber; public java.lang.String itemName; public double itemPrice; public int getItemNumber() { return itemNumber; } … } The IItem Interface The Item Class

31 Object Reuse in PowerDesigner Shortcuts  PowerDesigner allows classes defined in one package or model to be reused in other packages and models via Shortcuts.  Shortcuts define an object that is outside the model or package in question. It acts like a pointer to the original object. Replication Objects (new in V9.5)  It is a copy of the original object. Users can modify the original objects and the replicated objects.

32 Preview the Java Code of a Class

33 Editing the Java Code in an IDE PowerDesigner does not generate complete code for all your methods. You have to implement them. Users need to implement the methods using PowerDesigner or an IDE (JBuilder, …) You can use the Edit With feature to launch an IDE. PowerDesigner will automatically copy the modified Java code back in the model and synchronize the model with the code.

34 Generating the Java Code You can select the objects you want to generate, the location and the generation options.

35 Generating the Java Code You could compile the Java code, generate Java doc and deploy components in an Application Server.

36 Develop, Deploy and Debug Using an IDE You can use an IDE or a text editor to implement the generated methods, compile the code, deploy the application and debug the application. PowerDesigner 9.5.1 generates a JBuilder 7 project file and an Ant build script that allow you to compile and deploy you application outside PowerDesigner.

37 Reverse Engineering Java Code Recover Java code  Reverse engineer from a.java or.class file  Select from individual files, a directory or an archive PowerDesigner can create a new OOM or extend an existing one  Understand existing Java applications  Capture a library for reference in other models  Synchronize a model with externally edited code

38 Iterative Round-Trip Engineering Build and test as the Design matures:  Create an OOM  Generate Java code and edit in an IDE  Reverse engineer the edited code to synchronize the Model  Modify the Model  Generate new code from the updated Model

39 Creating J2EE Components Creating Servlets  Use Component and Class to represent a Servlet Creating JSPs  Use Component and File object to represent a JSP Creating EJBs  Use Component, Classes and Interfaces to represent an EJB

40 Creating Servlets Use the Create Servlet wizard to create a Servlet Implement the Servlet code Compile and deploy Servlet component Servlet class

41 Creating Servlets Implementing the Servlet methods

42 Creating Servlets Generate Servlet code and Web Deployment Descriptor Compile and create the.WAR file Deploy the.WAR file

43 Creating JSPs Use the Create JSP wizard to create a JSP Implement the JSP code Generate and deploy the.WAR file

44 Creating JSPs Implementing the JSP code using the internal editor or an external editor (DreamWaver, …)

45 Defining O/R Mapping and Creating EJBs Designing the objects Designing the database for objects persistence Defining the O/R mapping Creating EJBs (Enterprise Java Beans) Generating EJBs and O/R mapping descriptor Deploy EJBs

46 Designing the Database PowerDesigner is also a very powerful Database Design tool Bi-level Database Design  Conceptual Data Model (CDM) Normalized, Implementation (RDBMS) independent  Physical Data Model (PDM) Database Specific: Generates DDL to a script or to database live via an ODBC connection

47 Example of a PDM for Sybase SQL Anywhere /*======================================================*/ /* Table: customer */ /*======================================================*/ create table DBA.customer ( id integer not null default autoincrement, fname char(15) not null, lname char(20) not null, address char(35) not null, city char(20) not null, state char(2) not null, zip char(10) not null, phone char(12) not null, company_name char(35), primary key (id) ); /*======================================================*/ /* Index: ix_cust_name */ /*======================================================*/ create index ix_cust_name on DBA.customer ( lname ASC, fname ASC ) with hash size 10;

48 Generating and Reverse Engineering Database PowerDesigner captures existing database structures and translates them to Java:  Reverse engineer the Database to a PDM  Generate an OOM (Java) from the PDM Gives Object Designers a view of existing database objects Jump-start to building Business Logic Generate the O/R mapping PowerDesigner can translate a class diagram into a PDM:  Generate a PDM (tables, columns, indexes, references, O/R mapping, …)  Optimize the database (triggers, tablespace, denormalization)  Generate the database

49 Defining the Object/Relational Mapping Generate O/R mapping when generating a PDM from an OOM Generate O/R mapping when generating an OOM from a PDM Customize the O/R mapping to support complex mappings Customize the O/R mapping syntax for each application server Support EJB-QL and stored-procedures

50 Example of the O/R Mapping O/R mapping syntax for Sybase EAServer:

51 Java in the Database (RDBMS) Use PowerDesigner to model Java in the Database:  Create OOM for Java Stored Procedures and Java Data Types  Create a PDM for the Database (Target your RDBMS)  Reuse objects from the OOM in the PDM as Data Types  Generate.java from the OOM to “import” to server to support Data Types and add Stored Procedures

52 Creating Enterprise Java Beans (EJBs) PowerDesigner supports CMP Entity Beans, BMP Entity Beans, Stateless Session Beans, Statefull Session Beans and Message Driven Beans. PowerDesigner generates the source code, the deployment descriptor and the O/R mapping descriptor. PowerDesigner could compile the code, create the JAR file, run J2EE verifier and deploy the JAR file. PowerDesigner supports Sybase EAServer, BEA WebLogic and Cocobase today. Support of other servers could be added by creating a profile.

53 Creating a Container Managed Persistence (CMP) EJB Create a package Create a class inside the package Generate or define the O/R mapping Use the Create Enterprise JavaBean wizard to create a CMP EJB Set properties (transaction, …) Implement additional business methods Verify the source code and the deployment descriptor Generate the code, compile, verify and deploy

54 Example of a CMP EJB Example of the EJB wizard: The EJB component The Bean class

55 Generating EJBs Use Tools>Generate Java Code to generate EJBs Select the tasks to perform after the code generation

56 Creating Web Services PowerDesigner V9.5 supports:  Creating Web Services components for Java and.NET  Generating server side code for Java and.NET  Generating client proxy code for Java and.NET  Browsing UDDI to find Web Services (WSDL)  Importig and generating WSDL

57 Creating Web Services for Java For Java, PowerDesigner V9.5 supports:  Java Web Service using JAXRPC  Servlet Web Service using JAXM  Generating server side code and client proxy using JAXRPC tool  Deploying EJBs as Web Services when the « Web Services for J2EE » (JSR109) specification will be finalized

58 Creating a Servlet Web Service Use the Create Web Service wizard to create a Servlet Web Service Select Java Servlet as the Component type Implement the onMessage() method Compile and deploy

59 Create a Web Service Component Using JAX-RPC Use the Create Web Service wizard to create a Web Service Select Standard as the Component type In the Java class, create one or several methods Indicate these methods as Web Method Implement these methods Generate the Java code:  In the generation window, select the XRPCC commands to generate server side and/or client side code

60 Example of the Generated WSDL

61 Deploy EJBs as Web Service Components PowerDesigner 9.5.1 uses the «J2EE for Web Services» (JSR109) specification to generate deployment descriptor and.EAR file to deploy Stateless Session Beans as Web Services. EAServer 5.0 will support JSR109.

62 Browse UDDI to Search Web Services PowerDesigner V9.5 provides a UDDI browser to allow users to search Web Services (search WSDL)

63 Import WSDL PowerDesigner V9.5 imports WSDL files or URLs (found in UDDI) PowerDesigner creates Web Service component from the WSDL

64 Creating.NET Applications With PowerDesigner 9.5, you can:  Create.NET applications for C# or VB.NET  Generate C#, VB.NET code  Compile C#, VB.NET code  Create Web Services for.NET  Create ASP.NET (ASPX) components  Use the.NET Framework library model  Future version will support reverse engineering for C# and VB.NET

65 Extending PowerDesigner’s Features Users could extend PowerDesigner’s features:  Use the template based generic generator (GTL) to generate other Java components (JDO, Ant build script, unit test programs, …)  Use VB Script or VBA to work directly with the PowerDesigner models (import, export, generate more complex code, …)  Use XMI import/export to integrate with other code generators

66 Documentation and Reporting PowerDesigner provides comprehensive reporting capabilities  Print Graphics to see model diagrams  Create Report to include objects metadata  Multi-model report to span all models in a workspace  Report Print Preview  Generate HTML or RTF reports  Multi-language support (English, Chinese, …)

67 Repository PowerDesigner has an enterprise repository for model sharing and management  Consolidation/Extraction of Models and other non- PowerDesigner files  Object level versioning  Branching, Configurations  Security  Open Database: (RDBMS vs. flat-file system) Write your own reports using SQL or other reporting tools (InfoMaker, Crystal Reports, etc…)

68 Conclusion With PowerDesigner 9.5, you can:  Create all UML diagrams  Analyse, design and develop Java or.NET applications  Generate the database and O/R mapping from your OO design  Support full Round-Trip Iterative development of Applications  Produce documents and reports for your OO design  Use the enterprise repository for team work and versioning PowerDesigner 9.5 is a complete enterprise modeling tool

69 More information Sybase China web site for PowerDesigner: http://www.sybase.com.cn/cn/content/goto.jsp ?resID=87 Sybase US web site for PowerDesigner: http://www.sybase.com/powerdesigner/  Whitepapers, knowledgebase, tech support, and evaluation copies News group: powersoft.public.powerdesigner.general SDN: http://www.sybase.com/developer


Download ppt "EN04 Object-Oriented Modeling with PowerDesigner 9.5 Xiao Wang PowerDesigner Chief Architect, EBD"

Similar presentations


Ads by Google