Integrate your tools to help integrate your stakeholders Stephan Herrmann EclipseCon Europe 2013
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 3 Why, exactly, develop DSLs? Remember the 'S' 4 One language per domain / task / problem (?) 4 Once we understand a task, it's easy to create a DSL for it What have we gained? 4 Generate Java classes for your domain objects 4 Were these the hard problems of the 2010s? What are the bottlenecks? 4 Borders & gaps 4 between technologies 4 between people! 4 Devide & Conquer? 4 Separation & Integration!
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 4 Why, exactly, develop DSLs? Remember the 'S' 4 One language per domain / task / problem (?) 4 Once we understand Xtext = a task, Generator it's easy to create a DSL for it What have we gained? 4 Generate Java classes for your domain objects 4 Were these the hard problems of the 2010s? What are the bottlenecks? 4 Borders & gaps 4 between technologies 4 between people! 4 Devide & Conquer? 4 Separation & Integration! DSL = Separation IDE = Integration
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 5 S How specific, exactly? How many languages?
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 6 S 3D DSLs 1. Dimension: Domains Domain objects 4 The things the customer deals with 4 Structure only UI 4 The things the customer wants to see 4 Layout / style Flow 4 What the customer wants to do 4 Sequence of screens and operations Model View Controller Operations 4 aka services, methods, actions 4 DSL = Java
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 7 S 3D DSLs 2. Dimension: Levels of Detail Consultants view 4 Domain knowledge, business, legal Java development 4 Target platform 4 Packages, Factories 4 Abstract, reference/containment Talking about the same stuff But from difference viewpoints Having different skills DB development 4 Tables, joins, keys....
S 3D DSLs 3. Dimension: Representations DSL textual 4 Best value for the money DSL IDE representations 4 Outline 4 Text hover Graphics? 4 GDSL? 4 expensive to develop well 4 graphical editing distracts 4 Graphical visualization is cool Where's the PDF? 4 Managers won't open Eclipse, they want documents :) Documentation 4 What's the DSL for natural language text? 4 Formatting / styling?... Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 8
S Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 9
I Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 10
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 11 I Integration: Stakeholders Product owner 4 specify 4 document 4 requirements understand participate automate communicate... Interaction designer 4 themes 4 layouts 4 usability Developer 4 framework 4 application QA / Tester 4 crash 4 req. violation 4 req. inconsistency
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 13 I 3D DSLs 1. Integrating Domains 4 Domain objects 4 UI 4 Flow Integration by inclusion 4 Create one big language 4 Maximum freedom, will be abused Integration by reference 4 cross-model references 4 cross-model inheritance 4 manually maintained meta models 4 Separate but connected 4 Litmus test: cross-language F3 grammar mixin import model oops
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 14 I 3D DSLs 2. Integrating Levels of Detail 4 Domain knowledge 4 Java development 4 DB development Inline enrichment 4 Xtext: grammar mixin 4 Huge files 4 Separate responsibility? Differential enrichment 4 Slices are connected by name equality 4 Xtext pattern: 4 needs some tweaks but then works fine (ResourceDescriptionStrategy, QualifiedNameProvider, DescriptionLabelProvider) 4 Separate but connected 4 separate ownership / responsibility 4 Litmus test: cross-language F3 E1 E1' E1'' Entity : name=[uppermodel::entity]...
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 15 I 3D DSLs 2. Integrating Levels of Detail 4 Domain knowledge 4 Java development 4 DB development Inline enrichment 4 Xtext: grammar mixin 4 Huge files 4 Separate responsibility? Differential enrichment 4 Slices are connected by name equality 4 Xtext pattern: 4 needs some tweaks but then works fine (ResourceDescriptionStrategy, QualifiedNameProvider, DescriptionLabelProvider) 4 Separate but connected 4 separate ownership / responsibility 4 Litmus test: cross-language F3 E1 E1' E1'' Product Owner: You mean, we can produce bugs??? Entity : name=[uppermodel::entity]...
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 17 I Specification / Documentation (OLD) Specifier 4 specify 4 document 4 requirements copy&paste Developer 4 code 4 document
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 18 I Specification / Documentation (New) Product Owner 4 specify 4 document 4 requirements Developer 4 code 4 document
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 19 I WikiText DSL WikiText Integration DSL 4 Business as usual Wiki 4 Mylyn WikiText 4 mediawiki 4 Extension.dodoc 4 Spell checking Outline 4 Connect both editors Perspective 4 Leverage Eclipse e4
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 20 I WikiText Requirement: Multi-Language Capability One:many 4 One Model (DSL) : many documentation languages Translation 4 Separate responsibility
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 21 I WikiText How does it work? Structure correspondence 4 Files 4 Content 4 Translatable headings
I WikiText Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 22 How does it work? Content Synchronization 4 Automatic? 4 too much magic 4 defeats separation of responsibility 4 Warnings & Quickfixes 4 create initial content 4 1 TODO per element
I WikiText Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 23 How does it work? Content Synchronization 4 Automatic? 4 too much magic 4 defeats separation of responsibility 4 Warnings & Quickfixes 4 create initial content 1 TODO per element 4 add missing element sort into existing struct. 4 Warning configurable 4 for release: Error
I WikiText Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 24 How does it work? Editor Linking 4 Xtext outline Xtext editor 4 Button: Open documentation 4 Do not use WikiText outline 4 no create / no update 4 rewire to Xtext outline 4 N-way selection listener 4 Xtext listener WikiText 4 WikiText Xtext 4 intercept wikitext update 4 avoid cycles :) 4 Re-validate on save (n-way)
I WikiText Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 25 Usage WikiText Consumption 4 View using WikiText Preview
I WikiText Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 26 Usage WikiText Consumption 4 View using WikiText Preview 4 Included in text hover 4 formatted via HTML
I WikiText Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 27 Usage WikiText Consumption 4 View using WikiText Preview 4 Included in text hover 4 formatted via HTML 4 Include in generated Java / Javadoc 4 Generate PDF documentation 4 intermediate format <DocBook/> 4 Product Owner can change layout/styling 4 in reality much nicer than shown :)
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 28 I Technically Tool Integration Connect 2 Independent Frameworks? 4 Xtext isn't expecting to interact with WikiText 4 WikiText isn't expecting to interact with anybody 4 Combination is impossible, normally Adaptation using Object Teams 4 Cheat with style 4 OT/Equinox: Declared plugin adaptation 4 Team ( ): Module for class-adaptations 4 Role ( ): Externally extend one class 4 Separate, but connected 4 Roles/bases are separate instances 4 Connected by additional control flows 4 Woven at loadtime 4 Enabled/disabled at runtime
I Technically Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 29 Tool Integration with Object Teams Implementation: Object Teams 101 4 Role class is bound to a base classe (playedby) 4 Runtime: instances of base can be adapted by instances of role 4 Role method is bound to a base method 4 -> forward role-to-base (make base method accessible in role) 4 <- intercept base-to-role (one of before, after, replace) 4 advanced: guard predicate (intercept only specific calls)
I Technically Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 30 Tool Integration with Object Teams Avoid refresh of the wrong outline 4 WikiText Outline is not rendered 4 Still maintaining the outline-model 4 Adaptation using Object Teams 4 E.g.: replace method MarkupEditor.updateOutline(..) 4 Make small change inside
I Technically Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 32 Tool Integration with Object Teams Avoid refresh of the wrong outline 4 WikiText Outline is not rendered 4 Still maintaining the outline-model 4 Adaptation using Object Teams 4 E.g.: replace method MarkupEditor.updateOutline(..) 4 Make small change inside 4 Maintenance: Compare with base method
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 33 I Technically Tool Integration with Object Teams Avoid refresh of the wrong outline 4 WikiText Outline is not rendered 4 Still maintaining the outline-model
I Technically Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 34 Tool Integration with Object Teams Summary: Usage of Object Teams 4 WikiText integration 4 Size < 300 LOC OT/J 4 Functionality: 100% 4 Build & Deploy: 4 Maven integration exists (OT/J compiler is a variant of the JDT compiler) 4 Installation into the IDE is a regular p2-based install 4 Interim fixes for framework bugs (15 150 LOC OT/J per bug) 4 354402 - Would like to run all validators, even when finding errors 4 354374 - [Issues] DiagnosticConverterImpl.resolveStructuralFeature() should probably resolve? 4 ValueConverterException when quickfix encounters a QualifiedName
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 36 I Technically Challengens & Pain Points Building 4 Integrate DSL generator into non-osgi application builds 4 Integrate DSL runtime into non-osgi application 4 Eclipse + Xtext + p2 + maven + tycho + fornax + mwe2 + b3 + Jenkins + nexus + 4 Huge time sink 4 Trial & Error 4 Long turnarounds
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 37 I Other Representations Are our Product Owners happy now? 4 Regarding Domain Objects: yes Next Challenge: Process Models / Flows Stakeholders 4 Product Owners Specify & document 4 Interaction Designer Use as input and give feedback 4 Testers Write tests w/o the application What do they want to see? 4 DSL & Documentation 4 Scenarios! 4 Graphs!! Graph implementation 4 based on GraphView (Jan Koehnlein) 4 KIELER (graphviz etc.) & GEF
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 38 Status & Summary Stakeholders 4 Developers actively participate 4 Product Owners pending: presentation of achievments, more pictures 4 Testers pending: find suitable language, infect some people Domains 4 Domain Objects 4 Flow fully connected: x-ref, IDE interoperability, etc. 4 UI <xhtml> Levels of Detail 4 Layered DSLs Representations 4 DSL 4 Documentation 4 editing 4 document 4 Graph ( ) 4 IDE views + hovers Many DSLs, each focusing on one task All are connected to avoid gaps and borders Suitable representations for communication between stakeholders
Stephan Herrmann: Integrate your Tools... - EclipseCon Europe 2013 39 Cast 4 Xtext 4 Mylyn WikiText 4 Mediawiki 4 Object Teams (incl. special stunts) 4 DocBook 4 PDF 4 HTML/XHTML 4 EMF 4 JDT 4 Xtend 4 Outline 4 Hover Light 4 GEF 4 KIELER Caterer 4 @NonNull Drivers 4 Maven, Tycho, p2, b3, e4, fornax, MWE2, JUnit, SVN, Subversive, Git, EGit Disclaimer 4 No animals were harmed in the making of this presentation Statistics Application X 4 DSL 1: 4 base model: 17 kloc in 613 files 4 refinement: 21 kloc in 2 files 4 DSL 2: 4 base model: 2 kloc in 25 files 4 refinement: 1 kloc in 41 files Statistics Application Y 4 DSL 1: 4 base model: 13 kloc in 216 files 4 refinement: 2 kloc in 45 files