Role of Executable UML in MDA Presented by Shahid Alam salam3@connect.carleton.ca 12/2005
Outline Introduction to MDA Executable UML Does it apply to MDA Model Compilers Conclusion
Model Driven Architecture (MDA) According to OMG guide for MDA [2], it provides an approach for, and enable tools to be provided for: Specifying a system independently of the platform that supports it Specifying platforms Choosing a particular platform for the system Transforming the system specification into one for a particular platform The three primary goals of MDA are portability, interoperability and reusability through architectural separation of concerns
OMG's Model Driven Architecture
How MDA is Used An application is built as a platform independent model (PIM). Tools are used to convert that model to application implementation. Implementation can be a model (PSM), software platform (C, C++, CORBA, SmallTalk or J2EE etc) or an executable which directly runs on the specified platform
How MDA is Used (more detail)
How MDA is Used (more detail - continued) PIM describes the system, but does not show details how it is going to use the platform Mapping provides specifications for transformation of a PIM into a PSM for a particular platform. There is no standard yet. But there are implementations of MDA, currently available from different tool vendors like OptimalJ, ArcStyler, Eclipse Modeling Framework, Codagen Architect and Oliva Model Execution System. Marking PIM is marked to indicate the mappings to be used to transform that PIM into a PSM
How MDA is Used (more detail - continued) Transformation is the process of converting one model to another model of the same system. The input to the transformation is the marked PIM and the mapping. Basically there are two types of transformations, model-to-model and model-to-code PSM produced by the transformation is a model of the same system specified by the PIM. It also specifies how that system makes use of the chosen platform
Benefits of MDA Short development cycle Automation not only shortens the coding time but the overall development cycle. The user and system documentation can be generated from the PIM using appropriate tools Easily migrate applications to new technologies PIM can be transformed to different platforms / technologies. So the model remains independent of the technology Economically support multiple platforms MDA automation saves money for a company to support different platforms and in doing so increase the number of customers
Agile MDA In Agile MDA code and models are operationally the same. To shorten the cycle from analysis to implementation, testing and execution are done almost at the same time. From here comes the concept of executable model that is complete enough to be executed stand alone
Artifacts for Agile MDA (http://www.agilemodeling.com/essays/agilemda.htm)
Executable UML It's a subset of UML, that is sufficient enough to allow definition of models that can be automatically executed on a computer by an execution tool [3] Is Executable UML another (graphical) programming language. It can be considered a program for a particular subject matter An executable UML model describes the data and behaviour about the subject matter at hand
Executable UML (but it doesn't) Make coding decisions Specify some of the elements like distribution or number and allocation of threads Make no statement about tasking structures Make statement about classes or encapsulation
Concepts in Executable UML Concept Called Modeled As Expressed As Classes Data attributes UML class associations diagram constraints The world is full of things Things have lifecycles Things do things at each stage control algorithm States events transitions procedures actions UML statechart diagram Action language
Overview of Entire Process System Models (domain identification, use cases etc). System is divided into domains Modelling a single domain (classes, state machines and procedures). Models are both abstract and detailed at the same time Verification and Execution (model verification and model compilation). This is done continuously as the model is build, it is verified and executed and the performance is checked
Overview of Entire Process (domain model)
Overview of Entire Process (continued) Executable UML relies on the Precise Action Semantics for UML [7] adopted in late 2001. They provide specifications for actions, but do not specify action language syntax, so every tool vendor has it's own action language Another Language Why not Java
Overview of Entire Process (continued) Possibly To raise the level of abstraction. As we move from register allocation (assembly) to high level languages, so do we want to move from arrays, lists to domain objects as models Action language keep the design away from software platform. As an example the executable UML model can be executed on a distributed system using CORBA and for resource constrained embedded systems using C with no operating system
Overview of Entire Process (action languages) Bridgepoint Action Object Language (www.projtech.com/pdfs/bp/oal.pdf) Syntax for object and attribute actions Action Create object Syntax create object instance <object reference> of <class>; Delete object delete object instance <object reference>; Write Attribute <object reference>.<attribute name> = <expression>; Read Attribute... <object reference>.<attribute name>
Overview of Entire Process (action languages) Bridgepoint Action Object Language Example for object and attribute actions // newpublisher refers to the instance of // the Publisher Class create object instance newpublisher of Publisher; // name is an attribute of Publisher class newpublisher.name = Addison-Wesley ; // x gets the value for the name x = newpublisher.name; delete object instancenewpublisher;
Overview of Entire Process (action languages) SMALL (Shlaer-Mellor Action Language) Syntax for object and attribute actions Action Syntax Create object <object reference> >> <class list>; Delete object <object reference> <<; Write Attribute <expression> > <object reference>. <attribute name>; Read Attribute... <object reference>.<attribute name>
Overview of Entire Process (action languages) TALL (That Action Language) Syntax for object and attribute actions Action Syntax Create object <object reference> := new <class list>; Delete object delete <object reference>; Write Attribute <object reference>.<attribute name> = <expression>; Read Attribute... <object reference>.<attribute name>
Overview of Entire Process (domain verification) Static Verification.Done by the modelling tools. The tool that understand the semantic of the Executable UML can check the semantic, that is if the classes have attributes, states have procedures, action language compiles correctly etc Dynamic Verification.The process where the test cases are run against the models. Trace all the possible paths (scenarios) in the use cases, determine the objects involved in the scenario. Execution of each scenario is a test case Executable UML makes it much easier as you can run the model
Model Compiler An Executable UML model compiler turns an executable UML model into an implementation using a set of decisions about the target hardware and software environment [6]
Model Compiler (implementation) A developer of Executable models uses model compiler for the specific platform to execute the models. Model compiler elements can be re-allocated and re-compiled. So it separates the model and the software.
Model Compiler (implementation continued) Portable programs Extension of write once run everywhere Number of possibilities for hardware-software co-design
Model Compiler (implementation continued) Model compilers include ways to: Create, store and retrieve data Execute procedures and their actions Generate signals and receive events
Model Compiler (archetype) Archetype is a fragment of data access and text manipulation logic that states formally how to embed an Executable UML model into text [6]
Model Compiler (archetype language) It's a combination of data access language and string processing language. Data access for accessing the repository (where Executable UML models are stored) and string processing for manipulating of strings for output
Model Compiler (archetype language continued) Archetype that Creates a Java Class.for each object in O_OBJ public class ${obj.name} extends StateMachine private StateMachineState currentstate;.select many attributes related by object->o_attr[r105].for each attribute in attributes private ${attribute.impltype} ${attribute.name};.end for - -.end for Java Class Created by Applying Above Archetype to Model public class ProductSelection extends StateMachine { private StateMachineState currentstate; private Count quantity; private Currency unitpriceofselection; - - }
OMG RFP for Executable UML (specifications will be submitted early next year) Proposals shall define a compact subset of UML that is computationally complete language for executable models Proposals shall define a standard model library Proposal shall select elements that are translatable to multiple implementations and a broad range of languages, including hardware description languages for models where that may be appropriate It must ensure that any conferment tool can execute any valid UML model that is based on this subset The proposed specification shall itself be a UML model (referred to as the execution model )
Issues How an incomplete executable UML model will be allowed to execute. That is the ability to execute models where some information required for execution is missing How an executable UML model begins its execution Do we need a simulator or a virtual execution environment (VEE) to simulate/execute the implementation, where there is no real platform present Simulators and VEE are already been used, so what difference does it make now, except for shorter development cycle Will it be possible to build just one VEE to directly execute UML models using a model compiler
Conclusion Executable UML support a new OMG initiative MDA. Whose purpose is to compose complete systems out of models. The developer builds a model and then exports it to another tool that interprets it by execution for immediate feedback to the customer. It seems like a very happy solution. But is it that simple? Hopefully soon we will see an Executable UML specification by OMG. This will open up a new research area for academics and opportunities for industries to build supporting tools and applications
Conclusion Products that claim to support Executable UML and MDA concept are: ObjectSwitch from www.kabira.com BridgePoint from www.project.com merged with Mentor Graphics www.mentor.com iuml/xuml from www.kc.com
References [1] OMG Model Driven Architecture URL: http://www.omg.org/mda/ [2] MDA Guide Version 1.0.1, june 2003 URL: http://www.omg.org/docs/omg/03-06-01.pdf [3] Semantics of a Foundational Subset for Executable UML Models, Request for Proposal, OMG Document: ad/2005-04-02 [4] MOF Query / Views / Transformations, second revised submission by DSTC, IBM and CBOP, 12 January 2004 [5] Second revised submission to MOF Query / View / Transformation RFP by Interactive Objects Software GmbH and Project Technology, Inc, 12 January 2004 [6] Executable UML, A Foundation for Model-Driven Architecture by Stephen J. Mellor and Marc J. Balcer, published by Addison Wesley 2002 [7] UML Action Semantics URL: www.omg.org/cgi-bin/doc?ptc/02-01-09 [8] Agile MDA by Stephen J. Mellor URL: http://www.omg.org/agile