11. DIAGRAMS
ARE TALKING TO
YOU
NOT TO YOUR
COMPUTER
Mittwoch, 28. März 12
12. REQUIREMENTS
Model Diagram
(Computer) (User)
Mittwoch, 28. März 12
13. REQUIREMENTS
Model Diagram
(Computer) (User)
Completeness
Conciseness
Consistency
Containment
Mittwoch, 28. März 12
14. REQUIREMENTS
Model Diagram
(Computer) (User)
Completeness Explain Model to Humans
Conciseness Projection, arbitrary focus
Consistency Verbosity and sloppiness
Containment Slick visual design
Usability of a drawing tool
Mittwoch, 28. März 12
17. MISMATCH IS THE RULE
Diagram
children
TreeNode
*
nodes * * edges
Node Edge
Mittwoch, 28. März 12
18. MISMATCH IS THE RULE
Diagram
children
TreeNode
*
nodes * * edges
Node Edge
Mittwoch, 28. März 12
19. MISMATCH IS THE RULE
Diagram
children
TreeNode
*
nodes * * edges
Node Edge
TreeNode A
> TreeNode B
Mittwoch, 28. März 12
20. MISMATCH IS THE RULE
Diagram
children
TreeNode
*
nodes * * edges
Node Edge
TreeNode A
> TreeNode B
Mittwoch, 28. März 12
21. MISMATCH IS THE RULE
Diagram
children
TreeNode
*
nodes * * edges
Node Edge
Diagram
TreeNode A
> Node A
> TreeNode B
> Node B
> Edge (A,B)
Mittwoch, 28. März 12
26. GHOST ELEMENTS
Remnants of failed
Cut/Copy/Paste/Delete
or Drag & Drop actions
Breaking model integrity
Not shown in any diagram
Mittwoch, 28. März 12
32. YOUR EDITOR
DEGRADES
WHEN YOU FOCUS ON
MODEL EDITING
Mittwoch, 28. März 12
33. WHAT IS YOUR FOCUS
Model Diagram
Editing Editing
Enforce 1-to-1-mapping Dynamic one-way mapping
• Assimilate diagram Full graphical flexibility
• Loss of expressiveness Style for understandability
• Loss of usability Choose projection easily
• Add non-graphical tools • Find another way to edit
Mittwoch, 28. März 12
34. MODEL VIEW SOLUTION
One-way
Mapping
Semantic model Diagram
Mittwoch, 28. März 12
35. MODEL VIEW SOLUTION
One-way
Mapping
Semantic model Diagram
Mittwoch, 28. März 12
38. RUNTIME
• Reads mapping and stylesheet
• Capture snapshots of any live model
• Render GEF diagram with shape library
• Selection / navigation adapter for
• EMF, Xtext, JDT
Mittwoch, 28. März 12
39. MAPPING DSL
• Xtext-based with Xbase expressions
• Uni-directional transformation
• Interpreted
Mittwoch, 28. März 12
40. STYLING DSL
• Xtext-based with Xbase expressions
• Directly modifies Draw2d figures
• Interpreted
Mittwoch, 28. März 12
47. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
MyClass this
SuperClass
Mittwoch, 28. März 12
48. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
MyClass this MyClass
SuperClass
Mittwoch, 28. März 12
49. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
edge SuperType for each this.getESuperTypes() {
MyClass this MyClass
SuperClass
Mittwoch, 28. März 12
50. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
edge SuperType for each this.getESuperTypes() {
MyClass MyClass
SuperClass this
Mittwoch, 28. März 12
51. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
edge SuperType for each this.getESuperTypes() {
=> call EClassNode for this
MyClass MyClass
SuperClass this
Mittwoch, 28. März 12
52. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
edge SuperType for each this.getESuperTypes() {
=> call EClassNode for this
MyClass MyClass
SuperClass this
Mittwoch, 28. März 12
53. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
edge SuperType for each this.getESuperTypes() {
=> call EClassNode for this
MyClass MyClass
SuperClass this SuperClass
Mittwoch, 28. März 12
54. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
edge SuperType for each this.getESuperTypes() {
=> call EClassNode for this
MyClass this MyClass
SuperClass SuperClass
Mittwoch, 28. März 12
55. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
edge SuperType for each this.getESuperTypes() {
=> call EClassNode for this
MyClass this MyClass
SuperClass SuperClass
Mittwoch, 28. März 12
56. diagram EClassHierarchy type EClass {
node EClassNode for this {
label Name for this
edge SuperType for each this.getESuperTypes() {
=> call EClassNode for this
}
}
}
MyClass this MyClass
SuperClass SuperClass
Mittwoch, 28. März 12
57. stylesheet EClassHierarchy
for EClassHierarchy
style EClassNode.SuperType {
var arrow = new PolygonDecoration()
arrow.setScale(10,10)
arrow.backgroundColor = color(#ffffff)
arrow.lineWidth = 2
this.targetDecoration = arrow
}
style EClassNode.Name {
font = font("Helvetica", 13,
if (element.abstract) 3 else 1)
}
Mittwoch, 28. März 12
58. stylesheet EClassHierarchy
for EClassHierarchy
refs to mappings
style EClassNode.SuperType {
var arrow = new PolygonDecoration()
arrow.setScale(10,10)
arrow.backgroundColor = color(#ffffff)
arrow.lineWidth = 2
this.targetDecoration = arrow
}
style EClassNode.Name {
font = font("Helvetica", 13,
if (element.abstract) 3 else 1)
}
Mittwoch, 28. März 12
59. stylesheet EClassHierarchy
for EClassHierarchy
style EClassNode.SuperType {
var arrow = new PolygonDecoration() Xbase body
arrow.setScale(10,10)
arrow.backgroundColor = color(#ffffff)
arrow.lineWidth = 2
this.targetDecoration = arrow
}
style EClassNode.Name {
font = font("Helvetica", 13,
if (element.abstract) 3 else 1)
}
Mittwoch, 28. März 12
60. stylesheet EClassHierarchy
for EClassHierarchy
style EClassNode.SuperType {
var arrow = new PolygonDecoration()
arrow.setScale(10,10)
arrow.backgroundColor = color(#ffffff)
arrow.lineWidth = 2
this variable
this.targetDecoration = arrow
}
style EClassNode.Name {
font = font("Helvetica", 13,
if (element.abstract) 3 else 1)
}
Mittwoch, 28. März 12
61. stylesheet EClassHierarchy
for EClassHierarchy
style EClassNode.SuperType {
var arrow = new PolygonDecoration()
arrow.setScale(10,10)
arrow.backgroundColor = color(#ffffff)
arrow.lineWidth = 2
this.targetDecoration = arrow
}
color literals
style EClassNode.Name {
font = font("Helvetica", 13,
if (element.abstract) 3 else 1)
}
Mittwoch, 28. März 12
62. stylesheet EClassHierarchy
for EClassHierarchy
style EClassNode.SuperType {
var arrow = new PolygonDecoration()
arrow.setScale(10,10)
arrow.backgroundColor = color(#ffffff)
arrow.lineWidth = 2
this.targetDecoration = arrow
}
style EClassNode.Name { extensions
font = font("Helvetica", 13,
if (element.abstract) 3 else 1)
}
Mittwoch, 28. März 12
63. stylesheet EClassHierarchy
for EClassHierarchy
style EClassNode.SuperType {
var arrow = new PolygonDecoration()
arrow.setScale(10,10)
arrow.backgroundColor = color(#ffffff)
arrow.lineWidth = 2
this.targetDecoration = arrow
}
style EClassNode.Name {
font = font("Helvetica", 13,
if (element.abstract) 3 else 1) semantic styling
}
Mittwoch, 28. März 12
64. The code is at
https://github.com/JanKoehnlein/Generic-Graph-View
But remember:
IT‘S A PROTOTYPE
Mittwoch, 28. März 12