Experiments With XMI Based Transformations of Software Models

Similar documents
The BPM to UML activity diagram transformation using XSLT

Development of Tool Extensions with MOFLON

Common Warehouse Metamodel (CWM): Extending UML for Data Warehousing and Business Intelligence

All you need are models Anneke Kleppe, Klasse Objecten

Generating Aspect Code from UML Models

Model-Driven Data Warehousing

Tools for MDA Software Development: Evaluation Criteria and Set of Desirable Features

Model Driven Interoperability through Semantic Annotations using SoaML and ODM

&$:,&206Ã.QRZOHGJHÃ$FTXLVLWLRQÃ&RPSRQHQW. Interface 4. &$:,&206Ã&RQILJXUDWLRQÃ6HUYHU &$:,&206Ã%DFNHQG Interface 2 'LVWULEXWHG 3UREOHPÃ6ROYLQJ

Organization of DSLE part. Overview of DSLE. Model driven software engineering. Engineering. Tooling. Topics:

INNOVATOR. The integrated tool suite for business process and software engineering

Designing a Semantic Repository

Using UML to Construct a Model Driven Solution for Unified Access to Disparate Data

UML-based Test Generation and Execution

Automatic Generation Between UML and Code. Fande Kong and Liang Zhang Computer Science department

Towards a Common Metamodel for the Development of Web Applications

Lightweight Data Integration using the WebComposition Data Grid Service

Business Model Interoperability using Enterprise Model Integration

Tool Support for Model Checking of Web application designs *

A Model-based Software Architecture for XML Data and Metadata Integration in Data Warehouse Systems

Business Performance Management Standards

From UML to HDL: a Model Driven Architectural Approach to Hardware-Software Co-Design

Project VIDE Challenges of Executable Modelling of Business Applications

Applying MDA in Developing Intermediary Service for Data Retrieval

Business Rule Standards -- Interoperability and Portability

XML DATA INTEGRATION SYSTEM

ProGUM-Web: Tool Support for Model-Based Development of Web Applications

Federated, Generic Configuration Management for Engineering Data

Formalization of Functional Requirements and Their Traceability in UML Diagrams A Z Notation Based Approach

JOURNAL OF OBJECT TECHNOLOGY

Modeling Web Applications Using Java And XML Related Technologies

Meta Model Based Integration of Role-Based and Discretionary Access Control Using Path Expressions

Introduction to XML Applications

A PERFORMANCE MODEL WEB SERVICE

XML Processing and Web Services. Chapter 17

Java Metadata Interface and Data Warehousing

Agents and Web Services

Consistency Maintenance Framework For Collaborative Software Modelling Tools

Chapter 11 Mining Databases on the Web

INTEROPERABILITY IN DATA WAREHOUSES

Chapter 1: Introduction

The Fast Guide to Model Driven Architecture

Model-Driven Architecture: Vision, Standards And Emerging Technologies

BUSINESS RULES MANIPULATION MODEL 1

Advantages of XML as a data model for a CRIS

II. PREVIOUS RELATED WORK

Mapping between Levels in the Metamodel Architecture

A Framework for Generating Query Language Code from OCL Invariants

XML for Manufacturing Systems Integration

