The Future of ModelDriven Development Wang Xiao-Yun (王晓昀) PowerDesigner Chief Architect, Engineering Director xwang@sybase.com Sybase Confidential Propriety. Sybase Confidential Proprietary. PowerDesigner研发创始人王晓昀 1978年上北京大学 1979年去法国上大学 1985年到法国SDP公司开发软件包 1988年开始用Windows 1.0编制AMC*Designor 1992年开始在美国出售S-Designor 1995年Powersoft买下SDP 1995年Sybase买下Powersoft S-Designor改名为PowerDesigner 从1995年到现在负责PowerDesigner的研究和开发 Sybase Confidential Proprietary. 2 议程 Why Model-Driven Development? Model-Driven Development Trends WorkSpace 简介 PowerDesigner 简介 Modeling Techniques (建模技术) Model-Driven Development Techniques (模型驱动开发) PowerDesigner Features WorkSpace Features Q&A Sybase Confidential Proprietary. 3 Why Model-Driven Development? Sybase Confidential Propriety. Sybase Confidential Proprietary. 为什么要使用模型驱动开发工具? (1/2) Would You Build a House Without a Blueprint? The Architect will do the first high level drawings to validate the concept, then make a detailed plan for the Builders The Builders will take this blueprint and optimize it based on technical constraints Sybase Confidential Proprietary. 5 为什么要使用模型驱动开发工具? (2/2) 用户的问题: 1. 怎样提高软件质量, 缩短开发周期, 并且方便维护? 2. 怎样提高投资回报率? 3. 怎样使软件更能够适应业务需求的变化? 解决办法: 软件应用系统的开发离不开应用设计,应用设计离不 开建模工具,好的建模工具可以帮助你提高应用软件 的质量,降低风险 PowerDesigner/WorkSpace就是一种这样的应用开 发设计工具。 Sybase Confidential Proprietary. 6 What’s Model-Driven Development? Model-Driven Development Define models, generate code from models instead of writing code by hand Modeling has evolved in the past years Still means traditional Analysis and Design, a-la CASE Tools Emergence of « Model-driven development » and «Model-Driven Architecture »: do more modeling, write less code Especially true for UML – two use cases: Analysis and Design – capture and specify business needs Visual coding – class and sequence diagrams used by code developer for better productivity In a nutshell, more technical modeling, but not more Analysis and Design. Sybase Confidential Proprietary. 7 What’s Model-Driven Architecture? Model-Driven Architecture (MDA) MDA is defined by Object Management Group (OMG) Platform Independent Model (PIM) Platform Specific Model (PSM) Model-to-Model Transformation (PIM->PIM, PIM->PSM, …) Code generation using templates or design patterns PIM UML Model Physical Data Model High-level Page Flow PSM Model Generator Code Code Generator Persistence Type Presentation Style JSP/Struts Java, EJB Visual Editors Profile Code Templates Style Templates Sybase Confidential Proprietary. 8 Model-Driven Development Trends Sybase Confidential Propriety. Sybase Confidential Proprietary. Model-Driven Development Trends Simplify Development Enterprise Modeling: Convergence of Business Process, UML and Data Modeling Integrated Analysis, Design and Development Standard IDEs Domain Specific Models Impact of Methodologies & Software Engineering Processes Impact of SOA Application Development Life Cycle Sybase Confidential Proprietary. 10 Simplify Development Several Ways to Simplify Development Simplify language (improve Java, .NET, new languages) EJB 3, O/R mapping with POJO, metadata annotation, Generics, … Aspect-Oriented programming, Ruby on Rails, … Design patterns Inversion of Control (IoC), Spring framework, … Visual Development Use Visual Editors instead of code editors Model-Driven Development Define models, use models to generate code Service-Oriented Architecture Expose functionalities as services, assemble services Sybase Confidential Proprietary. 11 Enterprise Modeling: Convergence of BP, UML and Data Modeling Business Process Modeling (企业流程建模) 企业用户, CIOs UML Modeling (面向对象建模) IT用户, 分析员, 设计师, 开发人员 Data Modeling (数据建模) IT用户, 分析员, 设计师, DBAs In the past, companies used different tools. It is difficult de manage common metadata and impact analysis. The three modeling techniques are converging. Sybase Confidential Proprietary. 12 Enterprise Modeling: Convergence of BP, UML and Data Modeling 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 research note December 2003 Sybase Confidential Proprietary. 13 Integrated Analysis, Design and Development Analysis & Design Development / Deployment Data Models (physical) Requirements Data Models (Conceptual) UML Models (technical) « Domain specific models » Process Models UML Models (High-level) Code ….. ….. ….. IT users Business users Repository Methodology – Impact Analysis Sybase Confidential Proprietary. 14 Standard Integrated Development Environments (IDE) For Java/J2EE Eclipse based (IBM WebSphere tools, Sybase WorkSpace, …) For .NET Visual Studio 2005 Other smaller IDEs PowerBuilder, JBuilder, Delphi, NetBean, … Sybase Confidential Proprietary. 15 Domain Specific Models Define a metamodel for a specific domain Define custom symbols Generate an API Generate a graphical editor Sybase Confidential Proprietary. 16 Domain Specific Model Tools Eclipse Modeling Framework (EMF) Metamodel for a specific domain Generate an API with XML serialization support Used by many products including Sybase WorkSpace Eclipse Graphical Modeling Framework (GMF) Define EMF metamodel Define graphical shapes and binding to objects Generate graphical editor as Eclipse plugin Microsoft Domain Specific Models (DSL) Define metamodel and graphical shapes Generate graphical editor as Visual Studio addin Sybase Confidential Proprietary. 17 Impact of Methodologies & Software Engineering Processes (软件工程) Methodologies RUP, Zachman, Six Sigma, … Software Engineering Processes CMMi, Agile, ITIL, … Modeling plays increasing role in all the methodologies and engineering processes. Sybase Confidential Proprietary. 18 Service-Oriented Architecture (SOA) Process_7 Application Assembling Process _5 Process _12 Process_ 6 Process_8 Platform independent Service Building Blocks Business Logic2 DataAccess Business Logic Process Portlet Implementation Artifacts Web Service Orchesration ASP_NET JSP .NET .NET Java Sybase Confidential Proprietary. Query Web Service EJB App Server Platform dependent Process Server Portal Data Data Manager Manager Database 19 Impact of SOA Business view Business Models Data and Process Models Logical service models (Simulation) Business Needs Service-Oriented Architecture Technologies Technical Architecture Technical Models Service implementation models Data Integration (EII) models Models for code IT view Need models for services assembling, abstract services, data integration, service implementation, … Sybase Confidential Proprietary. 20 Application Development Life Cycle (软件开发生命周期) Business Requirements Analysis Design Development Test Profiling Deployment Maintenance Roles Business users IT users, analysts, designers Developers, DBAs, Administrators, etc Modeling Tool MDA (PowerDesigner/WorkSpace, …) Development Tool (Eclipse, WorkSpace, Visual Studio, PB) Team work, Change management, Methodology, Documentation, Reuse Sybase Confidential Proprietary. Control points 21 Sybase Tools Architecture The Application Development Life Cycle (ADLC) Analysis & Design (Model Driven) Test/Debug Build (Model Driven) Deploy (Code Centric) Manage Maintain J2EE WS(MX) PowerDesigner WS (TX) Sybase Central WorkSpace (Eclipse) Microsoft .Net PowerBuilder (Testing via 3rd Party) DataWindow .NET Deployment Platform Independent Sybase Confidential Proprietary. Deployment Platform Dependent 22 WorkSpace 简介 Sybase Confidential Propriety. Sybase Confidential Proprietary. About Sybase Sybase is one of the largest software vendors in the world Sybase offers technology solutions in four key areas Information management Development and integration Business solutions Mobile solutions Sybase offers many strong products Enterprise Database (Adaptive Server Enterprise), #1 for Linux Fastest Data Warehouse (IQ) #1 Mobile solutions (SQL Anywhere, AvantGo, …) #1 Data modeling (PowerDesigner) Java development tool (WorkSpace) .NET development tool (PowerBuilder) … Sybase Confidential Proprietary. 24 Sybase WorkSpace Sybase is Eclipse board member Sybase leads the Data Tools Project (DTP) Sybase WorkSpace is an integrated design and development tool built on Eclipse Sybase WorkSpace supports Visual development, Model-Driven development, SOA Sybase Confidential Proprietary. 25 Sybase WorkSpace New Application Development WorkSpace supports emerging development paradigms, like SODA (Services-Oriented Development of Applications), EDD (Event-Driven Development), MDD (Model-Driven Development), composite applications, and mobile Sybase establishing itself as thought leader in new development technologies Technology Differentiators Single unified tool integrating modeling with SODA, EDD, data tooling and composite applications Leading mobile technology 26 Sybase Confidential Proprietary. 26 Sybase® WorkSpace Integrated Design and Development Sybase Confidential Proprietary. 27 Sybase Workspace Development Use Cases Model-driven development Data management and replication Database SQL/store procedure Real Time Database Service Replication Server/MobiLink Modeling Composite application development SOA and Light-weight Web services-based integration Point-to-point integration Business Process Integration Application development for web, portal and mobile environment Sybase Confidential Proprietary. 28 PowerDesigner 简介 Sybase Confidential Propriety. Sybase Confidential Proprietary. PowerDesigner Enterprise Modeling Tool Leader World #1 Data Modeling Tool Strong Enterprise Modeling Tool Sybase Confidential Proprietary. 30 PowerDesigner Is the World No.1 Data Modeling Tool 2004 Popkin 4% Embarcadero 8% Computer Associates 25% Quest 1% Sybase 34% Oracle 5% Other Vendors 23% Source: Gartner Sybase Confidential Proprietary. 31 Strong in Business Process Modeling and UML Modeling Business Process Analysis Object-Oriented Analysis & Design “…The functionality in PowerDesigner has been deepened recently in the area of business process modeling and management. Like Mega and Telelogic/Popkin, Sybase is very capable at playing in the integrated IT modeling and business process modeling sectors; …” Sybase Confidential Proprietary. 32 PowerDesigner 12.0 Is an Integrated Enterprise Modeling Tool Process Metadata Repository A complete enterprise modeling solution Metadata management: Requirements, Data Models, Business Process Models, UML Models, XML Models, Information Liquidity Models Repository Link and synchronization technology for impact analysis Data Applications Objects Sybase Confidential Proprietary. Support all relational databases, support Java, .Net, Hibernate, EJB, Web Services, … 33 Link and Synchronize Metadata BPEL4WS ebXML Business Process Model Object Model (UML) Conceptual Data Model C# VB.NET Java J2EE PowerBuilder Requirements Information Liquidity Model XML Model Replication Synchronization (future: ETL) Schema DTD Physical Data Model << ODBC >> Sybase Confidential Proprietary. DDL 34 PowerDesigner: A Complete Enterprise Modeling Solution 企业级建模技术 企业流程建模 (BPM) 数据建模 (ER) 面向对象建模 (UML) XML建模 Information Liquidity建模 Life-cycle management 需求分析, Impact analysis Model-Driven Development/MDA Java, C#, VB .NET, PB, Web Service, EJB, JDO, Hibernate, XML, BPEL4WS, ebXML, … Integration with IDE (Eclipse, Visual Studio, PB, JBuilder) Report HTML, RTF, etc. Enterprise Repository Versioning, security Extensibility Sybase Confidential Proprietary. 35 Modeling Techniques (建模技术) Sybase Confidential Propriety. Sybase Confidential Proprietary. Modeling Techniques Requirements Analysis(需求分析) Business Process Modeling (企业流程建模设计) Data Modeling (数据库建模设计) UML 2.0 Modeling XML Modeling (XML建模设计) Information Liquidity Modeling Code Generation and Reverse Engineering Integration with IDEs (Development Tools) Sybase Confidential Proprietary. 37 Requirements Analysis (需求分析) Requirements Model Define business and software requirements Import Microsoft Word documents Breaks titles out into nested requirements Synchronize with Microsoft Word document Changes are bi-directionally compatible Export requirements as design objects Traceability links Links requirements to requirements or design elements (Use Case, etc) Impact Analysis To know the impact of modification of a requirement on other requirements or design elements Reporting Generates a report for the requirements – beyond the requirements document HTML and RTF reports available Sybase Confidential Proprietary. 38 Business Process Modeling (企业流程建模) High-level business process model for capturing business requirements or describing existing process flow Link process to data (who use what, impact analysis) Business process model for simulation (process improvement) Detailed business process model for guiding the application development (BPMN) Workflow model Web service assembling (BPEL) model Sybase Confidential Proprietary. 39 Data Modeling (数据库设计建模) Data Modeling for database design Conceptual Data Model (CDM) Use UML Class Diagram instead of CDM Physical Data Model (PDM) Database optimization Generation, reverse engineer, modification (alter) Data warehouse design XML in database Web service in database Sybase Confidential Proprietary. 40 Conception Data Model (概念上数据模型) 用E-R图的概念来设计概念模型 与数据库无关的特性 支持 business rules, domains, shared data items, inheritances and relationships 可以生成 PDM 或 OOM Customer Product id <pi> I <M> name A30 email A30 phone A30 id <pi> I <M> name A30 price MN Identifier_1 <pi> Identifier_1 <pi> 1,1 0,1 0,n 0,n Order orderID <pi> I <M> orderDate D Identifier_1 <pi> Sybase Confidential Proprietary. orderItem 1,1 0,n id <pi> I <M> quantity I Identifier_1 <pi> 41 Physical Data Model (物理上数据模型) 可以从CDM/OOM甚至其他模型中无缝生成 与数据库特定相关 支持中文数据库 支持 physical options, stored procedures, triggers, permissions, synonyms, test data, XML in database, Web Service in database 支持 data warehouse Sybase Confidential Proprietary. 42 Data Warehouse Design Data Warehouse Modeling DW design, transformation fin_code code <h:1> type description Hierarchy_1 <Default> <h> Star schema (one-level foreign keys) Snowflake schema (multi-level foreign keys) fin_data - fin_code Multi-dimension model (cubes) Mapping editor fin_data year quarter amount fin_data Sybase Confidential Proprietary. 43 XML in Database PowerDesigner 增加了对XML in database的支持 基于数据库的结构创建XML Schema Generate using XML Builder Wizard 定义mappings Keep track of data and XML interdependencies 创建 SQLX 查询 and XML Schema Retrieve data out of database in XML format using SQLX Oracle 9i2 and 10g, IBM DB/2, ASA 9.0 生成 annotated XML Scheme or DTD Oracle 9i2 and 10g, Microsoft SQL 2000, IBM DB/2 使用 XML Model and Extended Model Definitions 来生成文件 Sybase Confidential Proprietary. 44 UML 2.0 Modeling UML 2.0 is defined by OMG UML 2.0 has 13 diagrams (4 new diagrams) PowerDesigner 12 Composite Structure Diagram (new) Port, part, required link, connector Class Diagram Port, required link, connector Sequence Diagram Interaction reference, interaction fragment Component Diagram, Deployment Diagram Composite diagram Port, part, required link, connector Sybase Confidential Proprietary. 45 XML Modeling Use a model to define XML Schema & XML DTD Generate XML Schema & DTD Reverse engineer XML Schema & DTD Extract data from database in XML format (Oracle, IBM, Sybase, SQL Server) AccountIdentifier {xs:string} OrderDate {xs:dateTime} CustomerRegion {xs:string} ProductIdentifier {xs:string} OrderSubmissionStatus /OrderSubmissionStatus S ProductDescription {xs:string} Price {xs:float} Quantity {xs:positiveInteger} StatusCode Sybase Confidential Proprietary. 46 StatusMessage Information Liquidity Model Show mappings between models (R/R, O/R, XML/R) Support Replication Server and MobiLink design, generation and reverse engineering Sybase Confidential Proprietary. 47 Generation and Reverse Engineering Generation and Reverse Engineering Databases Java, C#, VB .NET, PowerBuilder, EJB, WSDL, BPEL, ebXML, XML Generation only Hibernate, JSF, ADO .NET, NHinernate, WinForm Web services, C++, IDL Round-Trip Engineering Define technical models Generate code Complete code, test, debug with IDE Reverse engineer code to update models Sybase Confidential Proprietary. 48 Example of Generation for Java O/R mapping for Hibernate and EJB 3.0 Configuration file, O/R mapping files POJO persist objects, Factory for DAO, DAO (Data Access Object) Unit tests for JUnit Test CRUD operations JSF for user-interface Manual tests with users’ data Sybase Confidential Proprietary. 49 Example of Generation for .NET (coming soon in 12.1) O/R mapping for ADO .NET and NHibernate Configuration file, O/R mapping files PONO persist objects, Factory for DAO, DAO (Data Access Object) Unit tests for NUnit and Team Test Test CRUD operations WinForm for user-interface Manual tests with users’ data Sybase Confidential Proprietary. 50 Integration with IDEs (Development Tools) Single IDE for modeling tool and development Eclipse 3.1 Plugin, Sybase WorkSpace Visual Studio 2005 Plugin (coming soon in 12.1) PowerBuilder (Class Diagram) Eclipse Sybase Confidential Proprietary. Visual Studio 2005 51 Model-Driven Development Techniques Sybase Confidential Propriety. Sybase Confidential Proprietary. Model-Driven Development Techniques Visual Development Data-Centric Web Application Development using MDD SOA Application Development Sybase Confidential Proprietary. 53 Visual Development Use visual editors instead of code editors Service editor Web Page designer Page flow designer Package editor … Sybase Confidential Proprietary. 54 Data-Centric Web Application Development using MDD Define requirements Define Use Cases, discover classes Define Sequence Diagram, discover classes, operations Define Class Diagram Generate Physical Data Model with O/R mapping Optimize Physical Data Model for a database Generate database Generate code (Java, .NET, …) Sybase Confidential Proprietary. 55 SOA Application Development Define logical services (Business Process Model or Component Diagram) Implement services (Java, .NET) Deploy services Test services Define high-level Business Process Model Define technical Business Process Model to assemble services Generate executable language (BPEL) Deploy Business Process Sybase Confidential Proprietary. 56 PowerDesigner Features Sybase Confidential Propriety. Sybase Confidential Proprietary. PowerDesigner Advanced Features Impact analysis Models mapping Report generation HTML, RTF, list report Repository Versioning, merge, security Extensibility UML profile User-defined code generation templates VBScript, OLE automation (control PowerDesigner with users scripts or programs) Sybase Confidential Proprietary. 58 Impact Analysis 分析并管理不同模型之间的模型的受影响的关系 (Impact Analysis) 模拟模型的改变并能查看与之有影响的对象(Impacted objects) 能改变对象的影响范围 定义用户自己的 propagation rules Save or print Impact Analysis report Sybase Confidential Proprietary. 59 Models Mapping Define mappings between models Relational/Relational, Object/Relational, XML/Relational, Multidimension/Relational Define data warehouses Support Replication, synchronization (Sybase Replication Server, MobiLink, …) Support ETL, EII Sybase Confidential Proprietary. 60 Report Generation Model report Report wizard Report editor Support different languages (English, French, Chinese, …) Generate report in HTML, Word (RTF) formats Multi-models report List report Generate a list report for any type of objects List report wizard Generate list report in HTML, Excel (CSV), Word (RTF) formats Sybase Confidential Proprietary. 61 Repository 管理模型的知识库 (类似于源代码管理) 签入 签出 权限设置 版本比较 Configuration 分支(branch) 能细粒度的版本控制模型 Column, attribute, Comment, … Sybase Confidential Proprietary. 62 Extending PowerDesigner Features PowerDesigner metamodel (元模型) PowerDesigner Profile User-defined code generation VBScript OLE automation Sybase Confidential Proprietary. 63 PowerDesigner Profile PowerDesigner Profile All features of UML profiles and more Stereotype and criteria Extended attributes, objects and collections Code generation templates Generation Template Language (templates & macros) GTL supports Custom symbols Custom tool palette Custom checks Custom Form Custom popup menus Transformations 参考: <installed folder>\Resource Files\Extended Model Definitions\ Sybase Confidential Proprietary. 64 User-Defined Code Generation Code generation templates Generation Template Language (GTL) Templates Macros (.if, .foreach_item, …) Variables 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 Sybase Confidential Proprietary. 65 VBScript 控制 PowerDesigner元模型 获取对象属性、集合 创建对象 导入导出模型 代码生成 报表生成 定义菜单(menu items) 来执行 VBScripts脚本 定义模型的转换规则( transformation) PowerDesigner supports models transformations Inter-models generation (CDM->PDM, OOM->PDM, …) Intra-models generation (OOM->OOM, BPM->BPM, …) PowerDesigner supports user-defined transformations You can define objects transformations in Extended Model Definitions 参考示例: <installed folder>\VB Scripts\ Sybase Confidential Proprietary. 66 OLE Automation PowerDesigner 对象都是COM对象 在 PowerDesigner外部调用OLE Automation 能使用任何语言获取元模型 VB, VBA, VB .NET, C#, PB, C++, JavaScript, Java, … 定义 Design Patterns 扩展模型 创建自己的user-interface 参考示例: <installed folder>\Ole Automation Sybase Confidential Proprietary. 67 PowerDesigner 12.0 New Features Improved database support Mapping Editor Show model mappings in Information Liquidity Model Report enhancements and list report Support New Databases Support UML 2.0 Generate Hibernate & JSF Support BPMN notation in BPM Sybase Confidential Proprietary. 68 PowerDesigner 12.1 New Features Visual Studio 2005 plugin Integration with Team System Generate complete .NET code O/R mapping, unit test, forms Complete SQL Server 2005 support XML-XML mapping Sybase Confidential Proprietary. 69 WorkSpace Features Sybase Confidential Propriety. Sybase Confidential Proprietary. Database Development Data Modeling (based on PowerDesigner) Conceptual, and physical data models Optimize database structure Create and reverse engineer the database Information Liquidity Modeling Support replication (Replication Server, …), data movement Direct Development Create/edit data services (Service Editor), development of database object-- tables, stored procedures, event, and user defined functions (UDF) Deployment– export/import database objects & services to database servers Debugging– debug stored procedures, triggers Sybase Confidential Proprietary. 71 Service Design and Development Visually develop services Java Editor Business Process Editor Rules Editor Database Editor Message Service Editor SOAP Service Editor Transformation Editor Schema Viewer/XML Tools Expression Editor Mixed Java and non-Java logic elements Consistent look & feel and development approach Sybase Confidential Proprietary. 72 Service Orchestration, Assembling Wire services together to create processes to support business requirements Support for BPM and BAM capabilities Complex Logic as rules Compensation Support Fault Handling Sybase Confidential Proprietary. 73 Event-Driven Development Message Transports EAServer 5.x JMS Provider TIBCO Enterprise JMS Server 3.x/4.x IBM MQ Open JMS Services/BP Deployment EAServer 5.x/Unwired Orchestrator 5.0 Transformation Engine (integrated into UO 5.0) XSLT transformation engine High speed, patent-pending Java transformation engine that supports custom wire formats Database events/Data integration support ASE RTDS, RepConnector events Sybase Confidential Proprietary. 74 Web Application Development (new) Support Web Tools Project (WTP) Support Hibernate, JSF Page designer Page flow designer DataWindow JSF control Sybase Confidential Proprietary. 75 Testing, Packaging and Deployment Built in dependency checking Clean separation between packaging and deployment Packaging models for different servers One-click packaging and deployment wizards Testing Service Input data generation Log views for server and application logs organized and filtered based on log level settings Sybase Confidential Proprietary. 76 Conclusion PowerDesigner is the world #1 data modeling tool and one of the best enterprise modeling tool. WorkSpace is well integrated design and development tool that simplifies the development. 使用MDD和PowerDesigner/WorkSpace 可以大大缩 短开发时间,提高软件质量. Sybase Confidential Proprietary. 77 谢谢! Q&A http://www.sybase.com/powerdesigner http://www.sybase.com/workspace http://www.sybase.com.cn/sdn http://www.sybase.com.cn Sybase Confidential Propriety. Sybase Confidential Proprietary.