程序代写 Week 10: Dimensions of DSML design and development

Week 10: Dimensions of DSML design and development
Dr Steffen Zschaler

Goals for today

Copyright By PowCoder代写 加微信 powcoder

Today we will look at things to consider when designing DSMLs
– Dimensions of DSML design – Process concerns
20/03/2020 (c) King’s College London 2

Quiz: Design and Process Dimensions
Name DSML design and process dimensions you have come across in your reading.
20/03/2020 (c) King’s College London 3

Expressivity

Quiz: Expressivity
What does “expressivity” mean? In your own words…
20/03/2020 (c) King’s College London 5

Form into groups of ~4–5 people
– Refamiliarise yourself with the GridGames language and the Minesweeper implementation – One group member starts Eclipse and opens the Minesweeper implementation
– Count lines of code
– In the ggame file
– In the generated java implementation
– Which language is more expressive? Roughly, by how much?
You have 10 minutes
20/03/2020 (c) King’s College London 6

In your groups
– Analyse the GridGames specification of Minesweeper
– How is the higher expressivity achieved?
– What are examples of linguistic abstractions employed? Is the language declarative or
imperative?
You have 5 minutes
20/03/2020 (c) King’s College London 8

In your groups
– Analyse the GridGames specification of Minesweeper
– How could the language be made more expressive?
– What would be the benefits / drawbacks of doing so?
– How could the idea of domain hierarchies be used to make the language more expressive?
You have 10 minutes
20/03/2020 (c) King’s College London 10

Completeness

Quiz: Completeness
What do “completeness” and “coverage” mean? In your own words…
20/03/2020 (c) King’s College London 14

Demo: Generating executable code from UML
Class diagram and state machine

In your groups:
– Discuss what could be done to add business logic to states and transitions – Discuss different alternatives and their benefits and drawbacks
– Consider:
– Understandability of DSML model
– Complexity of code generation
– Repeatability of code generation
– Maintainability of model and final code
You have 5 minutes
20/03/2020 (c) King’s College London 16

Separation of Concerns

Quiz: Separation of Concerns
What does “separation of concerns” mean? In your own words…
Dijkstra, Edsger W (1982). “On the role of scientific thought”. Selected writings on Computing: A Personal Perspective. , NY, USA: Springer-Verlag. pp. 60–66. ISBN 0-387-90652-5.
20/03/2020 (c) King’s College London 19

In your groups:
– Consider the TurtleProgram language
– What if there was a requirement to be able to customise the look & feel of the application?
– How turtles are shown on screen
– How user can control execution of program (delays, stepwise execution, …) – Discuss how you would extend the language
– No need to implement – sketch usage examples instead!
– What are the benefits and drawbacks of your proposed solution?
– Consider
– Who will use the language? Do all changes require the same expertise? – When will changes occur? Are all changes of the same frequency?
You have 10 minutes
20/03/2020 (c) King’s College London 20

Separation of concerns for turtles
Consider who will use the language
– Different expertise: designing UIs vs making cool graphics
20/03/2020 (c) King’s College London 22

Separation of concerns for turtles
Consider who will use the language
– Different expertise: designing UIs vs making cool graphics Consider when changes will take place
– Two different timelines: many turtle programs will reuse the same look & feel
20/03/2020 (c) King’s College London 22

Separation of concerns for turtles
Consider who will use the language
– Different expertise: designing UIs vs making cool graphics Consider when changes will take place
– Two different timelines: many turtle programs will reuse the same look & feel Solution options
– Integrate all concerns in one language
– Separate languages for separate concerns, then integrate models in code generation
20/03/2020 (c) King’s College London 22

Separation of concerns for turtles
Consider who will use the language
– Different expertise: designing UIs vs making cool graphics Consider when changes will take place
– Two different timelines: many turtle programs will reuse the same look & feel
Solution options
– Integrate all concerns in one language
– E.g., add new commands for controlling look & feel
– Makes reuse and independent development difficult / impossible
– Separate languages for separate concerns, then integrate models in code generation – E.g., import a look & feel specification from a turtle program
20/03/2020 (c) King’s College London 22

Cross-cutting concerns
Concerns that cut across our chosen modularisation hierarchy
– Need to have bits of implementation across multiple parts of the implementation – MDE is actually good for this: typically can resolve in one of two ways:
20/03/2020 (c) King’s College London 23

Cross-cutting concerns
Concerns that cut across our chosen modularisation hierarchy
– Need to have bits of implementation across multiple parts of the implementation – MDE is actually good for this: typically can resolve in one of two ways:
– Restrict cross-cutting to platform
– E.g., automatically log everything that happens when a Turtle program runs
20/03/2020 (c) King’s College London 23

Cross-cutting concerns
Concerns that cut across our chosen modularisation hierarchy
– Need to have bits of implementation across multiple parts of the implementation – MDE is actually good for this: typically can resolve in one of two ways:
– Restrict cross-cutting to platform
– E.g., automatically log everything that happens when a Turtle program runs
– Modularise into separate concern in DSML
– Then weave code across generated implementation code
– E.g., allow specification of log message structure in separate DSML, then generate calls to log
function everywhere
20/03/2020 (c) King’s College London 23

Cross-cutting concerns
Concerns that cut across our chosen modularisation hierarchy
– Need to have bits of implementation across multiple parts of the implementation – MDE is actually good for this: typically can resolve in one of two ways:
– Restrict cross-cutting to platform
– E.g., automatically log everything that happens when a Turtle program runs
– Modularise into separate concern in DSML
– Then weave code across generated implementation code
– E.g., allow specification of log message structure in separate DSML, then generate calls to log
function everywhere
– Only rarely need to expose cross-cutting concerns directly on the model level
– But, language support like Aspects are much easier to build for DSMLs (e.g., see [1, 2])
J. Henriksson, J. Johannes, S. Zschaler, and U. Aßmann: Reuseware – Adding Modularity to Your Language of Choice. Journal of Object Technology, 6(9):127–146, 2007. J. Henriksson, F. Heidenreich, J. Johannes, S. Zschaler, and U. Assmann: Extending Grammars and Metamodels for Reuse – The Reuseware Approach. IET Software, Special Issue on Language Engineering, 2(3):165–184, 2008.
20/03/2020 (c) King’s College London 23

Importance of concrete syntax

Plenary discussion
Why is concrete syntax important?

IDE supportability
Consider the order in which your users will create models
– What will they create first?
– When are they likely to need IDE support (code completion, validation, …) – Will you have all the information needed at this point?
20/03/2020 (c) King’s College London 26

IDE supportability
Consider the order in which your users will create models
– What will they create first?
– When are they likely to need IDE support (code completion, validation, …) – Will you have all the information needed at this point?
Consider query language
SELECT FROM

WHERE
– Cannot support code-completion at : Table not specified yet
20/03/2020 (c) King’s College London 26

IDE supportability
Consider the order in which your users will create models
– What will they create first?
– When are they likely to need IDE support (code completion, validation, …) – Will you have all the information needed at this point?
Consider query language
SELECT FROM

WHERE
– Cannot support code-completion at : Table not specified yet
– Better for IDE support:
FROM
SELECT WHERE
– Now can support code-completion throughout
20/03/2020 (c) King’s College London 26

Understanding the domain / Incremental development

Quiz: Worst practice
What’s the biggest worst practice in DSML development? In your own words…
20/03/2020 (c) King’s College London 28

Designing good DSMLs is difficult
– More than just using the right technology – An art and craft more than a science
– But some principles have been identified
20/03/2020 (c) King’s College London 29

Next week:
– Revision
20/03/2020 (c) King’s College London 30

Questions?

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com