Applying Model Driven Architecture to Team Based UML Modeling

Date/Time:
Thursday 27 September 2007

Speaker:
Ben Constable, Chief Operations Officer of Sparx Systems

Description:

After numerous communications and weeks of negotiations we managed to find a window of opportunity in Ben Constable’s very busy calendar (while he was travelling between meetings in the UK, during his Northern Hemisphere globe trotting travels covering North America and European countries).

This event was very well attended, so much so that we had to request additional seating for attendees.

Ben first outlined what he believes to be the challenges in modern software development, including:

  • The complexity of modern systems
  • Distributed development teams
  • Technology obsolescence
  • Heterogeneous development environments (Java + .Net).

He then gave his views on the value of modelling:

  • Manage Complexity: Systems are larger, more highly integrated
  • Plan & Mitigate Risk: Assess options before committing resources
  • Facilitate Communication: Large teams of collaborating roles, often distributed

A Brief Overview of Sparx Systems

They are a leading provider of UML modelling tools and a contributing member of the OMG. Their flagship product is Enterprise Architect for UML 2 and they have Model Driven Generation (MDG) tools and MDG integration for Visual Studio 2005 & Eclipse.

Model Driven Generation is a customisation framework that provides two key benefits:

  • Uses the semantic information in the model to derive useful development artefacts: Code, XML fragments
  • Utilizes the automation interface to provide integration to specialized tools

Sparx Systems are represented in over 130 countries with over 100,000 users worldwide. Their partners and resellers provide localized training and support services around the globe.

Product translations exist for a number of languages including Japanese, German and Spanish.

Their products are used across all major industries from automotive and aerospace engineering to insurance and financial institutions.

An Introduction to Enterprise Architect

Enterprise Architect (EA) is:

  • A stand alone modeling environment which has complete support for modeling from requirements to design.
  • A sophisticated Integrated Model Environment.
  • Built with the team in mind. EA developers have significant experience working in teams and understand the challenges involved.

EA was the first UML tool to implement the UML 2 specification by supporting the 13 standard UML 2 diagrams. A customization framework for Domain Specific Modeling (UML profiles, patterns, templates), which allows the modeling environment to be used in a domain specific way. It incorporates an Extensible Meta-data Interchange (XMI) for interoperability and model serialization.

Extensible Meta-data Interchange is an open standard published by the OMG, which provides great flexibility and integration options for users that need to access the underlying model data.

EA has modelling support for SDLC:

  • Visual Requirements Modeling - Sparx provides extensions to UML to provide graphical modeling of formal requirements. Traditionally, Requirements Analysis has been carried out in external tools, causing a disconnect between the formal specification and the system model. Traceability, validation and visualization achieved.
  • Customisable Reporting engine - Rich-text and web-based reports can be used for project deliverables, which allow teams to share and communicate with client and stakeholders.
  • Code Engineering Framework - Integrates with Visual Studio and supports 10+ languages out-of-the-box. (Users are able to define others). Importing, visualizing and analysing legacy systems facilitate migration to more modern .Net-based languages.
  • Deployment and Test specification

EA has support for multiple, concurrent users. Its scalable database driven repository in the Corporate environments will use a dedicated relational DBMS Server backend (Oracle, SQL Server, MySQL etc.) allowing very large scale, team-based modelling.

Version Control (CVS, Subversion, SCC, TFS integration) facilitates change management and revision history, which is important for concurrent users to manage updates.

Security and Locking mechanism - Users login with restricted access to the model, this facilitates peer collaboration, preventing accidental modification. Featuring database and operating system level security for protection.

MDA Transforms Review

Next followed a brief review of how MDA Transforms are applied. Showing how a defined abstract PIM (Platform Independent Model) is used to derive one or more PSM (Platform Specific Model), with a concrete example from an online bookstore (further details can be viewed in the accompanying PowerPoint slides available in the Resources section).

This included a demonstration:

Simplifying the definition of web services

  • Define Abstract Service model: PIM
  • Derive Web Services model: PIM -> PSM
  • Generate Web Service Definition Language (WSDL) file: PSM -> PSM
  • Generate Client/Server code: PSM -> PSM

