Xactium xDSLs Run Models Not Code Tony Clark
Overview Developments in Modelling Technology xDSLs – A Modelling Methodology Xactium. xDSL Technology. Details of an Application: The Xactium BMS Product. Conclusion
Modelling Technology Development Assembler HLLs SymbolicOO Scripting Structured Design OOD Formal Executable UML MDA DSL Agile xDSL
Generate Code From Models Compiler Platform Source Code Source Code bin System Model System Model
Run the Model System Model System Model Platform xDSL Engine Compiler Source Code Source Code
Code Generation Pros – Stand-alone. – Arbitrary extension. – No-proprietary platform. – Efficiency. Cons – Complexity. – Platform Dependence. – Two Representations. – No Domain Specific Semantics. – Difficult to provide tool support. – Difficult to dynamically update.
xDSLs Pros: Complete Model of application. Mix of graphical and textual syntax. Can be used for simulation, analysis, real app or code gen. High fidelity. Single representation. Dynamic updates. Reduced time and increased agility. Technology agnostic. Cons: Careful about proprietary engines. Careful about efficiency. Careful about expertise. More effort up front.
Xactium Provide model-based solutions. Eclipse based applications. Started in Developed an xDSL engine – XMF. New product for 2007: Business Motivation Solution (BMS) Require model based technology to be agile and flexible.
Xactium -Applications Applications : Aerospace Integrated Modular Avionics – configuration checking. Testing – run the test case models against application. Application Simulations – e.g. satellite payload. Business Management Information – match goals and information system to progress. Service Oriented Architecture – executable design of component interfaces. Interactive Applications – agile system development through incremental process definition. Transformation: XMI transformation against a proprietary API.
An xDSL Example Xactium-BMS answers questions WHAT and WHY in business planning. Applications include: – Mergers and Acquisitions. – Verification of Standards. – Business Plan Analysis. – Impact Analysis. – Planning and Monitoring Business Change. BMS based on emerging BMM OMG standard that includes many business concepts. BMS-Solutions rely on technology for flexible and complex analysis of the concepts.
BMS Concepts: Goals
BMS Concepts: Sub- Goals
BMS Concepts: Tactics
BMS Concepts: Units
BMS Solution Rules A business goal g is OK when: – It has at least one supporting tactic t; and – The tactic is established by an organization unit. A business goal g is OK when all its child goals are OK. An organization unit uses a single unit of resource for each tactic it establishes. An organization unit cannot use more resource than it owns.
Demo
BMS as an xDSL Application BMS has DSL syntax: the diagrams. Code generation not appropriate – want to interact with the models. Interaction and analysis involves an engine that processes BMM data. Example is just one of many different ways of analysing BMM information. Require technology that supports flexible dynamic processing of BMM models.
xDSL Technology xDSL can be implemented in any technology. Some are better than others. Xactium uses the following components: An xDSL architecture consisting of: Eclipse as a tool platform for standards and inter- operability. EMF as a basic data format and to generate data editors. GMF as a means of generating GEF-based diagram editors. XMF as an xDSL engine.
Graphical Editor (GMF) Graphical Editor (GMF) Technology Repository Textual xDSL Information Textual xDSL Information Model Data Model Editors (EMF) Model Data Model Editors (EMF) xDSL Eclipse Model Execution Engine (XMF) Output Graphical xDSL Functionality
EMF/GMF/XMF Connectivity EMF Model GMF Model Menus Plugin Menu Handlers XMF xDSL Def
BMS Tool with xDSL
BMM Model
BMS Results Model
XMF Features Meta-programming engine. Object-oriented. Extensive high-level programming features. Rich model processing facilities. Language extension facilities. Open architecture. Seamless Java integration. Dynamic. Written in itself. Can be embedded
BMM Class Definitions in XMF context Goal metaclass JavaClass extends BMM_Element pprintString(model) "Goal " + self.getName() + " is supported by: " + self.getSupported_by().asSeq() ->collect(t | t.getName()) ->separateWith(", ") toString() "Goal(" + self.getName() + ")" end
Language Fragments Selection from a x:T from Collection when Guard do Body else Alternative end Produce a (Goal,Tactic,Unit) Body end
Language Fragments Check each element in a x in Collection do Body end Use a unit of Guarded Condition do Body end
xDSL tactic:Tactic from goal.getSupported_by() unit:Organization_Unit from self.getElements() when unit.establishes(tactic) and resources.lookup(unit.getName()) > end end goal.getComposed_of().isEmpty() child in goal.getComposed_of() do self.ok(child.getName(),resources,results,succ,fail) end
xDSL Language Engineering OK manages a table of resources. Use, increments a usage count for a Body end is shorthand for... let name = Unit.getName() then usage = resources.lookup(name) then resources = resources.bind(name,usage – 1) in Body end
Syntax Class Syntax classes extend the XMF Use extends unit : Performable body : Performable ! end end
Grammars Define a grammar for the syntax class: context extends OCL.grammar Use ::= '(' u = Exp ')' b = Exp 'end' { Use(u,b) }. end
Desugar the Syntax Translate Use to the basic language: context desugar() [| let name =.getName() then usage = resources.lookup(name) then resources = resources.bind(name,usage - 1) in end |] end
Review xDSLs is an approach to system development. xDSLs provide advantages over code gen. xDSLs can be built using any technology, but… … some technologies make it easier than others… …XMF has been designed to support xDSLs Integrated with EMF/GMF Xactium planning XMF Open Source edition in BMS is an xDSL application based on XMF available in 2007.