Data Integration using Agent based Mediator-Wrapper Architecture. Tutorial Report For Agent Based Software Engineering (SENG 609.

A MEDIATION LAYER FOR HETEROGENEOUS XML SCHEMAS

SEARCH The National Consortium for Justice Information and Statistics. Model-driven Development of NIEM Information Exchange Package Documentation

Databases in Organizations

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

A Common Metamodel for Code Generation

XML- New meta language in e-business

Foundations of Model-Driven Software Engineering

CSE 233. Database System Overview

Simplifying e Business Collaboration by providing a Semantic Mapping Platform

Escaping Entropy Death!

A SYSTEMATIC APPROACH FOR COMPONENT-BASED SOFTWARE DEVELOPMENT

Integrating Bioinformatic Data Sources over the SFSU ER Design Tools XML Databus

A Case Study on Model-Driven and Conventional Software Development: The Palladio Editor

Enterprise Application Development Using UML, Java Technology and XML

Unified XML/relational storage March The IBM approach to unified XML/relational databases

XML WEB TECHNOLOGIES

Integrating XML and Databases

Revel8or: Model Driven Capacity Planning Tool Suite

Meta Data Management for Business Intelligence Solutions. IBM s Strategy. Data Management Solutions White Paper

Execution of A Requirement Model in Software Development

Open Source egovernment Reference Architecture Osera.modeldriven.org. Copyright 2006 Data Access Technologies, Inc. Slide 1

MDA Transformations Applied to Web Application Development 1

Rotorcraft Health Management System (RHMS)

Some Methodological Clues for Defining a Unified Enterprise Modelling Language

WHITE PAPER DATA GOVERNANCE ENTERPRISE MODEL MANAGEMENT

A UML 2 Profile for Business Process Modelling *

Repository for Business Processes and Arbitrary Associated Metadata

Concrete uses of XML in software development and data analysis.

XML-based Web Service for Collaborative Product Data Management

AN ONTOLOGICAL APPROACH TO WEB APPLICATION DESIGN USING W2000 METHODOLOGY

Software Testing Modeling Tools

Information Management Metamodel

What is a metamodel: the OMG s metamodeling infrastructure

Application of XML Tools for Enterprise-Wide RBAC Implementation Tasks

Fuzzy Systems and Neural Networks XML Schemas for Soft Computing

Common Warehouse Metamodel (CWM): Extending UML for Data Warehousing and Business Intelligence

Research Topics in Software Engineering

Defining and Checking Model Smells: A Quality Assurance Task for Models based on the Eclipse Modeling Framework

Business Modeling with UML

Building a Web Based Federated Simulation System with Jini and XML

A common interface for multi-rule-engine distributed systems

How To Use X Query For Data Collection

SOFTWARE ENGINEERING PROGRAM

A pattern based approach to defining the dynamic infrastructure of UML 2.0

Prüfung von Traceability Links -Workshop

Concepts of Database Management Seventh Edition. Chapter 9 Database Management Approaches

Open XML Court Interface (OXCI) Architecture Proposal

Jairson Vitorino. PhD Thesis, CIn-UFPE February Supervisor: Prof. Jacques Robin. Ontologies Reasoning Components Agents Simulations

Modeling the User Interface of Web Applications with UML

The Expressive Power of UML-based Web Engineering 1

Transcription:

Experiments With XMI Based Transformations of Software Models Birgit Demuth Heinrich Hussmann Department of Computer Science Dresden University of Technology 01062 Dresden, Germany {demuth,hussmann}@inf.tu-dresden.de Sven Obermaier sd&m AG software design & management 81737 Muenchen, Germany sven.obermaier@sdm.de Abstract The extensible Markup Language (XML) and its related technologies provide a promising tool for the implementation of transformations of UML models, not only for research prototypes but also for the interaction of different commercial CASE tools. We report on our experiments with XML query and transformation languages in the context of object-oriented software development. Especially we use the XML Metadata Interchange Format (XMI) as a tool for the transformation of object-oriented models. We outline XMI based scenarios in the forward and reverse engineering of different applications. As an example, we show how XMI and a standardized XML query/transformation language such as XSLT can be used for the generation of SQL database schemas based on UML models, and for design recovery from legacy code. 1 Introduction Since the Unified Modeling Language (UML) is rapidly becoming an accepted standard for software modeling, technologies for mechanical transformations of UML models become increasingly important. There are many different applications for transformation of UML models, e.g. for bridging between different subsets or variants of the language, for code generation in forward engineering, or for capturing model information in backwards engineering. In this paper, we report on experiments on a general technology applicable for all these purposes. The XML Metadata Interchange Format (XMI) was proposed in response to an Object Management Group (OMG) Request for a Stream-based Model Interchange format. The main purpose of XMI is to enable easy interchange of data and metadata between UML modeling tools and between tools and metadata repositories in distributed heterogeneous environments. XMI integrates three key industry standards: (1) XML - extensible Markup Language, a W3C standard [23] that provides the universal format for structured documents and data on the Web; (2) UML - Unified Modeling Language, the OMG modeling standard [4], [19] for specification, visualization, construction, and documentation of object-oriented systems; (3) MOF - Meta Object Facility, a CORBA-compliant architecture for defining and sharing semantically rich metadata in distributed heterogeneous environments which is used as OMG modeling and metadata repository standard [18]. Our intention is to use XMI for bridging the gap between different CASE tools and different software/database paradigms both in forward and reverse engineering. We present 1

our ideas and some of our experimental results with the XMI based scenarios in the forward and reverse engineering of different applications. The paper is organized as follows. In section 2, we outline the implementation of XMI based transformations using XSLT. Then we present two XMI based scenarios, one in the forward engineering of relational database applications and the other one in the reverse engineering of legacy code. Section 3 summarizes the results of our experiments. 2 XMI Based Scenarios in the Software Development XMI is the basic language that helps us to perform transformations among UML models as well as between UML models and other notations (especially code and other modelling languages). We evaluated the following scenarios: UML based code generation as a forward engineering secenario (UML-to-Any-Code transformation) Generation of UML models for legacy code as a reverse engineering scenario (Any- Code-to-UML transformation) Both XMI based scenarios are based on code transformations as well as metadata repository support. What we therefore need are a handy code generation framework for XMI documents. In [16], different approaches to code generation are described. facilities for easy access to metadata. To realize XMI transformations it must be possible to get structured data out of the XMI documents. A promising approach is to use a standardized XML query or transformation language. We evaluated several such languages [6], [9] and chose the Extensible Stylesheet Language Transformations (XSLT) [24], [25] for the experiments described below. 2.1 Implementation of XMI based transformations using XSLT We decided to use XSLT for the implementation of XMI based transformations because XSLT and the related XML Path Language (XPath) [26] are particularly designed for transforming XML documents. XSLT is a simple and very powerful language to declare transformation rules. XPath opens a wide range of navigation functionality for XML documents as well as mathematical and string operations. One of the particularly interesting aspects of XSLT is that the language is itself defined as an XML application; so the scripts are XML files again. The basic architecture of our solution is shown in the following figure. source (e.g. XMI) rules in an easy to read language (XSLT) import import program (translator) XSLT processor export Figure 1 XSLT interpreter solution for code generation destination documents (e.g. SQL statements) 2

The code generation process is not as fast as a solution directly based on the DOM API [22] 1, but we achieve more flexibility. Since there is no conventional programming involved any more and all transformations are expressed within XML, it is relatively easy to maintain the transformators, e.g. for a new version of the metamodel. XSLT processors are available [1], [7], [14], as well as XML and XSLT editing tools (see [17] for a survey). 2.2 UML-to-Any-Code transformation One application of XMI in a forward engineering scenario is as follows: Given an XMI document produced by the export of an UML CASE tool, we want to transform it into another document of any kind (programming language, database language or XML/XMI again). The semantics of such a transformation can be described with a set of XSLT rules each consisting of an action, which contains information how the source (XMI tags) should be transformed into the target code, and a condition under which the action should execute. Our case study for an UML-to-Any-Code-Transformation was the generation of a SQL database schema from a UML class diagram [17]. Figure 2 gives a simple example for a UML class diagram to explain the idea. Person String name String birthday Student boolean suspended String register 0..n 1 member University String name integer semesterfee Figure 2 Sample UML model According to the usual class-to-table mapping [3] we have to generate a relational database schema with three tables. The most important part of a relational database schema defined by SQL [15] are definition statements for the tables (CREATE TABLE) plus referential constraints for the mapping of class relationships (inserted by ALTER TABLE). CREATE TABLE Student (OID INTEGER PRIMARY KEY, suspended BOOLEAN, register VARCHAR(255), OID_University INTEGER NOT NULL); ALTER TABLE Student ADD CONSTRAINT FK_Student_University FOREIGN KEY OID_University REFERENCES University; ALTER TABLE Student ADD CONSTRAINT FK_Student_Person FOREIGN KEY OID REFERENCES Person; 1 The DOM compiler solution was evaluated in [17]. Herein we built a tool that generates from an XMI DTD a Java class structure for repositories (meta data models) with lightweight functions to navigate over the document information. The disadvantage of this technique is that the exchange of rules and the DTD is expensive. 3

Below we give an example for XSLT statements to perform this transformation. The rule has been simplified for better readability, for example instance methods and visibility of attributes are not shown and name conflict resolution is missing. The basic idea of the rule design is to have an XSLT rule that matches the XMI model element Foundation.Core.Class if it is a real class description and not only a reference. The first output of the rule can be the CREATE TABLE statement followed by the name of the table and the generation of a primary key mapping an object identifier (OID): <xsl:template match=" Foundation.Core.Namespace. ownedelement/foundation.core.class"> <xsl:text>create TABLE </xsl:text> <xsl:value-of select="foundation.core.modelelement.name"/> <xsl:text> (OID INTEGER PRIMARY KEY</xsl:text> Afterwards the attribute names and types can be generated in a similar way. Every class can be joined at one or more associations. An 1:N association can make it necessary to add an attribute to the table. N:M associations must be realized through an additional table. Then the CREATE TABLE statement can be completed. Furthermore, it must be tested whether constraints mapping associations and inheritance relationships must be added or not (ALTER TABLE statements). Besides referential constraints used to map class relationships to tables, the development of database applications benefits from business rules being encoded as part of the database schema, using assertions and triggers. The Object Constraint Language (OCL) [28] as integral part of the UML specification provides the facility to express business rules on UML model elements in a formal textual language. In [8], patterns for mapping of OCL constraints to SQL integrity constraints in form of assertions (CREATE ASSERTION) are given. We developed a modular OCL toolset [10][11] that also generates such SQL code. The OCL compiler has to check the types in the OCL constraint, that means it has to query the UML model for type information. This is an example for the above mentioned access to a metadata repository. We implemented it by a type information component of the OCL compiler based on XMI documents. We have realized a prototypical set of XSLT rules based on UML 1.1 following the ideas shown above. From our experiences, we estimate that a complete implementation of transformation rules for the UML DTD to SQL will cost approximately four to five weeks including rule and test case specification, documentation, realization, test and error correction. The result will have 1000 to 1500 lines of XSLT code and approximately 30 to 40 rules. Our experiments showed clearly that a language similar to XSLT but more specialized to the form of XMI documents would be helpful. Therefore, we designed a generic library of XSLT rules, which provides a framework for XMI transformators. Large parts of the framework can be generated automatically from an XMI DTD [2]. 2.3 Any-Code-to-UML transformation Besides the forward engineering approach from above, we also evaluated a new approach for object-oriented redesign of legacy code (Cobol et al). In [2], a MOF model has been defined which can be used as a metamodel for procedural languages like Cobol. We called the resulting XML-based language "Procedural Modeling Language (PML)". We 4

experimented in a case study with different XMI based transformations on the model level such as from Cobol to PML to UML. Classical reverse engineering algorithms can now be brought into the form of XSLT scripts. To achieve high productivity in the realization of model transformations we used the above-mentioned XSLT library for XMI. In this context, the technology of generating the XSLT library from a DTD pays back since the PML DTD is not a standard and may be updated quite frequently. 3 Summary Our experiments proved that XMI and related technologies like XSLT provide a practical way to experiment with UML model transformations (including other modeling languages and code). We showed practical applications in forward as well as in reverse engineering scenarios. We can benefit from the interoperability between different commercial tools that provide XMI export and import. Using XML and some additional XMI tools, we were able to build our own experimental transformation tools, which are completely independent of the underlying CASE platform. Acknowledgements We thank Axel Grossmann and Ralf Wiebicke who, through their efforts, have contributed to the presented research results. References [1] Alphaworks, IBM, LotusXSL, http://alphaworks.ibm.com/formula/lotusxsl [2] Axel Grossmann, XMI für prozedurale Programmstrukturen und Transformation in UML, Diploma Thesis, Dresden University of Technology Dresden, 2000 [3] Blaha, M., Premerlani, W., Object-Oriented Modeling and Design for Database Applications, Prentice Hall, 1998 [4] Booch, G., Rumbaugh, J., Jacobson, I., The Unified Modeling Language User Guide, Addison-Wesley, 1999 [5] Bruce, K., Whitenack, B., Crossing Chasms - A Pattern Language for Object-RDBMS Integration. Knowledge, Systems Corp., ftp://members.aol.com/kgb1001001/chasms/chasms.pdf [6] Chawathe, S., Describing and Manipulating XML Data, in: Data Engineering, 22(1999), 3-9, IEEE Computer Society [7] Clark, J., XT, http://www.jclark.com/xml/xt.html [8] Demuth, B., Hussmann, H. Using UML/OCL Constraints for Relational Database Design, in: <<UML>> 99 The Unified Modeling Language, Second Int. Conference, Fort Collins, CO, USA, 1999, Proceedings, Springer, 1999 [9] Deutsch, A. et al., Querying XML Data, in: Data Engineering, 22(1999)3, 10-18, IEEE Computer Society [10] Dresden UML Toolset, http://www-st.inf.tu-dresden.de/umltoolset, Dresden University of Technology [11] Hussmann, H., Demuth, B., Finger, F.: Modular Architecture for a Toolset Supporting OCL, in: <<UML>>2000, Third Int. Conference, York, UK, October 2000, Proceedings, Springer 2000 [12] Graham, I., Quin, L., XML Specification Guide, John Wiley & Sons, New York, 1999 5

[13] Heiler, S., Lee, W.-Ch., Mitchell, G., Repository Support for Metadata-based Legacy Migration, in: Data Engineering, 22(1999)1, 37-42, IEEE Computer Society [14] Kay, M., Saxon, http://users.iclway.co.uk/mhkay/saxon/index.html [15] Melton, J., Simon, A., Understanding the New SQL:A Complete Guide, Morgan Kaufmann, 1993 [16] Obermaier, S., Entwicklung eines Frameworks für die Codegenerierung am Beispiel von SQL, Diploma Thesis, Dresden University of Technology Dresden, 2000 [17] Obermaier, S., Generic Meta Data Models, Technical Report, Dresden University of Technology Dresden, 1999 [18] OMG, Meta Object Facility (MOF 1.3) Specification (ad/99-09-04), http://www.omg.org [19] OMG, UML Specification v. 1.3 Draft, http://www.omg.org [20] OMG, XMI SMIF Revised Submission (ad/98-10-06), http://www.omg.org [22] W3C, Document Object Model Specification (DOM), http://www.w3.org [23] W3C, Extensible Markup Language (XML), http://www.w3.org [24] W3C, Extensible Stylesheet Language (XSL), http://www.w3.org [25] W3C, XSL Transformations (XSLT), http://www.w3.org [26] W3C, XML Path Language (XPath), http://www.w3.org [27] W3C, XML-QL: A Query Language for XML, http://www.w3.org [28] Warmer, J., Kleppe, A., The Object Constraint Language. Precise Modeling with UML, Addison- Wesley, 1999 6