Tools and Methodologies for GMF
Aurélien Pupier R&D Engineer, Studio Project Leader
GMF-Runtime Committer @apupier
EclipseDay Delft , September 27, 2012
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 2
Agenda
Show me a GMF editor
GMF Big Picture
Methodologies
Tooling
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 3
GMF BIG PICTURE
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 4
GMF
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 5
GMF Basic Workflow
Semantic Model (ecore)
Diagram Model
GMF codegen
Diagram code
Mapping
Code generation
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 6
What happens after the first generation?
Requirements update
Introduce specific behavior
I’m not able to do a one shot!
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 7
METHODOLOGIES
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 8
Update the model!
Straightforward
Best maintainability
Easiest solution
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 9
GMF Extension points
24
Classical Eclipse way
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 10
Extension points – Typical pattern
Custom Diagram PLUG-IN
CustomXXXEditPartProvider CustomXXXEditPart
GENERATED Diagram PLUG-IN
extends extends
XXXEditPartProvider XXXEditPart
Reference
Reference
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 11
Generation templates
When?
Apply to a whole kind of elements
Ultimately
Useful for:
Regeneration
New element introduced
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 12
Generation aspect templates
Reduce amount of code to maintain
Avoid code duplication
Down grain from class to method
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 13
Generation aspect templates
.xpt
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 14
Another tip to reduce size of custom generation templates?
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 15
Utility plugin – why?
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 16
Utility plugin – how?
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 17
Modify Generated code
@Generated NOT
Sandbox
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 18
Projects Structure (1/2)
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 19
Projects Structure (2/2)
Generation Templates
Semantic Model
Diagram Model
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 20
GMF Workflow Semantic
Model (ecore)
Diagram Model
GMF codegen
Diagram code
Mapping
Code generation
Extension points
Aspect Template
Utility plugin
Model
Model
TOOLING
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 22
GMF-Tooling
Official tooling of GMF
● Several editors
● Wizards
● GMF Dashboard
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 23
SWTBot4GEF
Automated UI tests
Simple API:
click
drag
select
activateTool
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 24
Code generation Ant Task
Generate code at build time
Avoid reconcilier issues
Avoid modification of your sandbox commited
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 25
OCL Editor and Interpreter
Write and Test constraints
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 26
Simple Mapping Editor (1/2)
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 27
Simple Mapping Editor (2/2)
All-in-one editor
Keep separation of concerns available
Eating your own dog food
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 28
EDapt
Big underlying model modifications
PoC for BOS 6.0
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 29
Keep in mind
Great tooling ecosystem
Proven methodologies for continuous improvement
9/29/2012 www.bonitasoft.com | © BonitaSoft S.A. 30
To go further
Eclipse GMF Forum: http://www.eclipse.org/forums/index.php/f/16/
Eclipse GMF Wiki: http://wiki.eclipse.org/GMF
Talk together
Twitter: @apupier
Eclipse blog: www.bonitasoft.org/blog/category/eclipse
Talk to me about Bonita, BPMN2, Eclipse Modeling and more
Company: www.bonitasoft.com
Community: www.bonitasoft.org
Twitter: @bonitasoft