Topic: Domain specific languages
Lectures
Domain-specific languages:
- slides
- video part 1 youtube, video part 2 youtube, video part 1 mediahopper, video part 2 mediahopper.
Q&A: we discussed various points from the Patterns slides. Starting from Singleton, where I drew attention to the small but important notational distinction between ":" after an attribute name specifying its type, and "=" specifying its value (in an object diagram, or, where the attribute is actually one metalevel above, e.g. a static attribute in Java terms or an attribute of the relevant metaclass rather than the class itself) we went on to look at the Factory variants, and discuss why they are useful. More generally we discussed the fact that patterns complicate a design which may or may not be worthwhile, and how this interacts with the chosen development method. E.g. if you are following an agile methodology, with the aim of ensuring simple design and code clean enough that the design is easy to change, you will want to avoid introducing a pattern just in case you need the flexibility it offers later on - you'll only introduce it once you definitely need that flexibility. We asked whether Abstract Factory just moves the problem rather than solving it, and briefly discussed dependency injection as a way to approach this. Finally we discussed Observer, and in particular, how it splits what would be a two-way dependency between a publisher and a subscriber into two one-way dependencies: at the application level, we have a relatively harmless dependency of the subscriber on the publisher, while the dependency of the published on the subscriber is moved up to the very abstract level (e.g., in Java, the standard class library) where it does no harm.
Videos
- DSL development with xtext Sven Efftinge. (This is 50 mins long. Please watch the first 21 or so minutes carefully, understanding what xtext is and is for, and how to write an xtext grammar for a given language. Then it is fine if your watching of the rest of the video is more impressionistic: get an idea of what is possible, but you don't need to come out understanding how to drive the xtext tools in detail!)
- Optional: GOTO 2018 Build your own language: why and how? Markus Voelter (NB the point, of course, is not to learn MPS, the specific language engineering tech he's talking about, but to follow the general discussion.)
Readings
- An Approach to Internal Domain-Specific Languages in Java by Jeff Bay and Alex Ruiz
- Developing Domain-Specific Languages with Xtext and some Quick revision questions
- Using Language Workbenches and Domain-Specific Languages for Safety-Critical Software Development by Markus Voelter et al.Quick revision questions
- Optional: Model-Driven Development Challenges and Solutions - Experiences with Domain-Specific Modelling in Industry by Juha-Pekka Tolvanen, Steven Kelly. Quick revision questions