Modular design of domain-specific languages

Slides:



Advertisements
Similar presentations
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Advertisements

WebRatio BPM: a Tool for Design and Deployment of Business Processes on the Web Stefano Butti, Marco Brambilla, Piero Fraternali Web Models Srl, Italy.
Object-oriented Programming Concepts
Visual Basic Introduction IDS 306 from Shelly, Cashman & Repede Microsoft Visual Basic 5: Complete Concepts and Techniques.
Visual Basic Chapter 1 Mr. Wangler.
INFO415 Approaches to System Development: Part 2
CS5103 Software Engineering Lecture 08 Android Development II.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Transformation of Timed Automata into Mixed Integer Linear Programs Sebastian Panek.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
An Architecture to Support Context-Aware Applications
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
Adaptive User Interface Modelling for Web-environments T – Antti Martikainen
Topic 4 - Database Design Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
Application architectures. Objectives l To explain the organisation of two fundamental models of business systems - batch processing and transaction processing.
6. Application Server Issues for the Project
Modeling with UML – Class Diagrams
Visual Basic.NET Windows Programming
5 In the Survey Options section, click an option to determine whether users' names will appear in survey results, and then whether users can respond to.
Programming and Debugging with the Dragon and JTAG
INF230 Basics in C# Programming
Lecture 1: Operating System Services
Working in the Forms Developer Environment
5 In the Survey Options section, click an option to determine whether users' names will appear in survey results, and then whether users can respond to.
State Machine Model.
Sumant Tambe* Akshay Dabholkar Aniruddha Gokhale
GUI Design and Coding PPT By :Dr. R. Mall.
Chapter 1: An Introduction to Visual Basic 2015
User Interface Design The Golden Rules: Place the user in control.
User Interface Design PPT By :Dr. R. Mall.
Chapter 11 Object-Oriented Design
Java Beans Sagun Dhakhwa.
COMP3241 E-Commerce Technologies
Unit 2 User Interface Design.
Understanding an App’s Architecture
Introduction to Operating System (OS)
Searching Business Data with MOSS 2007 Enterprise Search
5 In the Survey Options section, click an option to determine whether users' names will appear in survey results, and then whether users can respond to.
CMPE419 Mobile Application Development
An educational system for medical billers in training
CSC 421: Algorithm Design & Analysis
Chap 7. Building Java Graphical User Interfaces
Software engineering USER INTERFACE DESIGN.
Graphical User Interfaces -- Introduction
Searching Business Data with MOSS 2007 Enterprise Search
System And Application Software
VISUAL BASIC.
.NET and .NET Core 7. XAML Pan Wuming 2017.
Social Media And Global Computing Introduction to Visual Studio
CS5103 Software Engineering
Model-View-Controller Patterns and Frameworks
Understanding the Visual IDE
Phonegap Bridge Configuration file
Chapter 20 Object-Oriented Analysis and Design
M-Commerce Wireless Markup Language (WML) By Prof T.R. Vaidyanathan.
Appendix A Object-Oriented Analysis and Design
Use Case Model Use case diagram – Part 2.
Object-Oriented Programming: Inheritance and Polymorphism
Web Development Using ASP .NET
Smart Personal Console (SPC)
Appendix A Object-Oriented Analysis and Design
Introduction to Object-Oriented Software Development
CMPE419 Mobile Application Development
Abstract Types Defined as Classes of Variables
Software Architecture & Design
Presentation transcript:

Modular design of domain-specific languages Bart Meyers This talk is in the research area of domain-specific modeling. These days, we build complex and heterogeneous systems. In DSM, the goal is to model your system at the most appropriate level of abstraction, using the most appropriate formalism. This way, accidental complexity of the system is minimized. Therefore, customized languages are created. The enablers are meta-modeling and model transformation. The structure of these languages is defined by meta-modeling, and the meaning is given by a model transformation mapping to a semantic domain.