The Mapping specified by the MDA Transformation:

  • Interface operations map to WSDL port type operations
  • Operation parameters become WSDL messages
  • Data model maps to XML schema complex types
  • WSDL component is generated to represent the WSDL document itself
  • The platform specific model itself represents a far more easily representation of the underlying WSDL code

Using the Platform Specific model as input, EA automatically generates the corresponding WSDL document.

Using Visual Studio tools, such as wsdl.exe we can automatically arrive at the client/server code to implement and deploy the web service.

Enterprise Architect provides a framework to achieve MDA goals:

  • Support for Abstract and Platform specific modeling
  • A powerful transformation engine that automatically produces PSMs based on a set of mapping rules
  • User customizable transformation templates: Users can define the mapping rules!

Case Study

Next a case study showed how porting a complex COM based API to Java is possible.

Case study background

  • Enterprise Architect provides an automation interface (API)
  • COM based interface, implemented in C++
  • Allows VB/.Net scripting of Enterprise Architect
  • Customers Demand: Equivalent interface for Java clients

Possible Approaches

  • Develop a duplicate API for Java (Error prone & Expensive!)
  • Use 3rd party tools to wrap COM (Performance & License issues)
  • UML Models + MDA Transforms to derive Java API

Using MDA to automate the process

  • Reverse Engineer the COM interface to standard UML
  • Derive a suitable PIM by transforming the COM model
  • Transform the PIM to multiple PSMs
  • A model for the Java based API
  • A model for the C++ based COM Wrapper
  • Generate code from each PSM to obtain
  • Java code that implements JNI calls for the API
  • C++ code to map JNI calls to their COM equivalents

The Results:

  • Existing COM API Documented:
    • 4,600 LOC Reverse Engineered
    • 352 Interfaces, 665 Properties, 60+ Classes
  • Java API:
    • 12,500 LOC automatically generated
  • C++/COM wrapper:
    • 35,100 LOC automatically generated

The Benefits:

  • Implementation of New API 100% automated
    • Reduced Overall Project Cost
    • Reduced Risk of human error in duplication
    • Reduced Complexity with fewer resources involved
  • Increased Productivity
    • Project completed in 2 Weeks!
    • Architect had little prior knowledge of COM / JNI
  • Automatic, repeatable update process now in place
    • Future API changes now automatically implemented
    • Recently used to update the EA 7.0 Java API

Modelling in Teams

Communication & Development environments.

Using the modeling environment as a communication device:

  • Clients:
    • Business needs / system requirements modelled
    • Traceability from requirements, to designs, to end solution
    • Reporting frameworks provide feedback loop
  • Team:
    • Collaborating roles: Analysts, Architects, Developers etc.
    • Shared access: Version Control, Security etc.
  • Project Management:
    • Resources assignment
    • Reporting, Metrics, Documentation
  • Models undergo revisions too!
  • Basic concepts of version control apply:
    • A mechanism for managing concurrent work
    • Maintain a history of changes
    • Revisions stored using industry standard XMI

With Version control enabled we can:

  • Allow multiple, concurrent users to work on individual packages
  • Allow the entire team to have "read" access to the complete model, without accidental modification

Coping with heterogeneous development environments

  • Abstract models are useful:
    • Levels of abstraction help remove platform dependence of models
    • MDA Transforms automate the transition to specific platforms But …
  • We need to integrate the model:
    • Coders are comfortable within the programming environment
    • Analysts and Architects think in the abstract
    • Each party needs to stay on the same page

Demonstration: Refining our web services example

A typical scenario for our Online Bookstore project

  1. Requirements team identifies a change -> additional web service
  2. Architects update our abstract services model (PIM)
  3. Regenerate (synchronize) our WSDL Model (PSM)
  4. Regenerate the WSDL code
  5. We are developing in both Visual Studio and Eclipse

Conclusion

Closing the presentation Ben fielded the following question:

"Will Modeling Tools really make our development staff redundant?"

His answer was:

"No. MDA tools make them more productive, by automating what has previously been done manually, and thereby allow suppliers to keep pace with current industry demands on resources. It will help suppliers build better, more robust software more quickly."

At the end of this event we asked for a show of hands from the attendees to see if any of them would be interested in attending a half-day event (planned for 2008). The proposed event would be an introduction to Enterprise Architect and would be delivered by one of Sparx Systems UK Partners. We received an encouraging response of 17 showing their interest.