Source-linked AI summary
Applied Metamodelling: A Foundation for Language Driven Development (Third Edition)
Tony Clark, Paul Sammut, James Willans
TL;DR
System developers face increasing complexity, technological diversity, and rapidly changing technologies. The book addresses this problem through languages and metamodelling, which capture language concepts, syntax, and semantics. It aims to provide technically rich, implemented guidance for constructing semantically rich development environments and tools.
Problem
Developers must manage increasingly complex systems, diverse technologies and processes, and technologies that quickly become legacy systems.
Method
The book uses metamodelling to represent language concepts, concrete syntax, abstract syntax, and semantics in a unified way.
Results
The book presents language models detailed enough to be transformed into semantically rich development environments and tools.
Takeaways & Limitations
Languages can provide abstractions that encapsulate complexity, accommodate technological diversity, and unite modern and legacy systems.
Takeaways & Limitations
The book has an industrial focus and emphasizes material that has been implemented and tried with real practitioners in mind.
Abstract
from arXiv · showhide
Modern day system developers have some serious problems to contend with. The systems they develop are becoming increasingly complex as customers demand richer functionality delivered in ever shorter timescales. They have to manage a huge diversity of implementation technologies, design techniques and development processes: everything from scripting languages to web-services to the latest 'silver bullet' design abstraction. To add to that, nothing stays still: today's 'must have' technology rapidly becomes tomorrow's legacy problem that must be managed along with everything else. How can these problems be dealt with? In this book we propose that there is a common foundation to their resolution: languages. Languages are the primary way in which system developers communicate, design and implement systems. Languages provide abstractions that can encapsulate complexity, embrace the diversity of technologies and design abstractions, and unite modern and legacy systems.
13 Case Study 4: Interactive TV
This chapter covers interactive applications through architecture, a dedicated DSL, and its implementation, including syntax and semantics.
- 13.2 Interactive Application Architecture: The chapter introduces an interactive application architecture.
- 13.3 A DSL for Interactive Applications: It presents a DSL for interactive applications.
- 13.4 Implementation: The implementation section covers syntax and semantics.
14 Case Study 5: Graphs
This chapter introduces a model of graphs and examines graph applications.
- 14.2 A Model of Graphs: The chapter introduces a model of graphs.
- 14.3 Graph Applications: It then considers applications of graphs.
Language-Driven Development
Language-Driven Development uses language management to improve development practices, supporting richer models and more sophisticated manipulation of models and programs.
- Managing languages to fit developers’ needs is presented as key to improving system development practices.
- Language abstractions and development environments can replace work with numerous low-level technologies.
- Rich models can support analysis and simulation of system properties before complete code generation.
- Developers can manipulate models and programs more sophisticatedly than code, while flexible language definitions support adaptation.
Metamodelling
Metamodelling enables the rapid design and integration of semantically rich languages by representing their concepts, syntax, and semantics in unified metamodels.
- Metamodelling is presented as the means to realise Language-Driven Development.
- A metamodel captures a language’s concepts, textual or graphical syntax, and semantics.
- Using one metamodelling language across cases unifies languages and supports powerful, flexible language-design environments.
Purpose of this Book
The book advances metamodelling toward Language-Driven Development by showing how metamodels can capture complete languages and address a gap in technically concrete guidance.
- It shows how metamodels can capture concrete syntax, abstract syntax, and semantics in a sound and pragmatic way.
- The book provides technically rich material for a subject often mentioned but lacking concrete guidance.
Scope of this Book
The book deliberately extends beyond software systems, applying its ideas across engineering, business, manufacturing, and physical engineering domains.
- The book is not restricted to software systems and addresses domains including systems engineering, business, manufacturing, and physical engineering.
Intended Audience
The book targets readers interested in language design, language- and model-driven development, and metamodelling, with an emphasis on industrial relevance and tested implementation.
- The book is intended for anyone interested in language design, language- and model-driven development, and metamodelling.
- Its industrial focus is supported by implementing everything in the book so that it has been tried and tested.
Relationship to Other Approaches
The book combines established approaches with existing standards to define languages generally and completely, while raising abstraction for complex language-design concerns.
- The book builds on established approaches, including LISP, ObjVLisp, Smalltalk, meta-case tools, OMG standardisation, and domain-specific languages.
- It combines these approaches on existing standards to facilitate general and complete language definition.
- The approach raises abstraction for expressing complex language-design aspects such as concrete syntax and semantics.
Organisation of this Book
The book moves from an overview of development challenges and Language-Driven Development to detailed metamodelling concepts, facilities, and case studies demonstrating practice.
- The first part introduces development challenges and proposes Language-Driven Development as a response.
- The middle part explains metamodelling, including language features, executable facilities, concrete syntax, semantics, mappings, and reuse.These chapters address how languages can capture syntax and semantics and how metamodelling can support metaprogramming and transformation.
- Dedicated chapters cover concrete syntax, semantics, executable metamodelling, mappings, and reuse as components of language development.
- The final part presents in-depth metamodelling case studies ranging from a small general-purpose language to an interactive-television domain-specific language.The case studies are presented as a resource for demonstrating metamodelling best practice.
LANGUAGE-DRIVEN DEVELOPMENT
Language-Driven Development addresses modern complexity, diversity, and change by using interoperable, semantically rich languages and metamodelling to create adaptable abstractions and tools.
- Language-Driven Development proposes rapidly designing new languages and tools in a unified and interoperable manner.The approach embraces multiple languages rather than forcing all developers and domains into one language.
- Modern systems challenge developers with increasing complexity, distributed architectures, diverse requirements, customisation demands, and costly technological change.The text identifies communication and security challenges in distributed systems and maintenance risks when technologies become obsolete.
- Rich languages provide abstractions for managing complexity, while multiple appropriate languages accommodate diverse domains and stakeholder needs.A single language may become bloated, contain contradictory domain requirements, or lose domain-specific richness.
- Language integration supports transforming, integrating, validating, and synchronising abstractions across languages.The framework also supports editors, analysis and simulation tools, transformers, and integrators applied to those abstractions.
- Flexible and evolvable languages help protect systems against changing requirements and technology obsolescence.Mappings can provide traceability between language versions and transform artefacts from earlier versions into newer ones.
METAMODELLING
Metamodelling defines languages by capturing their concepts, relationships, syntax, and semantics in a unified way. This supports language integration, platform-independent abstraction, and richer tool capabilities.
- Languages combine concrete syntax for presentation with abstract syntax for concepts and relationships, while semantics specifies what those concepts mean.
- Metamodelling unifies languages by describing them in a common meta-architecture, enabling mappings between languages defined in the same metamodelling language.
- Metamodels can define semantically rich, domain-focused abstractions that hide implementation technologies and combine into application-specific languages.
- Loading metamodels into tools could support language presentation, storage, interaction, execution, analysis, and testing, while increasing tool interoperability and flexibility.
- The book argues that reaching level 5 in the metamodel hierarchy should be an aspiration, although most existing metamodels remain at level 2 or below.
- Metamodels describe languages by capturing their concepts, relationships, syntax, semantics, and well-formedness rules.
A METAMODELLING FACILITY
A metamodelling facility provides platform-independent languages and frameworks for defining syntax, semantics, constraints, behavior, and mappings. XMF implements these capabilities around an executable meta-architecture.
- A metamodelling facility captures a language’s syntax and semantics in a unified, extensible, executable, and platform-independent form.
- XMF extends MOF, OCL, and QVT with executable metamodelling capabilities based on a core executable meta-architecture and framework.
- XMF supports object-oriented modelling concepts, constraints, action primitives, concrete syntax, instantiation, execution, expression evaluation, reflection, and mappings.
- Its golden-braid architecture makes the metamodelling language, including its semantics, completely self-described.
- XMF represents StateMachine concepts through packages, classes, associations, attributes, and concrete textual syntax, while distinguishing concrete syntax from abstract syntax.
- XOCL extends OCL with action primitives, enabling executable behavior and metaprogramming facilities such as parsers, interpreters, and compilers.
Textual Syntax
XMF’s XBNF provides a generic way to define textual syntax. Parsed constructs bind input elements to variables and use XOCL actions to populate abstract-syntax models.
- XBNF is a generic parser language for defining textual constructs that serve as input to a model parser.
- An XBNF expression combines EBNF definitions with embedded XOCL variables and an XOCL action.
- During parsing, matched variables are used by the XOCL action to create class instances that populate a language’s abstract-syntax model.
- The State example illustrates defining concrete syntax and producing an instance of the State class named X.
Diagrammatical Syntax
XMF models diagrammatic syntax with generic diagram elements and relates diagrams to abstract-syntax models through mappings. It also supplies separate languages for transforming or synchronising models.
- XMF provides generic models of diagram elements such as boxes and lines that can be tailored to specific diagram types.
- Bi-directional mappings synchronize diagram models and abstract-syntax models, so changes in either representation are reflected in the other.
- Mapping languages describe transformations or relationships between models and programs written in different languages.
- XMF includes XMap for uni-directional pattern-oriented mappings and XSync for bi-directional synchronisation.
Uni-directional Mappings
XMap defines executable, pattern-based mappings from state-machine models to C++ class models. The example maps states to an enumeration and transitions to operations, using expressions for complex navigation.
- XMap is a declarative, executable language for expressing uni-directional mappings based on pattern matching.
- Each state becomes a value in the STATE enumeration, and each transition becomes a same-named C++ operation that changes the state attribute to its target.
- A mapping has input domains and an output range; SM2Class maps a state machine to a C++ class, while Transition2Op maps transitions to operations.
- XMap clauses pattern-match source and target objects, generate result objects through do expressions, and use variables and XOCL expressions for complex relationships.
- The example constructs the enumeration from state names and applies Transition2Op to every transition in the state machine.
- Nested object patterns can match structures to arbitrary depth, while OCL supports the complex navigation expressions needed in mappings.
Synchronised Mappings
XMF combines metamodels for core modelling, grammars, executable expressions, and mappings around the XCore metamodel. It extends MOF with executable metamodelling, extensible grammars, self-description, and uni-directional and synchronised mappings.
- XSync provides bi-directional mappings that specify how models at either end change in response to changes at the other end.
- XMF’s architecture places the XCore metamodel at its heart, with OCL, XOCL, XBNF, XMap, and XSync metamodels around it.
- XCore supplies core modelling concepts such as Class and Package and provides a framework for language extension.
- XMF models elements, objects, classifiers, reflection, executable expressions, and snapshots as connected modelling concepts.
- Unlike MOF, XMF supports executable metamodelling through XOCL, which minimally extends OCL with operations that can change model state.
- XMF also addresses MOF limitations concerning extensible grammars, complete self-description, and mapping languages including synchronised mappings.
ABSTRACT SYNTAX
An abstract syntax model defines a language’s concepts, relationships, and well-formedness rules before concrete syntax and semantics are added. The chapter presents a staged process for constructing and validating such models, illustrated with a StateMachine language.
- An abstract syntax model describes language concepts, their relationships, and the rules determining whether models are valid.
- The identified concepts, relationships, and rules provide the vocabulary and grammar on which the remaining language design is based.
- Abstract syntax focuses on structural relationships rather than concrete representation or language semantics.
- Well-formedness rules give a detailed account of syntactic validity and can validate models as they are created.
- XMF supports abstract syntax models with classes, packages, attributes, associations, and OCL constraints.
- The development stages are concept identification, concept modelling, model architecting, model validation, and model testing.
- Concepts can be identified from language resources and examples, then generalized into concepts, relationships, and well-formedness rules.
- The abstract syntax should represent core modelling concepts rather than diagrammatic presentation, keeping representational complexity in concrete syntax.
CONCRETE SYNTAX
The book treats concrete syntax as a modelled, two-stage process that validates input and constructs abstract syntax for both textual and diagrammatic languages. Its broader metamodelling approach integrates syntax, semantics, mappings, and executable tooling to support portable, interoperable language environments.
- Concrete syntax processing: Concrete syntax processing first validates and interprets input, then uses it to construct abstract syntax for text and diagrams.Diagrammatic syntax differs because users commonly construct diagrams interactively and incrementally.
- Textual syntax: XBNF uses grammar definitions to parse textual languages and synthesize abstract syntax, including an intermediate XMF abstract syntax that is evaluated into an abstract syntax model.Its EBNF basis makes grammars for languages such as Ada, Java, and SQL readily expressible.
- Grammar composition: The @ grammar reference symbol allows grammars to be mixed, enabling languages such as StateMachine and XOCL to be used together.The mechanism is flexible but can be inconvenient when parsing an existing language whose text must be augmented.
- Syntax preservation: Concrete syntax may be translated back from abstract syntax because direct translation otherwise loses original syntax details needed, for example, during model debugging.XMF provides further support for preserving or reconstructing concrete syntax.
- Syntax synchronisation: XSync supports concise definitions of synchronisation between abstract and concrete syntax, including bidirectional updates across concrete views.Changes in one concrete syntax can propagate through shared abstract syntax to another concrete syntax.
- Integrated language definition: Metamodelling integrates concrete syntax, abstract syntax, and semantics so language definitions can become semantically rich, portable, interoperable tools.The approach supports executable semantic definitions, operational language behaviour, and unified modelling of language aspects.