MenuItem Choice RecordedAudio UserInput Start Menu Error Timeout 1 next * MenuItem Choice +choice: Integer next 1 * RecordedAudio UserInput Start Menu Error Timeout MenuItem Choice +choice: Integer RecordedAudio UserInput Start Menu Error Timeout When meta-modeling, we start from a clean sheet. Let us take into account an example from the MetaCase tool implementing a DSL for a voice menu for an 8-bit microcontroller. The system would enable the user to control devices at home remotely over the phone. For example, while driving home from work, you could call in and order the system to turn on the air conditioning and garage lights. The menu consists of MenuItems. We can step through the menu according to Choices, with an integer attribute. A MenuItem can be recorded audio, waiting for user input or the start of the menu. Recorded audio can either be a menu message, an error message or a timeout message. From this meta-model, a tool such as MetaCase can generate a modeling environment. Voice menus can now be modeled easily at the right level of abstraction in the most appropriate formalism. The modeler does not have to take issues such as networks or memory restrictions into account. The modeling environment can create executable code from the model. In this generated code, all complex issues are been taken care of. two examples ("random" as they were simply the first two examples of MetaCase): - voice menu for 8-bit microcontroller: http://www.dsmforum.org/voicemenu.html smart phone application: http://www.dsmforum.org/phone.html Similarities: - state-based (state - transition) - constrained environment (battery life, limited memory) - user interaction complex because distributed system Why not language for "interactive applications for embedded systems"? Because of the differences (we want to maximally constrain a language, and use the most appropriate language): - notion of voice vs no notion of voice - notion of menu layout vs voice menu recording (2-dimensional vs 1-dimensional)

Event Action Display SendMessage ViewWebPage Exit Start VisualElement +ID: String followedBy * 1 Display +event: String SendMessage +dest: String +message: String ViewWebPage +url: String Exit Start VisualElement +height: String +width: String shows Widget +code: Text Container +layout: ENUM contains 0..1 * followedBy 1 Event Action +ID: String +event: String +ID: String SendMessage ViewWebPage Exit Start Display +dest: String +message: String +url: String * VisualElement 1 shows +ID: String +height: String +width: String * contains Let us take a look into a second example. This DSL enables the modeling of smartphone applications. An example of such an applications is a conference registration system, which allows users to register by phone, and pay by SMS. There are certain Events that can happen such as clicking, with ID and event description. These events are followed by an Action. Such an Action can be sending a text message, viewing a web page, quitting and starting the application, or displaying a screen. When displaying, a VisualElement is shown, which can be a Widget (such as a text box, label or list – not visualized) or a Container, containing multiple VisualElements. Again, applications can be built on the most appropriate level of abstraction, using the most appropriate formalism. Code can be fully generated and executed on a smartphone. Widget Container 0..1 +code: Text +layout: ENUM

Event Action Display SendMessage ViewWebPage Exit Start VisualElement +ID: String followedBy * 1 Display +event: String SendMessage +dest: String +message: String ViewWebPage +url: String Exit Start VisualElement +height: String +width: String shows Widget +code: Text Container +layout: ENUM contains 0..1 MenuItem Choice +choice: Integer next 1 * RecordedAudio UserInput Start Menu Error Timeout Both DSLs have some things in common. They both transition from one state to another, depending on user interaction. In other words, they both model state based behavior. When defining these languages, we can reuse a simplified version of a formalism which models this, e.g., statecharts. As a benefit, we can use the well-known statechart formalism for analysis. Other parts of the language for smartphone applications can be reused, such as the use of IDs. This is a generic language feature, which might be as well the use of e.g., authorization. Another example is the modeling of the layout. Such layouts can be independent of a domain, and can thus be reused. State Transition transitionsTo 1 *

Up to now, we only talked about abstract syntax Up to now, we only talked about abstract syntax. The concrete syntax can also be reused: for the state based behavior, we can reuse the well-known rounded rectangles as states, and arrows with guard labels as transitions. In order to preserve the meaning of this part of the DSL, we can use the statechart formalism as a semantic domain and automatically map to states and transitions. This way, our newly defined language gets a part of its meaning for free. The difficulty will of course be the composition of these DSLs and their parts.

Event Action Breakpoint SendMessage ViewWebPage Exit Start Display * followedBy 1 Event Action Breakpoint 0..1 interrupts 1 +ID: String +event: String +ID: String SendMessage ViewWebPage Exit Start Display +dest: String +message: String +url: String * VisualElement 1 shows +ID: String +height: String +width: String * contains When the modular composition of DSLs is enabled, we believe this can be used for addressing a number of problems in DSM. First, reuse can lower the initial cost of building the DSL. For this, we need to classify the reusable components. We might think in terms of reusable languages (statecharts, differential equations), but it seems that a better way is to think in terms of language features or properties (behavior, discrete, nondeterminism, hierarchy, …). Second, debugging is an interesting use of this technique. We can add for example breakpoints to the language. If a breakpoint can be set on an Event, we can interrupt the application. The meaning of the breakpoint would be to pause the system and pass the current state to the user. There are some other possibilities, like bridging the gap between requirements and design, traceability, and evolution of languages. Widget Container 0..1 +code: Text +layout: ENUM