Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spray A Quick way of Creating Graphiti A (very) short Introduction Jos Warmer

Similar presentations


Presentation on theme: "Spray A Quick way of Creating Graphiti A (very) short Introduction Jos Warmer"— Presentation transcript:

1 Spray A Quick way of Creating Graphiti A (very) short Introduction Jos Warmer (jos.warmer@openmodeling.nl)

2 ©SAP AG 2009. All rights reserved. / Page 2 Open Modeling Adapted from presentation at Code Generation 2011, Cambridge Graphiti Approach No code generation but: Uses a runtime engine Programmed using a Java API Easy (relatively) to understand code Easy to keep up with evolving metamodel But … Programming the editor in Java is much (simple and repetitive) work

3 ©SAP AG 2009. All rights reserved. / Page 3 Open Modeling Adapted from presentation at Code Generation 2011, Cambridge The Spray Graphiti Generator Started out as generic generator Had to be adapted to the PMW project Is currently partly generic, partly project specific Used by non IT users in production Works well (at least for PMW )

4 ©SAP AG 2009. All rights reserved. / Page 4 Open Modeling Adapted from presentation at Code Generation 2011, Cambridge The Spray DSL class Product icon "Product16.png": container (figure="PmwProduct“) [ text ( bold ) "Product“ ; text ( italic) name ; text ( normal) "V" version ; ] [ reference attributeSpecs : connection ( ) reference note : connection ( ) ] behavior [ create palette “PartPalette” openVersionedPartEditor "Open Part“ ; selectInExplorer "Select In Explorer“; deletePart "Delete Part" ; refresh "Refresh Diagram“ ; ] Define visualization for metaclass Product Definition of shape Contents of the container References to properties of Product References of product shown as connections Behaviour for Product shape Popup menu Will be in palette to create in named compartment Icon shown in palette

5 ©SAP AG 2009. All rights reserved. / Page 5 Open Modeling Adapted from presentation at Code Generation 2011, Cambridge The Spray DSL class ConceptComposition icon "connection16.gif“ : connection (width=2) [ from part to concept toText multiplicity ] Define visualization for metaclass ConceptComposition Shown as a connection (line) Part and concept are references in class ConceptComposition Text to show at the “to” side, also options for “from” and middle of connection

6 ©SAP AG 2009. All rights reserved. / Page 6 Open Modeling Adapted from presentation at Code Generation 2011, Cambridge Spray Generator Using textual model to define graphical editor Xtext, Xtend, Xpand Mixing generated and handwritten code by design Uses Generation Gap pattern Full access to Graphiti API Managed by simply moving a generated file from “src-gen” to “src” folder Generation of code from Spray DSL remains possible in full project life-cycle.

7 ©SAP AG 2009. All rights reserved. / Page 7 Open Modeling Adapted from presentation at Code Generation 2011, Cambridge Spray Future Spray will become open source later this year Oops, already there at: http://code.google.com/a/eclipselabs.org/p/spray/ http://code.google.com/a/eclipselabs.org/p/spray/ Version 0.1 will be the version used for PMW Need to generalize PMW specific generator code and then … first contribution expected a.s.a.p. EPL License Might become an Eclipse project (or part of an existing Eclipse project) Plans Growing Spray by adding more features as we go …..


Download ppt "Spray A Quick way of Creating Graphiti A (very) short Introduction Jos Warmer"

Similar presentations


Ads by Google