slide1 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
E185 PowerDesigner for Java PowerPoint Presentation
Download Presentation
E185 PowerDesigner for Java

Loading in 2 Seconds...

play fullscreen
1 / 56

E185 PowerDesigner for Java - PowerPoint PPT Presentation


  • 675 Views
  • Uploaded on

E185 PowerDesigner for Java. Xiao Wang PowerDesigner Chief Architect EBD xwang@sybase.com. PowerDesigner for Java: Brief Overview of the UML Overview of the PowerDesigner Object-Oriented Model Building an OOM for Java Creating Servlets and JSPs Defining O/R Mapping and Creating EJBs

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'E185 PowerDesigner for Java' - hop


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

E185PowerDesigner for Java

  • Xiao Wang
    • PowerDesigner Chief Architect
    • EBD
    • xwang@sybase.com
powerdesigner for java overview
PowerDesigner for Java:

Brief Overview of the UML

Overview of the PowerDesigner Object-Oriented Model

Building an OOM for Java

Creating Servlets and JSPs

Defining O/R Mapping and Creating EJBs

Creating Web Service Components

Reporting and Repository

Conclusion

PowerDesigner for Java Overview
brief overview of uml
Brief Overview of UML
  • Why Use Object-Oriented Modeling?
    • Visually define and communicate the structure and behavior of a software system
    • 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
brief overview of uml4
Brief Overview of UML
  • The UML consists of 9 diagrams:
    • Static
      • Class and Object diagrams
    • Dynamic
      • Use Case, Sequence, Statechart, Collaboration and Activity diagrams
    • Implementation
      • Component andDeployment diagrams
class diagram in uml
Class Diagram in UML
  • Classes and Interfaces
    • attributes, operations, constructors, accessors
  • Relationships
    • Generalizations (Inheritances), realizations, associations and dependencies
component diagram in uml
Component Diagram in UML
  • Components
    • Classes, Interfaces, Operations
    • Component type (Standard, Servlet, EJBs, Web Service)
  • Dependencies, Generalizations
the powerdesigner object oriented model
PowerDesigner V9.5 OOM supports all the 9 UML diagrams.

PowerDesigner OOM supports the following languages:

Java, C#, VB .NET, C++, PowerBuilder, IDL, VB6, XML and WSDL

For Java, PowerDesigner V9.5 supports:

Round-trip Java generation/reverse engineering

Servlet, JSP, EJB including O/R mapping

Web Services

The PowerDesigner Object-Oriented Model
building 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

Building an OOM for Java
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

Defining Packages
defining classes
Generated Code:Defining Classes

/*************************************************

* 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

defining generalizations
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)

defining operations
Defining Operations
  • Create operations
  • Generate default constructor, static initializer
  • Generate default getters and setters
  • Add operations defined in a parent classes or interfaces
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

Defining Associations
defining interfaces
Defining Interfaces
  • Generated Code:

package Product;

import java.util.*;

public interface IItem

{

int getItemNumber();

java.lang.String getItemName();

double getItemPrice();

}

The IItem Interface

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 Item Class

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.

Object Reuse in PowerDesigner
editing the java code in an ide
PowerDesigner does not generate complete code for all methods.

Users need to implement the methods using PowerDesigner or an IDE (JBuilder, Visual Café, …)

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.

Editing the Java Code in an IDE
generating the java code24
Generating the Java Code
  • You could compile the Java code, generate Java doc and deploy components in an Application Server.
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

Reverse Engineering Java Code
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

Iterative Round-Trip Engineering
creating servlets and jsps
Creating Servlets and JSPs
  • Creating Servlets
    • Use Component and Class to represent a Servlet
  • Creating JSPs
    • Use File object to represent a JSP
creating servlets
Creating Servlets
  • Use the Create Servlet wizard to create a Servlet
  • Implement the Servlet code
  • Compile and deploy

Servlet component

Servlet class

creating servlets29
Creating Servlets
  • Implementing the Servlet methods
creating servlets30
Creating Servlets
  • Generate Servlet code and Web Deployment Descriptor
  • Compile and create the .WAR file
  • Deploy the .WAR file
creating jsps
Creating JSPs
  • Use the Create JSP wizard to create a JSP
  • Implement the JSP code
  • Generate and deploy the .WAR file
creating jsps32
Creating JSPs
  • Implementing the JSP code using the internal editor or an external editor (DreamWaver, …)
defining o r mapping and creating ejbs
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
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

Designing the Database
example of a pdm for sybase sql anywhere
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;

objects from legacy systems
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 (new applications) around legacy data stores

Generate the O/R mapping

Iterative:

Build, generate and synchronize models as the application takes shape

Objects from Legacy Systems
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

Defining the Object/Relational Mapping
example of the o r mapping
Example of the O/R Mapping
  • O/R mapping syntax for Sybase EAServer:
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

Java in the Database (RDBMS)
creating enterprise java beans ejbs
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.
creating a container managed persistence cmp ejb
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
example of a cmp ejb
Example of a CMP EJB
  • Example of the EJB wizard:

The EJB component

The Bean class

generating ejbs
Generating EJBs
  • Use Tools>Generate Java Code to generate EJBs
  • Select the tasks to perform after the code generation
creating web services
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
creating web services for java
Creating Web Services for Java
  • For Java, PowerDesigner V9.5 supports:
    • Servlet Web Service using JAXM
    • Java Web Service using JAXRPC
    • 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
creating a servlet web service
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
create a web service component using jaxrpc
Create a Web Service Component Using JAXRPC
  • 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
deploy ejbs as web service components
Deploy EJBs as Web Service Components
  • PowerDesigner will use the « J2EE for Web Services » (JSR109) specification to generate deployment descriptor and .EAR file to deploy Stateless Session Beans as Web Services.
  • The specification is not finalized yet.
  • EAServer 5.0 will support JSR109.
browse uddi to search web services
Browse UDDI to Search Web Services
  • PowerDesigner V9.5 provides a UDDI browser to allow users to search Web Services (search WSDL)
import wsdl
Import WSDL
  • PowerDesigner V9.5 imports WSDL files or URLs (found in UDDI)
  • PowerDesigner creates Web Service component from the WSDL
extending powerdesigner s java support
Extending PowerDesigner’s Java Support
  • Users could extend PowerDesigner’s Java support:
    • 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
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

Documentation and Reporting
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…)

Repository
conclusion
PowerDesigner for Java:

OO Analysis and Design for Java targets

Support all UML diagrams

Java code generation (Front End, Middle Tier, Database)

Persistence modeling with RDBMS specific PDM

Full Round-Trip Iterative Development of Applications (including persistence)

Documentation and Reporting for metadata analysis

Enterprise repository for team work

Scalable to the Enterprise

Conclusion
more information
More information!
  • Other sources of PowerDesigner Information
  • Best Practices in Object-Oriented Modeling Using PowerDesigner (E188)
  • Web Services in PowerDesigner (E187)
  • PowerDesigner Business and Object Modeling (E182)
  • CocoBase, EAServer and PowerDesigner (E141)
  • PowerDesigner: Supporting the Enterprise (E183)
  • Enterprise Modeling Overview for IT Managers (E186)
  • Database Modeling Tips & Tricks (E185)
  • Exhibit Hall Booth
  • http://www.sybase.com/powerdesigner/
    • Whitepapers, Newsgroup, knowledgebase, and evaluation copies of the tool available for download