MAD: an Eclipse plugin for EMF model edition. MAD is a tool that was created to replace the standard properties view in order to make model editing easier. It allows using a configuration to provide custom edition form for each type of item to edit. MAD doesn't require code generation and any configuration change is applied immediately.
Strategies for Landing an Oracle DBA Job as a Fresher
MAD Model Aggregator eDitor (EMF)
1. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 1
MAD
Model Aggregator eDitor
Fabien Vignal – Philippe Palau
Http://www.sysord.com
2. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 2
Who Are We ?
Software Engineer
SYSORD
- Small company (3 person-strong) located in Roquefort (FR12)
- Eclipse, RCP, Java, J2EE
- Software development for the food industry
Interested in MDA and development automation
Empirical approach before using EMF
3. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 3
Motivation
Daily use of EMF / UML modelers
Properties view :
- Not very user friendly
- Not always adapted to user needs
4. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 4
What Would Be Nice ...
An input form with adapted widgets
Properties adapted to user needs
Revised form design
Simple navigation between elements
5. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 5
MAD :Model Aggregator
eDitor
Video MAD for UML Model (http://youtu.be/ACFS6ajAsV8)
6. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 6
MAD Concepts (Configuration)
Use of metamodels
Description of views
- Template by EClassifier
- Includes configurable widgets
- Values obtained using queries
Reuse of templates :
- Inheritance (implicit / explicit)
- Composition
Configuration changes immediately applied :
- No code
- No generation
7. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 7
MAD Concepts (Edit / Save)
Editing of the selected element
Property modification using widgets
Value validation before update
Two types of model
- Main model
- Foreign model
MAD only saves foreign models
8. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 8
Architecture
Service-oriented architecture
Three main plugins
- API : interfaces (services / objects)
- Core : implementations
- UI : Eclipse view implementation
9. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 9
Core
Main Services :
- View Builder
- Configuration Manager
- Model Access Object
- Query Evaluation Service
Core provides default service implementations
Any service can be replaced or customised
10. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 10
User Interface (UI)
Uses Core to get the model for the view
Eclipse view (SWT)
Customisation :
- ViewBuilder et WidgetBuilder extensions
- New custom widgets
- New UI library target : (JavaFX / HTML)
11. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 11
Technology Used
Eclipse
Xtext (configuration editor + DSL)
SWT + FormToolKit / Eclipse view
Query evaluators :
- OCL
- Acceleo
EMF Adapters (Model synchronization)
Dependency injection with Guice
12. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 12
Queries (I)
Queries
"authors" no language defined, OCL by default
language:ACCELEO call authorsOfSeveralBooks() Acceleo Query call
language:MAD "CREATE('books')" MAD function to create a new book
Query chains
Query Chain {
"books->last()",
language: ACCELEO call authorMultiBook(),
"first()"
}
13. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 13
Queries (II)
Subqueries
eContainer().oclAsType(Library).books->select(pages > [pages])->isEmpty()
The first 'pages' refers to the books in the iteration. '[pages]' is evaluated before the
iteration and corresponds to the number of pages of the book.
Contextual Variables
$CONTEXT, $VALUE, $UIVALUE, $MODEL … usable variables for queries.
$UIVALUE > 10 and $UIVALUE < 10000
Validation rule of a numerical widget's value
Need for evaluator monitoring
14. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 14
MAD in Action
The Tinylibrary model
15. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 15
tinylibrary.mad Configuration
MAD base configuration import
Tinylibrary metamodel import
16. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 16
Widgets
Set of configurable widgets
InputWidgets :
- Text, Numeric, Date, Boolean
- ComboBox, List, PickList (popup or embedded)
- Embedded Xtext editor
OutputWidget
NavigationWidget
FlexibleWidget
Command
Extendable by customised implementation
17. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 17
First Configuration (I)
//------------------------------------------
// MAD configuration for Tiny library model
//------------------------------------------
//MAD base configuration import
import "platform:/resource/mad.configuration/config.mad"
//Tiny library Ecore metamodel import
import
"platform:/plugin/com.sysord.mad.demo.tinylibrary/model/tinylibrary.ecore"
//Configuration for a Book element
Configuration BOOK for tinylibrary.Book {
template:
//Textbox widget for editing title property
widget:Title //the widget id
label:"Title" //widget label
type:TEXT_WIDGET //display a text widget
value:"title" //Ocl query for getting the 'title' property from the book.
}
18. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 18
First Configuration (II)
19. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 19
Simple Widgets
Configuration BOOK for tinylibrary.Book {
//Format expression for all Book elements Label computing
//queries between [] are evaluated parts.
label provider:"Book: [title]"
template:
...
//Number input widget
widget:Pages
label:"Pages"
type:NUMBER_WIDGET
value:"pages"
//Date input widget
widget:PublicationDate
label:"Publication date"
type:DATE_WIDGET
value:"published"
//Checkbox widget
widget:Damaged
label:"Is damaged"
type:BOOL_WIDGET
value:"damaged"
}
20. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 20
List Widgets
List content (candidates) provided by queries
//Configuration for a Book element
Configuration BOOK for tinylibrary.Book {
...
//Combo widget
widget:Category
label:"Category"
type:SINGLE_SELECT_WIDGET
value:"category":tinylibrary.BookCategory
//OCL query for filling combo
candidates:"BookCategory.allInstances()"
//Popup PickList widget
widget:Authors
//Dynamic label value
label:"[authors->size()] authors"
type:MULTI_SELECT_WIDGET:POPUP_PICKLIST
value:"authors"
//Populate the list with candidates query results
candidates:"eContainer().oclAsType(Library).writers"
item label:"[name]"
}
21. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 21
Navigation Widget
List of links to detail view of a selected element
Double-click to access detail element
Click on the left arrow to return
//Configuration for the Library element
Configuration LIBRARY for tinylibrary.Library {
template:
//Navigation for accessing Book detail
widget:BooksNavigation
label:"Books"
type:NAVIGATION_WIDGET
candidates:"books"
}
22. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 22
Output Widget
Display read-only values
Elementary properties or computed values
Configuration BOOK for tinylibrary.Book {
...
//Output text
widget:avgPage
label:"Pages by author"
type:OUTPUTTEXT_WIDGET
//conditional visibility
visible when:"not authors->isEmpty()"
//Compute pages average by authors.
value:"(pages / authors->size())"
//value converter from double to string.
valueConverter:DOUBLE
}
23. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 23
Flexible Widget (I)
//Configuration for a person element (abstract)
Configuration Abstract_PERSON for tinylibrary.Person {
label provider:"[name]"
template:
widget:Name
...
widget:FirstName
...
widget:LastName
...
}
//Configuration for a Writer element.
//(extends implicitly Person configuration)
Configuration WRITER for tinylibrary.Writer {
template:
widget:Books
label:"Books"
type:FLEXIBLE_WIDGET
//include Book template for each writen book
value:"books"
}
24. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 24
Flexible Widget (II)
Selection of the template to use for the flexible elements
//Alternative configuration for a Book element
Configuration BOOK_SHORT for tinylibrary.Book {
//Explicit extension
extends: BOOK //Reuse the BOOK template
template:
//Display only those widgets
layout: Isbn Title
}
Configuration WRITER for tinylibrary.Writer {
template:
widget:Books
label:"Books"
type:FLEXIBLE_WIDGET
//Use the BOOK_SHORT template
//for book detail.
flexible template: BOOK_SHORT
value:"books"
}
25. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 25
Command
//Icon declaration
Use icon DELETE_ICON URI:"platform:/resource/mad.configuration/icons/delete-icon_16.png"
//Shared command declaration
Common Command DELETE_ELEMENT_COMMAND {
ITEM_COMMAND
"Delete item" //Command label
icon:DELETE_ICON //Image for the command button
//launch the DELETE MAD Macro for deleting selected item
action: language:MAD "DELETE()"
on success: Reload view
}
Configuration LIBRARY for tinylibrary.Library {
template:
widget:BooksNavigation
label:"Books"
type:NAVIGATION_WIDGET
candidates:"books"
commands:
//Inner command for creating a new book
GLOBAL_COMMAND "New Book"
action: language:MAD "CREATE([OCL:'books'])"
//after creation displays view
//for the created item: the command RESULT.
on success: Display view for "$RESULT",
//Use shared command with label override
DELETE_ELEMENT_COMMAND("Delete the selected book.")
}
26. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 26
Other Widgets
- Xtext embedded editor
- Custom Widgets
- HTML Link
- Google Map widget
Demonstration video for the first version of MAD:
MAD and Xtext (http://youtu.be/ShoLi5XoQOw)
MAD is customizable (http://youtu.be/2NTAP--Hi1I)
27. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 27
« Layout »
Widgets distribution by tab
Display order selection
//tab declaration
UI Tab {
id:WRITEN_BOOKS
label:"Writen books"
}
Configuration WRITER for tinylibrary.Writer {
template:
widget:Books
//the widget will be diplayed
//on the WRITEN_BOOKS tab
tab:WRITEN_BOOKS
label:"Books"
type:FLEXIBLE_WIDGET
flexible template: BOOK_SHORT
value:"books"
//widgets display order definition
layout: LastName FirstName Name Books
}
28. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 28
Validators
Validation based on rules
Configuration BOOK for tinylibrary.Book {
…
//Number input widget
widget:Pages
label:"Pages"
type:NUMBER_WIDGET
value:"pages"
validators:
//Validation: pages widget must be filled
//and its value between 10 and 10000
validation rule:
"not $UIVALUE.oclIsUndefined()"
I18N Error message:"REQUIRED_VALUE"
validation rule:
"$UIVALUE > 10 and $UIVALUE < 10000"
I18N Error message:"VALUE_OUT_OF_RANGE[10][10000]"
…
}
29. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 29
Layers
Filter and aggregate information by domain
« Layers » are hierarchical and stackable
//Layers configuration
Layer INFO_LAYER {
label:"All Information"
Sub layers {
Layer BASIC {label:"Basic information"}
Layer DETAILED{label:"Additional information"}
}
}
Layer STATISTICS_LAYER {
label:"Statistics"
Sub layers {
Layer AUTHOR{label:"Authors statistics"}
Layer BOOKS{label:"Books statistics"}
}
}
Configuration BOOK_SHORT for tinylibrary.Book {
...
widget:Pages
//available only in books statistics layer
layers: STATISTICS_LAYER.BOOKS
...
//Output text
widget:avgPage
//available in the two layers
layers:STATISTICS_LAYER.BOOKS,
STATISTICS_LAYER.AUTHOR
label:"Pages by author"
...
}
30. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 30
Other Functionalities
I18N : for all labels and messages
Referentials : Queries, Commands, Constants
Multimodel edition (decoration and extension)
- Extension manager
- Model Synchronisation
31. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 31
Use Cases
MDE/MDA approach with Eclipse
RAD approach : editor creation with a user
Identical edition whatever the modeler used
Domain specific commands
32. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 32
Conclusion
MAD is functional
Used by Sysord for all modelling works
(UML, etc …)
Ongoing evolutions : queries compilator
(performance optimisation)
33. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 33
Perspectives
Queries creation wizards
CDO for multi-user mode
MAD configuration generator
MAD plugins generator
Multimedia element edition
sound, images, videos, Charts and Graph
Eclipse4, JavaFX
34. SYSORD - Model Aggregator eDitor – Fabien Vignal – Philippe Palau – Stephan Montagnes 34
Merci