MD*<br />MD*<br />Best Practices<br />MarkusVoelter<br />MD*<br />Independent/itemis AG<br />www.voelter.devoelter@acm.org...
About<br />Markus Voelter<br />Independent Consultant<br />
About<br />Markus Voelter<br />Independent Consultant<br />Software Architecture<br />DSLs & MDSD<br />ProductLines<br />
About<br />Markus Voelter<br />Independent Consultant<br />http://www.voelter.de<br />voelter@acm.org<br />skype: schoggla...
Read the<br />Paper!<br />http://www.voelter.de/data/articles/DSLBestPractices-Website.pdf<br />
<br />DesigningLanguage<br /><br />the<br />
Sourcesforthe Language<br />
Technical DSLs<br />extractedfrom<br />… framework<br />… library<br />… pattern (language)<br />… architecture<br />Langu...
Business DSLs<br />extractedfrom<br />Language Sources<br />
Domain Analysis<br />Language Sources<br />
Domain Analysis<br />Language Sources<br />Not just software!<br />
Limit Expressiveness<br />
Limit Expressiveness<br />
Configuration<br />select<br />   …fromconfigspace<br />Limit Expressiveness<br />… Properties<br />… Feature Models<br />
Customization<br />compose<br />   … creatively<br />Limit Expressiveness<br />… Vocabulary<br />… Sentences<br />… Box an...
Precision<br />preciselywhat<br />Limit Expressiveness<br />… facts<br />… declarative<br />… domainexpertscan!<br />
AlgorithmicCompleteness<br />formallyhow<br />Limit Expressiveness<br />… automation<br />… execution<br />… in model proc...
Limit Expressiveness<br />Use a 3GLifnecessary<br />Generate APIs, Hooks<br />
Do you want<br />users<br />to build their own <br />Limit Expressiveness<br />abstractions<br />with the language?<br />
DSL is a compromise:<br />… Domain Abstractions<br />… Reuse, Modularization, …<br />Limit Expressiveness<br />… All Data ...
Notation, Notation, Notation<br />
Domain Users<br />caredeeply<br />Notation, …<br />aboutnotation!<br />„UI“ forthelanguage<br />
Textual<br />Graphical<br />Form-Based<br />Spreadsheet<br />Notation, …<br />
Parts<br />Notation, …<br />
Convertible<br />Notation, …<br />
Embedded<br />Notation, …<br />
Notation, …<br />Tool<br />Specific!<br />
Graphical vs. Textual<br />
Graphical<br />Sequence/Flow<br />Grapical vs. Textual<br />
Graphical<br />Grapical vs. Textual<br />Relationships<br />
Graphical<br />Grapical vs. Textual<br />Timing<br />
Textual<br />In all othercases!<br />Grapical vs. Textual<br />
Textual<br />Real simple…<br />…CVS/SVN Integration<br />… Diff/Merge<br />… Buildautomation<br />… Model Migration<br />G...
Text + Visualization<br />Grapical vs. Textual<br />
Text + Visualization<br />… problem-specific<br />… anwers specific questions<br />… highlight specific aspects<br />… sev...
DSL Semantics<br />
?<br />Whatdoesit all<br />mean?<br />DSL Semantics<br />
DSL Semantics<br />
DSL Semantics<br />
DSL Semantics<br />
DSL Semantics<br />Documentation<br />
Viewpoints<br />
Viewpoints<br />
Viewpoints<br />
Well-defined<br />DependenciesandConnectionPoints<br />Viewpoints<br />
Try toavoid<br />overlapandtheneedforsynchronization.<br />Viewpoints<br />
Viewpoints<br />Tool<br />Specific!<br />
Partitioning<br />
scale<br />MD* tools do not<br />Partitioning<br />arbitrarily!<br />
Partitions<br />Partitioning<br />… separate resources<br />… != logicalstructure<br />… unitsof check in/out … processabl...
X<br />cross<br />Partition<br />references<br />Partitioning<br />… lazy<br />… byproxy<br />… byname w/ linker<br />
Partition<br />Partitioning<br />… not transparent<br />… partoflanguage design<br />… referencableelements<br />… „includ...
Partitioning<br />Tool<br />Specific!<br />
Evolution<br />
Whatto do withexisting<br />models<br />Evolution<br />ifthe<br />language<br />changes?<br />
MightRequire…<br />Evolution<br />… configmanagement<br />… version tag in models<br />… changetracking<br />… migration M...
Think about…<br />Evolution<br />… backwardcompatibility<br />… deprecation<br />… instrumentation<br />… viewpoints + par...
Evolution<br />Tool<br />Specific!<br />
The Fallacyof<br />GenericLanguages<br />
FallacyofGeneric Lang.<br />
Youcan model<br />everything<br />with<br />FallacyofGeneric Lang.<br />
Youcan model<br />everything<br />with<br />FallacyofGeneric Lang.<br />somehow!<br />
Problem<br />Shoehorningdomainabstractionsintothe<br />genericlanguage<br />FallacyofGeneric Lang.<br />
Problem<br />Sidetrackedbyexistingabstractionsandnotations<br />FallacyofGeneric Lang.<br />
FallacyofGeneric Lang.<br />Very LimitedTool Support!<br />Notations/ Abstractionsextensiblevia Profiles<br />
Meta Model<br />Complexity!<br />FallacyofGeneric Lang.<br />
Wherearestandardsuseful?<br />FallacyofGeneric Lang.<br />
Peoplehavetolearnunderlying<br />concepts anyway.<br />FallacyofGeneric Lang.<br />
Is UML witha profilestill a standardlanguage?<br />FallacyofGeneric Lang.<br />
On whichmetaleveldo I wanttostandardize?<br />M2 (UML), M3 (MOF)?<br />FallacyofGeneric Lang.<br />
Isn‘t a DSLbased on MOFas „standard“ as a profilebased on UML?<br />FallacyofGeneric Lang.<br />
Introduce an <br />intermediate<br />language<br />FallacyofGeneric Lang.<br />
separate<br />DSL<br />viewpoints<br />UML + DSL<br />DS Model<br />FallacyofGeneric Lang.<br />
FallacyofGeneric Lang.<br />BPM <br />is to analysts<br />what<br />UML<br />is to developers.<br />
Butdon‘treinventthewheeleither.<br />FallacyofGeneric Lang.<br />
Build your own languageinspiredbyexisting language<br />FallacyofGeneric Lang.<br />
Learnfrom 3GLs<br />
DSL != 3GL<br />Learnfrom 3GLs<br />But:<br />
Namespaces<br />VisibilityEncapsulation<br />Scoping<br />Specialization<br />Cohesion<br />Coupling<br />abstract<br />…<...
Read thisBook:<br />Learnfrom 3GLs<br />Concepts, TechniquesandModels of Computer Programming<br />by Peter Van Roy and Se...
Type Systems<br />
Knownfrom3GLs<br />Type Systems<br />Classes & Objects<br />
Examples:<br />Components<br />& Instances<br />Type Systems<br />Data Types<br />& Instances<br />Config Table Defs<br />...
Viewpoint B<br />(Types)<br />Type Systems<br />instanceof<br />Viewpoint A<br />(Instances)<br />
Viewpoint B<br />(Types)<br />Type Systems<br />instanceof<br />Viewpoint A<br />(Instances)<br />
MetaMeta Model (M3)<br />instanceof<br />Viewpoint B<br />(Types)<br />MetaModel (M2)<br />Type Systems<br />instanceof<br...
Support for ReuseandVariations<br />
There‘smoreto<br />reuse<br />Reuse andVariations<br />than<br />partitions<br />
The language<br />must provide<br />explicit<br />Reuse andVariations<br />support!<br />(wecanlearnthatfrom OO)<br />
Specialization<br />overriding, overwriting<br />Leaving Holes<br />Reuse andVariations<br />for variant tofill in<br />In...
Specialization<br />Inheritance<br />Leaving Holes<br />Reuse andVariations<br />Template Method Pattern<br />InjectStuff<...
Reuse andVariations<br />Makesureyou<br />delineate<br />the API!<br />
Reuse andVariations<br />Domain Users<br />might not<br />understand this!<br />
Who are 1st Class Citizens?<br />
Big Language<br />Who are 1st Class Citizens<br />withmanyconcepts!<br />
Small Language<br />Who are 1st Class Citizens<br />withfew, but powefulconcepts!<br />
Big Language<br />Easierfor Business Users<br />Concepts easy to find<br />COBOL style<br />Who are 1st Class Citizens<br />
Small Language<br />Technical DSLs<br />Conceptsharderto find<br />More expressive<br />Lisp Style<br />Who are 1st Class ...
Do not <br />mix<br />Reuse andVariations<br />thetwostyles!<br />
Teamwork Support<br />
Versioning<br />   Lock<br />      Check in/out<br />Diff/compare<br />Merge<br />Branch<br />                     Tag<br ...
Versioning<br />   Lock<br />      Check in/out<br />Diff/compare<br />Merge<br />Branch<br />                     Tag<br ...
Versioning<br />   Lock<br />      Check in/out<br />Diff/compare<br />Merge<br />Branch<br />                     Tag<br ...
Repository<br />vs.<br />Teamwork Support<br />File-Based<br />
Repository<br />… Element-Specific<br />… Real-Time<br />… Oftengoodfor    Business DSLs<br />Teamwork Support<br />
File-Based<br />… like SCMs<br />… integrates wellwithmanuallywrittencode<br />… Technical DSLs<br />Teamwork Support<br />
File-Based<br />… integratesvery    well with (real)  textual DSLs<br />Teamwork Support<br />
Teamwork Support<br />Tool<br />Specific!<br />
ToolingMatters!<br />
The Language<br />is not<br />ToolingMatters!<br />enough!<br />
Teamwork<br />Navigation<br />Overviews<br />Searching<br />Quick-find<br />Find-references<br />Show usage<br />Refactori...
The Language<br />is not<br />ToolingMatters!<br />enough!<br />Thisis also<br />trueforthe<br />Meta<br />Developers!<br />
Users shouldbeable<br />toworkwithandstore<br />wrong<br />or<br />ToolingMatters!<br />incomplete<br />models!<br />
Users shouldbeable<br />toworkwithandstore<br />wrong<br />or<br />ToolingMatters!<br />incomplete<br />models!<br />Tempo...
ToolingMatters!<br />Nightly<br />Build!<br />
<br />ProcessingModels<br /><br />the<br />
Interpretation <br />Generation<br />vs. <br />
Interpretation<br />Interpretation vs. Generation<br />
Generation<br />Interpretation vs. Generation<br />
Generation<br />resultingcode<br />Interpretation vs. Generation<br />canbeeasily<br />inspected<br />
Generation<br />resultingcode<br />Interpretation vs. Generation<br />canbeeasily<br />debugged<br />
Generation<br />resultingcode<br />canbe<br />Interpretation vs. Generation<br />optimized<br />andmore<br />efficient<br />
Generation<br />Templates canbe<br />Interpretation vs. Generation<br />derived<br />fromexistingcode<br />
Generation<br />workaround<br />Interpretation vs. Generation<br />limitations<br />oftargetlanguage<br />
Generation<br />nochanges<br />Interpretation vs. Generation<br />totargetenvironment<br />(leavesnotrace)<br />
Generation<br />reuse<br />Interpretation vs. Generation<br />runtime infrastructure<br />(garbage collection, monitoring…...
Interpretation<br />faster<br />turnaround<br />Interpretation vs. Generation<br />noregeneration<br />test<br />build<br ...
Interpretation<br />for platform indepenence<br />an interpreter might be<br />Interpretation vs. Generation<br />less por...
Combinations<br />Interpretation vs. Generation<br />
Rich Domain SpecificPlatform<br />
Rich Platform<br />
Rich Platform<br />Grownwiththe DSL!<br />
Extreme Case<br />Rich Platform<br />populates<br />
Checks Firstand Separate<br />
Language Structure<br />is not enough.<br />Checks firstand separate<br />Youneedconstraints.<br />Boolean expressionsthat...
Model<br />G<br />Checks firstand separate<br />… complex<br />Constraints<br />Code<br />
Model<br />Checks firstand separate<br />G<br />G‘<br />… complex<br />… duplication<br />Constraints<br />Constraints<br ...
separate phase<br />Model<br />firstclasscitizens<br />muchbetter.<br />Constraints<br />Checks firstand separate<br />G<b...
different constraints<br />atdifferenttimes<br />orfor<br />Checks firstand separate<br />different partitions<br />ofthe ...
check early.<br />Model<br />moresemantics.<br />Constraints<br />bettermessages.<br />T<br />Model‘<br />Checks firstand ...
Model<br />Constraints 1<br />constraints 1 ok <br />T<br />implies<br />Model‘<br />constraints 2 ok <br />Checks firstan...
ERROR<br />WARNING<br />Checks firstand separate<br />INFO<br />
IntegratingGeneratedandManuallyWritten Code<br />
Ifat all possible,<br />Do not modify<br />Integrated Gen/Man Code<br />Generated Code!<br />
ProtectedRegions<br />are a badideabecause<br />generatedcode<br />Integrated Gen/Man Code<br />is not a<br />throwaway<br...
ProtectedRegions<br />… needto check in<br />… sedimentofgeneratedcode<br />Integrated Gen/Man Code<br />
Better Approach:<br />Hooks<br />Integrated Gen/Man Code<br />in thegeneratedcode<br />
Better Approach:<br />Hooks<br />Integrated Gen/Man Code<br />in thegeneratedcode<br />extension points, base class, abstr...
Integrated Gen/Man Code<br />
ControlManuallyWritten Code<br />
After codegeneration<br />how do youmakesure<br />developersfollow<br />Control Manual Code<br />all therequired<br />proc...
procedures?<br />… subclass<br />… overwrite<br />… naming<br />conventions<br />Control Manual Code<br />
Compiler Errors<br />are not enough.<br />Control Manual Code<br />wrong<br />abstraction<br />level!<br />
generatechecks<br />againstthecodebase<br />Control Manual Code<br />evaluatedbytheIDE<br />
if (false) { GeneratedBaseClass x =       new ManualSubclass(); }<br />Control Manual Code<br />
Care aboutgeneratedcode<br />Andrew Vargas<br />
Generated Code a<br />Throwaway<br />Product?<br />Care aboutGenerated Code<br />
Generated Code a<br />Throwaway<br />Product?<br />Care aboutGenerated Code<br />Yes.<br />Can beregenerated.<br />
But:<br />must be…<br />… written (templates)<br />… understood<br />… debugged<br />Care aboutGenerated Code<br />
But:<br />must be…<br />… written (templates)<br />… understood<br />… debugged<br />… extended<br />… programmedagainst<b...
Care!<br />… indent<br />… usegoodnames<br />… document<br />… modularize<br />Care aboutGenerated Code<br />
Make CodeTrue to Model<br />
Analyses on the model<br />canverify all kindsof<br />properties<br />aboutthe<br />Code truetothe Model<br />system.<br />
Analyses on the model<br />canverify all kindsof<br />properties<br />aboutthe<br />Code truetothe Model<br />system.<br /...
Use a clever<br />programming model<br />Code truetothe Model<br />thatdoes not allow<br />violations.<br />
generatethe<br />configuration<br />for<br />architectureanalysis<br />tools.<br />SoftwareTomographySonarJ<br />Structure...
Viewpoint-AwareProcessing<br />
whenandhow do you<br />and<br />validate<br />process<br />Viewpoint-Aware Processing<br />eachviewpoint?<br />
whenandhow do you<br />and<br />validate<br />process<br />Viewpoint-Aware Processing<br />eachviewpoint?<br />Roles?<br /...
Generate in phases:<br />type<br />developer<br />implementmanualcode<br />Viewpoint-Aware Processing<br />deployment<br /...
Also consider<br />partitions<br />Viewpoint-Aware Processing<br />in thiscontext!<br />
Overall ConfigurationViewpoint<br />
Teamwork<br />Partitions<br />Viewpoints<br />Multiple Targets<br />Overall ConfigurationViewpt.<br />Multiple Configurati...
Teamwork<br />Partitions<br />Viewpoints<br />Multiple Targets<br />Overall ConfigurationViewpt.<br />Multiple Configurati...
Overall ConfigurationViewpt.<br />
Overall ConfigurationViewpt.<br />
Putthisoverall<br />configurationinto<br />Overall ConfigurationViewpt.<br />a model: <br />configuration<br />viewpoint<b...
Care About Templates<br />
Templates<br />… importantasset<br />Care about Templates<br />… containplatform<br />knowledge<br />… tendtogrow<br />mor...
Care!<br />… modularize<br />Care about Templates<br />… functions<br />… naming<br />… polymorphism<br />… aspects<br />…...
Indentforthetemplates<br />andthenuse a<br />beautifier<br />forthe<br />Care about Templates<br />generatedcode.<br />
Indentforthetemplates<br />andthenuse a<br />beautifier<br />forthe<br />Care about Templates<br />generatedcode.<br />exc...
Care about Templates<br />GoodPlatform.<br />Fewer Templates.<br />Less Care.<br />
Model-2-Model<br />ToSimplify Generators<br />
Reducingtemplate<br />complexity<br />isimportant.<br />M2M toSimplify Generators<br />
Reducingtempalte<br />complexity<br />isimportant.<br />M2M toSimplify Generators<br />Separation ofConcerns<br />istheway...
Insteadofputting<br />complexlogic<br />intothetemplates<br />M2M toSimplify Generators<br />putitinto an M2M<br />thatrun...
M2M toSimplify Generators<br />
M2M toSimplify Generators<br />
In-language<br />reduction rules:<br />M2M toSimplify Generators<br />
Model-2-Model<br />For Simulation andProof<br />
Many<br />usefulformalisms<br />alreadyexist.<br />M2M for Simulation andProof<br />
Many<br />usefulformalisms<br />alreadyexist.<br />M2M for Simulation andProof<br />Simulation<br />Proofs<br />Properties...
Use an M2M<br />forthisifpossible.<br />M2M for Simulation andProof<br />OftentheinputisXML<br />so youactually<br />„gene...
Cascading<br />
?<br />PIM?<br />Cascading<br />PSM?<br />PSSM?<br />
BottomUp<br />Cascading<br />Works Better!<br />
Cascading<br />M2T<br />Code + othertargetplatformartifacts<br />
Cascading<br />M2M<br />M2M<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
M2M<br />Cascading<br />M2M<br />M2M<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
MODELS READ ONLY!<br />M2M<br />Cascading<br />M2M<br />M2M<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
Allowfor<br />Adaptations<br />
EconomiesofScale<br />Reuse!<br />AllowforAdaptations<br />
EconomiesofScale<br />Reuse!<br />AllowforAdaptations<br />But: <br />Adaptations!<br />
EconomiesofScale<br />Reuse!<br />AllowforAdaptations<br />But: <br />Adaptations!<br />Unexpected<br />
Annotations on Models<br />n/v pairs<br />AllowforAdaptations<br />tobeused in generators<br />Adaptations on Templates<br...
AllowforAdaptations<br />Becarefulto<br />delineate<br />the API!<br />
Annotation Models<br />
M2M<br />Annotation Models<br />M2M<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
M2M<br />Annotation Models<br />M2M<br />M2M‘<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
Annotation Model<br />references<br />elements in base model.<br />Annotation Models<br />Transformation<br />takes additi...
Makesurethe<br />annotation model<br />onlycaptures<br />Annotation Models<br />Exceptions<br />fromthedefault<br />in the...
ClassifyBehaviour<br />
?<br />Action<br />Semantics<br />ClassifyBehaviour<br />Languages<br />useful?<br />
?<br />Action<br />Semantics<br />ClassifyBehaviour<br />Languages<br />useful! But…<br />
Classify!<br />… statebased<br />… businessrules<br />ClassifyBehaviour<br />… mathematics<br />
Classify!<br />… statebased<br />… businessrules<br />ClassifyBehaviour<br />… mathematics<br />… or a specific DSL<br />
Classify!<br />… statebased<br />… businessrules<br />ClassifyBehaviour<br />… mathematics<br />… or a specific DSL<br />…...
Don‘tforget<br />Testing<br />
Don‘t Forget Testing<br />Limited Expressiveness.<br />Reduced Need For Tests.<br />
Don‘t Forget Testing<br />Constraint Checks.<br />A Form of Test.<br />
Better Testing<br />Generator<br />Example<br />Models<br />Code<br />Don‘t Forget Testing<br />Based On<br />Binary<br />...
Better Testing<br />Generator<br />Example<br />Models<br />Code<br />Don‘t Forget Testing<br />Based On<br />Models and  ...
Testing Generators<br />Generator<br />Reference<br />Model<br />Code<br />Don‘t Forget Testing<br />
Testing Generators<br />Generator<br />Reference<br />Model<br />Code<br />Don‘t Forget Testing<br />Based On<br />Binary<...
TestingTransformations<br />M2M<br />ResultModel<br />Reference<br />Model<br />Don‘t Forget Testing<br />
TestingTransformations<br />M2M<br />ResultModel<br />Reference<br />Model<br />Don‘t Forget Testing<br />Based On<br />Re...
TestingMetware<br />Reference<br />Model<br />… maintaned!<br />Don‘t Forget Testing<br />… bymetaware<br />Reference<br /...
This tests<br />only the generators<br />Generator<br />Model<br />Code<br />Don‘t Forget Testing<br />Tests<br />Generato...
This tests not<br />the model:<br />self fulfilling!<br />Generator<br />Model<br />Code<br />Don‘t Forget Testing<br />Te...
Separate test models<br />and generated test code<br />Model<br />Generator<br />Code<br />Don‘t Forget Testing<br />based...
Separate test models<br />and generate Mocks<br />Model<br />Generator<br />Code<br />Mocks<br />Don‘t Forget Testing<br /...
Auto-Derived Test Models<br />work sometimes.<br />Model<br />Generator<br />Code<br />Don‘t Forget Testing<br />automatic...
<br />ProcessOrganization<br /><br />the<br />
Iterate!<br />
Waterfallisbad!<br />WithorWithout MD*<br />Iterate!<br />
Iterate!<br />Concepts<br />
Iterate!<br />Concepts<br />Language<br />
Iterate!<br />Examples<br />Concepts<br />Language<br />
Generator+Tests<br />Iterate!<br />Examples<br />Concepts<br />Language<br />
Generator+Tests<br />Editor Beautification<br />Iterate!<br />Examples<br />Concepts<br />Language<br />
Co-Evolve Language andConcepts<br />
Co-Evolve Language & Domain<br />
Co-Evolve Language & Domain<br />
Building a language<br />requires<br />Formalization<br />Co-Evolve Language & Domain<br />
Building a language<br />requires<br />Formalization<br />Co-Evolve Language & Domain<br />requiresyouto<br />thinkanddeci...
Co-Evolve Language & Domain<br />requiresfrequent<br />Evolution!<br />
Co-Evolve Language & Domain<br />and flexible, agile<br />Tooling!<br />
Documentationis still necessary<br />
The DSL and the „programs“ are documentation.<br />Documentation still necessary<br />
The DSL and the „programs“ are documentation.<br />		Not Quite!<br />Documentation still necessary<br />
Language Definition<br />		is not a <br />		Teaching Tool!<br />Documentation still necessary<br />
Tutorials<br />… Concepts<br />… Howtouse Language<br />Documentation still necessary<br />… Howtointegrate<br />manualcod...
Language Definition<br />		captures <br />			the WHAT<br />	but not<br />the WHY<br />Documentation still necessary<br />
Rationales<br />… whytheconcepts?<br />… whywegenerate<br />Documentation still necessary<br />whatwegenerate<br />… targe...
Different Media<br />Documentation still necessary<br />
Reviews<br />
Reviews<br />In mostcases,<br />peoplecan still<br />makemistakes.<br />
DSL programs<br />aremoreconcise, so<br />Reviews<br />reviewsare<br />moreefficient.<br />
Repeated „Mistakes“?<br />Add constraint check.<br />Reviews<br />
Repeated „Mistakes“?<br />Add constraint check.<br />Reviews<br />Ormaybethelanguage<br />iswronganditis<br />not a mistak...
Letpeople do what<br />they‘regoodat<br />
MD* hasseveral<br />clearlydefined<br />Let‘em do whatthey‘regoodat<br />Roles<br />
Tech Experts<br />… evaluatetechnologies<br />… digdeep<br />Let‘em do whatthey‘regoodat<br />… tune<br />… createtemplate...
Language Designer<br />… works w/ domain expert<br />abstractions, notations<br />Let‘em do whatthey‘regoodat<br />… adds ...
App Developer<br />… caresaboutappdomain<br />… uses DSLs + metaware<br />Let‘em do whatthey‘regoodat<br />… isisolatedfro...
Flip side:<br />Let‘em do whatthey‘regoodat<br />Youactuallyneedpeople<br />whoaregoodatthis! <br />
Domain Users<br />Programming?<br />
Precision<br />!=<br />Programming<br />Domain Users Programming?<br />
Precision<br />!=<br />Programming<br />Domain Users Programming?<br />DomainUsers<br />Programmers<br />Programming = Pre...
Precision<br />… Scientists<br />… Insurance Mathematicians<br />Domain Users Programming?<br />… Logisticians<br />… Medi...
Domain Users Programming?<br />
If Domain Users<br />don‘tgetit<br />Domain Users Programming?<br />itmighthintat a <br />problemwith<br />thelanguage!<br...
Things learned<br />from 3GLs<br />Domain Users Programming?<br />often not<br />intuitively<br />understandable<br />for ...
Domain Users<br />vs. Experts<br />
Creatingthe Language<br />vs.<br />Domain Users vs. Experts<br />Usingthe Language<br />
Creating: Domain Expert<br />Domain Users vs. Experts<br />Using: Domain User<br />
Creating: Domain Expert<br />… senior<br />… complete<br />Domain Users vs. Experts<br />… bigpicture<br />… deep<br />… p...
Using: Domain User<br />… not senior<br />… narrower<br />Domain Users vs. Experts<br />… shallow<br />
Can Domain Users<br />understand <br />whattheExperts<br />putinto<br />Domain Users vs. Experts<br />thelanguage?<br />Ve...
MetawareasProduct<br />
Product:<br />… releaseschedule<br />… incrementaldevelopmt<br />MetawareasProduct<br />… requirementsmgt.<br />… issuetra...
Exhange People<br />… makemetadevelopers<br />develop real apps<br />MetawareasProduct<br />… letappdevelopers<br />develo...
Compatible<br />Organization<br />
MD* requires<br />cross-project<br />CompatibleOrganization<br />work.<br />
MD* requires<br />cross-project<br />CompatibleOrganization<br />work.<br />A strictproject-focused<br />organizationdoes<...
Make<br />room & budget<br />forcross-cutting<br />CompatibleOrganization<br />work.<br />Open Source?<br />
Forget PublishedCase Studies<br />
How do youknow<br />ifitworks<br />foryoursituation?<br />Forget Published Case Studies<br />
How do youknow<br />ifitworks<br />foryoursituation?<br />Forget Published Case Studies<br />Do not judgeby<br />published...
How do youknow<br />ifitworks<br />foryoursituation?<br />Forget Published Case Studies<br />Do not judgeby<br />published...
Instead:<br />	Prototype!<br />… meaningful<br />Forget Published Case Studies<br />… 4-8 personweeks<br />… incremental<b...
<br /><br />Challenges<br />
Mixing Notations<br />Challenges<br />
Mixing Notations<br />Language Modularity<br />Challenges<br />
Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Challenges<br />
Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />
Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />Automa...
Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />Automa...
Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />Automa...
Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />Automa...
Upcoming SlideShare
Loading in …5
×

DSL Best Practices

2,013 views
1,905 views

Published on

In this deck I describe twenty best practices for using external DSLs to develop software (also know as Model-Driven Development). The best practices are based on my personal experience, but they are also rated based on feedback I received from a number of colleagues to express the level of confidence experts have in the particular best practice.
The slides cover three main aspects: language definition, model processing as well as process and organizational issues. Examples include the importance of notations, viewpoints and partitioning, the role of constraints, model transformations and testing as well as some thoughts on documentation, reviews and project roles.
Putting twenty best practices into 5.000 words of course results in each best practice being quite brief. However, it also means each is highly condensed and to the point. I believe the slides remind developers of most of the critical aspects of using DSLs, and it can serve as a checklist when starting an MD* project.

Published in: Technology
2 Comments
13 Likes
Statistics
Notes
  • e e e e
    the ppt far too large
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Very nice overview of the entire chain of building and working with DSLs!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
2,013
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
2
Likes
13
Embeds 0
No embeds

No notes for slide

DSL Best Practices

  1. 1.
  2. 2. MD*<br />MD*<br />Best Practices<br />MarkusVoelter<br />MD*<br />Independent/itemis AG<br />www.voelter.devoelter@acm.org<br />
  3. 3.
  4. 4. About<br />Markus Voelter<br />Independent Consultant<br />
  5. 5. About<br />Markus Voelter<br />Independent Consultant<br />Software Architecture<br />DSLs & MDSD<br />ProductLines<br />
  6. 6. About<br />Markus Voelter<br />Independent Consultant<br />http://www.voelter.de<br />voelter@acm.org<br />skype: schogglad<br />
  7. 7.
  8. 8. Read the<br />Paper!<br />http://www.voelter.de/data/articles/DSLBestPractices-Website.pdf<br />
  9. 9.
  10. 10. <br />DesigningLanguage<br /><br />the<br />
  11. 11.
  12. 12. Sourcesforthe Language<br />
  13. 13. Technical DSLs<br />extractedfrom<br />… framework<br />… library<br />… pattern (language)<br />… architecture<br />Language Sources<br />
  14. 14. Business DSLs<br />extractedfrom<br />Language Sources<br />
  15. 15. Domain Analysis<br />Language Sources<br />
  16. 16. Domain Analysis<br />Language Sources<br />Not just software!<br />
  17. 17. Limit Expressiveness<br />
  18. 18. Limit Expressiveness<br />
  19. 19. Configuration<br />select<br /> …fromconfigspace<br />Limit Expressiveness<br />… Properties<br />… Feature Models<br />
  20. 20. Customization<br />compose<br /> … creatively<br />Limit Expressiveness<br />… Vocabulary<br />… Sentences<br />… Box and Line<br />
  21. 21. Precision<br />preciselywhat<br />Limit Expressiveness<br />… facts<br />… declarative<br />… domainexpertscan!<br />
  22. 22. AlgorithmicCompleteness<br />formallyhow<br />Limit Expressiveness<br />… automation<br />… execution<br />… in model processors<br />… developers can!<br />
  23. 23. Limit Expressiveness<br />Use a 3GLifnecessary<br />Generate APIs, Hooks<br />
  24. 24. Do you want<br />users<br />to build their own <br />Limit Expressiveness<br />abstractions<br />with the language?<br />
  25. 25. DSL is a compromise:<br />… Domain Abstractions<br />… Reuse, Modularization, …<br />Limit Expressiveness<br />… All Data for Generation<br />… DSL Tool influences<br />Viewpoints?<br />
  26. 26. Notation, Notation, Notation<br />
  27. 27. Domain Users<br />caredeeply<br />Notation, …<br />aboutnotation!<br />„UI“ forthelanguage<br />
  28. 28. Textual<br />Graphical<br />Form-Based<br />Spreadsheet<br />Notation, …<br />
  29. 29. Parts<br />Notation, …<br />
  30. 30. Convertible<br />Notation, …<br />
  31. 31. Embedded<br />Notation, …<br />
  32. 32. Notation, …<br />Tool<br />Specific!<br />
  33. 33. Graphical vs. Textual<br />
  34. 34. Graphical<br />Sequence/Flow<br />Grapical vs. Textual<br />
  35. 35. Graphical<br />Grapical vs. Textual<br />Relationships<br />
  36. 36. Graphical<br />Grapical vs. Textual<br />Timing<br />
  37. 37. Textual<br />In all othercases!<br />Grapical vs. Textual<br />
  38. 38. Textual<br />Real simple…<br />…CVS/SVN Integration<br />… Diff/Merge<br />… Buildautomation<br />… Model Migration<br />Grapical vs. Textual<br />
  39. 39. Text + Visualization<br />Grapical vs. Textual<br />
  40. 40. Text + Visualization<br />… problem-specific<br />… anwers specific questions<br />… highlight specific aspects<br />… several different<br />Grapical vs. Textual<br />visualizations<br />
  41. 41. DSL Semantics<br />
  42. 42. ?<br />Whatdoesit all<br />mean?<br />DSL Semantics<br />
  43. 43. DSL Semantics<br />
  44. 44. DSL Semantics<br />
  45. 45. DSL Semantics<br />
  46. 46. DSL Semantics<br />Documentation<br />
  47. 47. Viewpoints<br />
  48. 48. Viewpoints<br />
  49. 49. Viewpoints<br />
  50. 50. Well-defined<br />DependenciesandConnectionPoints<br />Viewpoints<br />
  51. 51. Try toavoid<br />overlapandtheneedforsynchronization.<br />Viewpoints<br />
  52. 52. Viewpoints<br />Tool<br />Specific!<br />
  53. 53. Partitioning<br />
  54. 54. scale<br />MD* tools do not<br />Partitioning<br />arbitrarily!<br />
  55. 55. Partitions<br />Partitioning<br />… separate resources<br />… != logicalstructure<br />… unitsof check in/out … processable separately<br />… unit of IP<br />
  56. 56. X<br />cross<br />Partition<br />references<br />Partitioning<br />… lazy<br />… byproxy<br />… byname w/ linker<br />
  57. 57. Partition<br />Partitioning<br />… not transparent<br />… partoflanguage design<br />… referencableelements<br />… „includepath“<br />
  58. 58. Partitioning<br />Tool<br />Specific!<br />
  59. 59. Evolution<br />
  60. 60. Whatto do withexisting<br />models<br />Evolution<br />ifthe<br />language<br />changes?<br />
  61. 61. MightRequire…<br />Evolution<br />… configmanagement<br />… version tag in models<br />… changetracking<br />… migration M2M<br />
  62. 62. Think about…<br />Evolution<br />… backwardcompatibility<br />… deprecation<br />… instrumentation<br />… viewpoints + partitions<br />
  63. 63. Evolution<br />Tool<br />Specific!<br />
  64. 64. The Fallacyof<br />GenericLanguages<br />
  65. 65. FallacyofGeneric Lang.<br />
  66. 66. Youcan model<br />everything<br />with<br />FallacyofGeneric Lang.<br />
  67. 67. Youcan model<br />everything<br />with<br />FallacyofGeneric Lang.<br />somehow!<br />
  68. 68. Problem<br />Shoehorningdomainabstractionsintothe<br />genericlanguage<br />FallacyofGeneric Lang.<br />
  69. 69. Problem<br />Sidetrackedbyexistingabstractionsandnotations<br />FallacyofGeneric Lang.<br />
  70. 70. FallacyofGeneric Lang.<br />Very LimitedTool Support!<br />Notations/ Abstractionsextensiblevia Profiles<br />
  71. 71. Meta Model<br />Complexity!<br />FallacyofGeneric Lang.<br />
  72. 72. Wherearestandardsuseful?<br />FallacyofGeneric Lang.<br />
  73. 73. Peoplehavetolearnunderlying<br />concepts anyway.<br />FallacyofGeneric Lang.<br />
  74. 74. Is UML witha profilestill a standardlanguage?<br />FallacyofGeneric Lang.<br />
  75. 75. On whichmetaleveldo I wanttostandardize?<br />M2 (UML), M3 (MOF)?<br />FallacyofGeneric Lang.<br />
  76. 76. Isn‘t a DSLbased on MOFas „standard“ as a profilebased on UML?<br />FallacyofGeneric Lang.<br />
  77. 77. Introduce an <br />intermediate<br />language<br />FallacyofGeneric Lang.<br />
  78. 78. separate<br />DSL<br />viewpoints<br />UML + DSL<br />DS Model<br />FallacyofGeneric Lang.<br />
  79. 79. FallacyofGeneric Lang.<br />BPM <br />is to analysts<br />what<br />UML<br />is to developers.<br />
  80. 80. Butdon‘treinventthewheeleither.<br />FallacyofGeneric Lang.<br />
  81. 81. Build your own languageinspiredbyexisting language<br />FallacyofGeneric Lang.<br />
  82. 82. Learnfrom 3GLs<br />
  83. 83. DSL != 3GL<br />Learnfrom 3GLs<br />But:<br />
  84. 84. Namespaces<br />VisibilityEncapsulation<br />Scoping<br />Specialization<br />Cohesion<br />Coupling<br />abstract<br />…<br />Wecan learn:<br />Learnfrom 3GLs<br />
  85. 85. Read thisBook:<br />Learnfrom 3GLs<br />Concepts, TechniquesandModels of Computer Programming<br />by Peter Van Roy and SeifHaridi<br />
  86. 86. Type Systems<br />
  87. 87. Knownfrom3GLs<br />Type Systems<br />Classes & Objects<br />
  88. 88. Examples:<br />Components<br />& Instances<br />Type Systems<br />Data Types<br />& Instances<br />Config Table Defs<br />& ConfigTables<br />
  89. 89. Viewpoint B<br />(Types)<br />Type Systems<br />instanceof<br />Viewpoint A<br />(Instances)<br />
  90. 90. Viewpoint B<br />(Types)<br />Type Systems<br />instanceof<br />Viewpoint A<br />(Instances)<br />
  91. 91. MetaMeta Model (M3)<br />instanceof<br />Viewpoint B<br />(Types)<br />MetaModel (M2)<br />Type Systems<br />instanceof<br />Viewpoint A<br />(Instances)<br />instanceof<br />Model (M1)<br />
  92. 92. Support for ReuseandVariations<br />
  93. 93. There‘smoreto<br />reuse<br />Reuse andVariations<br />than<br />partitions<br />
  94. 94. The language<br />must provide<br />explicit<br />Reuse andVariations<br />support!<br />(wecanlearnthatfrom OO)<br />
  95. 95. Specialization<br />overriding, overwriting<br />Leaving Holes<br />Reuse andVariations<br />for variant tofill in<br />InjectStuff<br />severalplacesat a time?<br />
  96. 96. Specialization<br />Inheritance<br />Leaving Holes<br />Reuse andVariations<br />Template Method Pattern<br />InjectStuff<br />Aspect Orientation<br />
  97. 97. Reuse andVariations<br />Makesureyou<br />delineate<br />the API!<br />
  98. 98. Reuse andVariations<br />Domain Users<br />might not<br />understand this!<br />
  99. 99. Who are 1st Class Citizens?<br />
  100. 100. Big Language<br />Who are 1st Class Citizens<br />withmanyconcepts!<br />
  101. 101. Small Language<br />Who are 1st Class Citizens<br />withfew, but powefulconcepts!<br />
  102. 102. Big Language<br />Easierfor Business Users<br />Concepts easy to find<br />COBOL style<br />Who are 1st Class Citizens<br />
  103. 103. Small Language<br />Technical DSLs<br />Conceptsharderto find<br />More expressive<br />Lisp Style<br />Who are 1st Class Citizens<br />
  104. 104. Do not <br />mix<br />Reuse andVariations<br />thetwostyles!<br />
  105. 105. Teamwork Support<br />
  106. 106. Versioning<br /> Lock<br /> Check in/out<br />Diff/compare<br />Merge<br />Branch<br /> Tag<br />Teamwork Support<br />
  107. 107. Versioning<br /> Lock<br /> Check in/out<br />Diff/compare<br />Merge<br />Branch<br /> Tag<br />Teamwork Support<br />On the<br />Level ofthe<br />Concrete Syntax!<br />
  108. 108. Versioning<br /> Lock<br /> Check in/out<br />Diff/compare<br />Merge<br />Branch<br /> Tag<br />Teamwork Support<br />Together<br />withmanually<br />written Source!<br />
  109. 109. Repository<br />vs.<br />Teamwork Support<br />File-Based<br />
  110. 110. Repository<br />… Element-Specific<br />… Real-Time<br />… Oftengoodfor Business DSLs<br />Teamwork Support<br />
  111. 111. File-Based<br />… like SCMs<br />… integrates wellwithmanuallywrittencode<br />… Technical DSLs<br />Teamwork Support<br />
  112. 112. File-Based<br />… integratesvery well with (real) textual DSLs<br />Teamwork Support<br />
  113. 113. Teamwork Support<br />Tool<br />Specific!<br />
  114. 114. ToolingMatters!<br />
  115. 115. The Language<br />is not<br />ToolingMatters!<br />enough!<br />
  116. 116. Teamwork<br />Navigation<br />Overviews<br />Searching<br />Quick-find<br />Find-references<br />Show usage<br />Refactoring<br />Debugging<br />Code Completion<br />Syntax Highlighting<br />The Language<br />is not<br />ToolingMatters!<br />enough!<br />
  117. 117. The Language<br />is not<br />ToolingMatters!<br />enough!<br />Thisis also<br />trueforthe<br />Meta<br />Developers!<br />
  118. 118. Users shouldbeable<br />toworkwithandstore<br />wrong<br />or<br />ToolingMatters!<br />incomplete<br />models!<br />
  119. 119. Users shouldbeable<br />toworkwithandstore<br />wrong<br />or<br />ToolingMatters!<br />incomplete<br />models!<br />Temporarily.<br />Noprocessing!<br />
  120. 120. ToolingMatters!<br />Nightly<br />Build!<br />
  121. 121.
  122. 122. <br />ProcessingModels<br /><br />the<br />
  123. 123.
  124. 124. Interpretation <br />Generation<br />vs. <br />
  125. 125. Interpretation<br />Interpretation vs. Generation<br />
  126. 126. Generation<br />Interpretation vs. Generation<br />
  127. 127. Generation<br />resultingcode<br />Interpretation vs. Generation<br />canbeeasily<br />inspected<br />
  128. 128. Generation<br />resultingcode<br />Interpretation vs. Generation<br />canbeeasily<br />debugged<br />
  129. 129. Generation<br />resultingcode<br />canbe<br />Interpretation vs. Generation<br />optimized<br />andmore<br />efficient<br />
  130. 130. Generation<br />Templates canbe<br />Interpretation vs. Generation<br />derived<br />fromexistingcode<br />
  131. 131. Generation<br />workaround<br />Interpretation vs. Generation<br />limitations<br />oftargetlanguage<br />
  132. 132. Generation<br />nochanges<br />Interpretation vs. Generation<br />totargetenvironment<br />(leavesnotrace)<br />
  133. 133. Generation<br />reuse<br />Interpretation vs. Generation<br />runtime infrastructure<br />(garbage collection, monitoring…)<br />
  134. 134. Interpretation<br />faster<br />turnaround<br />Interpretation vs. Generation<br />noregeneration<br />test<br />build<br />deploy<br />
  135. 135. Interpretation<br />for platform indepenence<br />an interpreter might be<br />Interpretation vs. Generation<br />less porting<br />effort<br />
  136. 136. Combinations<br />Interpretation vs. Generation<br />
  137. 137. Rich Domain SpecificPlatform<br />
  138. 138. Rich Platform<br />
  139. 139. Rich Platform<br />Grownwiththe DSL!<br />
  140. 140. Extreme Case<br />Rich Platform<br />populates<br />
  141. 141. Checks Firstand Separate<br />
  142. 142. Language Structure<br />is not enough.<br />Checks firstand separate<br />Youneedconstraints.<br />Boolean expressionsthatvalidate<br />the model beyondstructure.<br />
  143. 143. Model<br />G<br />Checks firstand separate<br />… complex<br />Constraints<br />Code<br />
  144. 144. Model<br />Checks firstand separate<br />G<br />G‘<br />… complex<br />… duplication<br />Constraints<br />Constraints<br />Code<br />Code‘<br />
  145. 145. separate phase<br />Model<br />firstclasscitizens<br />muchbetter.<br />Constraints<br />Checks firstand separate<br />G<br />G‘<br />check asmany<br />aspossible.<br />makeittight.<br />Code<br />Code‘<br />
  146. 146. different constraints<br />atdifferenttimes<br />orfor<br />Checks firstand separate<br />different partitions<br />ofthe model<br />partition-local: editor, on-save<br />global: batch, on-request<br />
  147. 147. check early.<br />Model<br />moresemantics.<br />Constraints<br />bettermessages.<br />T<br />Model‘<br />Checks firstand separate<br />T<br />Model‘<br />G<br />Code<br />
  148. 148. Model<br />Constraints 1<br />constraints 1 ok <br />T<br />implies<br />Model‘<br />constraints 2 ok <br />Checks firstand separate<br />Constraints 2<br />implies<br />T<br />constraints 3 ok <br />Model‘<br />Constraints 3<br />G<br />Code<br />
  149. 149. ERROR<br />WARNING<br />Checks firstand separate<br />INFO<br />
  150. 150. IntegratingGeneratedandManuallyWritten Code<br />
  151. 151. Ifat all possible,<br />Do not modify<br />Integrated Gen/Man Code<br />Generated Code!<br />
  152. 152. ProtectedRegions<br />are a badideabecause<br />generatedcode<br />Integrated Gen/Man Code<br />is not a<br />throwaway<br />anymore.<br />
  153. 153. ProtectedRegions<br />… needto check in<br />… sedimentofgeneratedcode<br />Integrated Gen/Man Code<br />
  154. 154. Better Approach:<br />Hooks<br />Integrated Gen/Man Code<br />in thegeneratedcode<br />
  155. 155. Better Approach:<br />Hooks<br />Integrated Gen/Man Code<br />in thegeneratedcode<br />extension points, base class, abstract methods & subclassing, empty callback methods, delegate, implement interfaces, #include, reflection, AOP, design patterns, partial classes<br />
  156. 156. Integrated Gen/Man Code<br />
  157. 157. ControlManuallyWritten Code<br />
  158. 158. After codegeneration<br />how do youmakesure<br />developersfollow<br />Control Manual Code<br />all therequired<br />procedures?<br />
  159. 159. procedures?<br />… subclass<br />… overwrite<br />… naming<br />conventions<br />Control Manual Code<br />
  160. 160. Compiler Errors<br />are not enough.<br />Control Manual Code<br />wrong<br />abstraction<br />level!<br />
  161. 161. generatechecks<br />againstthecodebase<br />Control Manual Code<br />evaluatedbytheIDE<br />
  162. 162. if (false) { GeneratedBaseClass x = new ManualSubclass(); }<br />Control Manual Code<br />
  163. 163. Care aboutgeneratedcode<br />Andrew Vargas<br />
  164. 164. Generated Code a<br />Throwaway<br />Product?<br />Care aboutGenerated Code<br />
  165. 165. Generated Code a<br />Throwaway<br />Product?<br />Care aboutGenerated Code<br />Yes.<br />Can beregenerated.<br />
  166. 166. But:<br />must be…<br />… written (templates)<br />… understood<br />… debugged<br />Care aboutGenerated Code<br />
  167. 167. But:<br />must be…<br />… written (templates)<br />… understood<br />… debugged<br />… extended<br />… programmedagainst<br />Care aboutGenerated Code<br />ifyoudon‘tgenerate100%:<br />
  168. 168. Care!<br />… indent<br />… usegoodnames<br />… document<br />… modularize<br />Care aboutGenerated Code<br />
  169. 169. Make CodeTrue to Model<br />
  170. 170. Analyses on the model<br />canverify all kindsof<br />properties<br />aboutthe<br />Code truetothe Model<br />system.<br />
  171. 171. Analyses on the model<br />canverify all kindsof<br />properties<br />aboutthe<br />Code truetothe Model<br />system.<br />Iffthecodeis<br />true<br />tothe model<br />
  172. 172. Use a clever<br />programming model<br />Code truetothe Model<br />thatdoes not allow<br />violations.<br />
  173. 173. generatethe<br />configuration<br />for<br />architectureanalysis<br />tools.<br />SoftwareTomographySonarJ<br />Structure 101<br />… andthelike<br />Code truetothe Model<br />
  174. 174. Viewpoint-AwareProcessing<br />
  175. 175. whenandhow do you<br />and<br />validate<br />process<br />Viewpoint-Aware Processing<br />eachviewpoint?<br />
  176. 176. whenandhow do you<br />and<br />validate<br />process<br />Viewpoint-Aware Processing<br />eachviewpoint?<br />Roles?<br />Process?<br />
  177. 177. Generate in phases:<br />type<br />developer<br />implementmanualcode<br />Viewpoint-Aware Processing<br />deployment<br />integrator<br />run on targetsystem<br />behaviour<br />runtime<br />interpretstatemachine<br />
  178. 178. Also consider<br />partitions<br />Viewpoint-Aware Processing<br />in thiscontext!<br />
  179. 179. Overall ConfigurationViewpoint<br />
  180. 180. Teamwork<br />Partitions<br />Viewpoints<br />Multiple Targets<br />Overall ConfigurationViewpt.<br />Multiple Configurations<br />
  181. 181. Teamwork<br />Partitions<br />Viewpoints<br />Multiple Targets<br />Overall ConfigurationViewpt.<br />Multiple Configurations<br />large ormany<br />models<br />
  182. 182. Overall ConfigurationViewpt.<br />
  183. 183. Overall ConfigurationViewpt.<br />
  184. 184. Putthisoverall<br />configurationinto<br />Overall ConfigurationViewpt.<br />a model: <br />configuration<br />viewpoint<br />
  185. 185. Care About Templates<br />
  186. 186. Templates<br />… importantasset<br />Care about Templates<br />… containplatform<br />knowledge<br />… tendtogrow<br />morecomplex<br />
  187. 187. Care!<br />… modularize<br />Care about Templates<br />… functions<br />… naming<br />… polymorphism<br />… aspects<br />… refactor<br />
  188. 188. Indentforthetemplates<br />andthenuse a<br />beautifier<br />forthe<br />Care about Templates<br />generatedcode.<br />
  189. 189. Indentforthetemplates<br />andthenuse a<br />beautifier<br />forthe<br />Care about Templates<br />generatedcode.<br />exceptifyouuse a langauage<br />withsemanticwhitespace!<br />
  190. 190. Care about Templates<br />GoodPlatform.<br />Fewer Templates.<br />Less Care.<br />
  191. 191. Model-2-Model<br />ToSimplify Generators<br />
  192. 192. Reducingtemplate<br />complexity<br />isimportant.<br />M2M toSimplify Generators<br />
  193. 193. Reducingtempalte<br />complexity<br />isimportant.<br />M2M toSimplify Generators<br />Separation ofConcerns<br />isthewaytogo.<br />
  194. 194. Insteadofputting<br />complexlogic<br />intothetemplates<br />M2M toSimplify Generators<br />putitinto an M2M<br />thatruns<br />beforecode gen.<br />
  195. 195. M2M toSimplify Generators<br />
  196. 196. M2M toSimplify Generators<br />
  197. 197. In-language<br />reduction rules:<br />M2M toSimplify Generators<br />
  198. 198. Model-2-Model<br />For Simulation andProof<br />
  199. 199. Many<br />usefulformalisms<br />alreadyexist.<br />M2M for Simulation andProof<br />
  200. 200. Many<br />usefulformalisms<br />alreadyexist.<br />M2M for Simulation andProof<br />Simulation<br />Proofs<br />Properties<br />
  201. 201. Use an M2M<br />forthisifpossible.<br />M2M for Simulation andProof<br />OftentheinputisXML<br />so youactually<br />„generatecode“<br />
  202. 202. Cascading<br />
  203. 203. ?<br />PIM?<br />Cascading<br />PSM?<br />PSSM?<br />
  204. 204. BottomUp<br />Cascading<br />Works Better!<br />
  205. 205. Cascading<br />M2T<br />Code + othertargetplatformartifacts<br />
  206. 206. Cascading<br />M2M<br />M2M<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
  207. 207. M2M<br />Cascading<br />M2M<br />M2M<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
  208. 208. MODELS READ ONLY!<br />M2M<br />Cascading<br />M2M<br />M2M<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
  209. 209. Allowfor<br />Adaptations<br />
  210. 210. EconomiesofScale<br />Reuse!<br />AllowforAdaptations<br />
  211. 211. EconomiesofScale<br />Reuse!<br />AllowforAdaptations<br />But: <br />Adaptations!<br />
  212. 212. EconomiesofScale<br />Reuse!<br />AllowforAdaptations<br />But: <br />Adaptations!<br />Unexpected<br />
  213. 213. Annotations on Models<br />n/v pairs<br />AllowforAdaptations<br />tobeused in generators<br />Adaptations on Templates<br />Template-AO<br />Factories/Polymorphism<br />
  214. 214. AllowforAdaptations<br />Becarefulto<br />delineate<br />the API!<br />
  215. 215. Annotation Models<br />
  216. 216. M2M<br />Annotation Models<br />M2M<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
  217. 217. M2M<br />Annotation Models<br />M2M<br />M2M‘<br />M2T<br />M2T<br />Code + othertargetplatformartifacts<br />
  218. 218. Annotation Model<br />references<br />elements in base model.<br />Annotation Models<br />Transformation<br />takes additional<br />informationinto<br />account.<br />
  219. 219. Makesurethe<br />annotation model<br />onlycaptures<br />Annotation Models<br />Exceptions<br />fromthedefault<br />in thetemplates.<br />
  220. 220. ClassifyBehaviour<br />
  221. 221. ?<br />Action<br />Semantics<br />ClassifyBehaviour<br />Languages<br />useful?<br />
  222. 222. ?<br />Action<br />Semantics<br />ClassifyBehaviour<br />Languages<br />useful! But…<br />
  223. 223. Classify!<br />… statebased<br />… businessrules<br />ClassifyBehaviour<br />… mathematics<br />
  224. 224. Classify!<br />… statebased<br />… businessrules<br />ClassifyBehaviour<br />… mathematics<br />… or a specific DSL<br />
  225. 225. Classify!<br />… statebased<br />… businessrules<br />ClassifyBehaviour<br />… mathematics<br />… or a specific DSL<br />… 3GL code<br />
  226. 226. Don‘tforget<br />Testing<br />
  227. 227. Don‘t Forget Testing<br />Limited Expressiveness.<br />Reduced Need For Tests.<br />
  228. 228. Don‘t Forget Testing<br />Constraint Checks.<br />A Form of Test.<br />
  229. 229. Better Testing<br />Generator<br />Example<br />Models<br />Code<br />Don‘t Forget Testing<br />Based On<br />Binary<br />Test Cases<br />(hand written)<br />Tests<br />
  230. 230. Better Testing<br />Generator<br />Example<br />Models<br />Code<br />Don‘t Forget Testing<br />Based On<br />Models and Language serve as meaningful „spec“ for what to test<br />Binary<br />Test Cases<br />(hand written)<br />Tests<br />
  231. 231. Testing Generators<br />Generator<br />Reference<br />Model<br />Code<br />Don‘t Forget Testing<br />
  232. 232. Testing Generators<br />Generator<br />Reference<br />Model<br />Code<br />Don‘t Forget Testing<br />Based On<br />Binary<br />Reference<br />Test Cases<br />Tests<br />
  233. 233. TestingTransformations<br />M2M<br />ResultModel<br />Reference<br />Model<br />Don‘t Forget Testing<br />
  234. 234. TestingTransformations<br />M2M<br />ResultModel<br />Reference<br />Model<br />Don‘t Forget Testing<br />Based On<br />Reference<br />Constraints<br />Tests<br />
  235. 235. TestingMetware<br />Reference<br />Model<br />… maintaned!<br />Don‘t Forget Testing<br />… bymetaware<br />Reference<br />Test Cases<br />developers<br />Reference<br />Constraints<br />
  236. 236. This tests<br />only the generators<br />Generator<br />Model<br />Code<br />Don‘t Forget Testing<br />Tests<br />Generator<br />Test Code<br />
  237. 237. This tests not<br />the model:<br />self fulfilling!<br />Generator<br />Model<br />Code<br />Don‘t Forget Testing<br />Tests<br />Generator<br />Test Code<br />
  238. 238. Separate test models<br />and generated test code<br />Model<br />Generator<br />Code<br />Don‘t Forget Testing<br />based on<br />tests<br />Test Model<br />(Test Language)<br />Generator<br />Test Code<br />
  239. 239. Separate test models<br />and generate Mocks<br />Model<br />Generator<br />Code<br />Mocks<br />Don‘t Forget Testing<br />based on<br />tests<br />Generator<br />Test Model<br />(Test Language)<br />Generator<br />Test Code<br />
  240. 240. Auto-Derived Test Models<br />work sometimes.<br />Model<br />Generator<br />Code<br />Don‘t Forget Testing<br />automatically derived <br />tests<br />Test Model<br />(Test Language)<br />Generator<br />Test Code<br />
  241. 241.
  242. 242. <br />ProcessOrganization<br /><br />the<br />
  243. 243.
  244. 244. Iterate!<br />
  245. 245. Waterfallisbad!<br />WithorWithout MD*<br />Iterate!<br />
  246. 246. Iterate!<br />Concepts<br />
  247. 247. Iterate!<br />Concepts<br />Language<br />
  248. 248. Iterate!<br />Examples<br />Concepts<br />Language<br />
  249. 249. Generator+Tests<br />Iterate!<br />Examples<br />Concepts<br />Language<br />
  250. 250. Generator+Tests<br />Editor Beautification<br />Iterate!<br />Examples<br />Concepts<br />Language<br />
  251. 251. Co-Evolve Language andConcepts<br />
  252. 252. Co-Evolve Language & Domain<br />
  253. 253. Co-Evolve Language & Domain<br />
  254. 254. Building a language<br />requires<br />Formalization<br />Co-Evolve Language & Domain<br />
  255. 255. Building a language<br />requires<br />Formalization<br />Co-Evolve Language & Domain<br />requiresyouto<br />thinkanddecide<br />aboutthedomain.<br />
  256. 256. Co-Evolve Language & Domain<br />requiresfrequent<br />Evolution!<br />
  257. 257. Co-Evolve Language & Domain<br />and flexible, agile<br />Tooling!<br />
  258. 258. Documentationis still necessary<br />
  259. 259. The DSL and the „programs“ are documentation.<br />Documentation still necessary<br />
  260. 260. The DSL and the „programs“ are documentation.<br /> Not Quite!<br />Documentation still necessary<br />
  261. 261. Language Definition<br /> is not a <br /> Teaching Tool!<br />Documentation still necessary<br />
  262. 262. Tutorials<br />… Concepts<br />… Howtouse Language<br />Documentation still necessary<br />… Howtointegrate<br />manualcode<br />Example-Driven!<br />
  263. 263. Language Definition<br /> captures <br /> the WHAT<br /> but not<br />the WHY<br />Documentation still necessary<br />
  264. 264. Rationales<br />… whytheconcepts?<br />… whywegenerate<br />Documentation still necessary<br />whatwegenerate<br />… targetplatform de-<br />cisionsandidioms<br />Grammar as Reference!<br />
  265. 265. Different Media<br />Documentation still necessary<br />
  266. 266. Reviews<br />
  267. 267. Reviews<br />In mostcases,<br />peoplecan still<br />makemistakes.<br />
  268. 268. DSL programs<br />aremoreconcise, so<br />Reviews<br />reviewsare<br />moreefficient.<br />
  269. 269. Repeated „Mistakes“?<br />Add constraint check.<br />Reviews<br />
  270. 270. Repeated „Mistakes“?<br />Add constraint check.<br />Reviews<br />Ormaybethelanguage<br />iswronganditis<br />not a mistake?<br />
  271. 271. Letpeople do what<br />they‘regoodat<br />
  272. 272. MD* hasseveral<br />clearlydefined<br />Let‘em do whatthey‘regoodat<br />Roles<br />
  273. 273. Tech Experts<br />… evaluatetechnologies<br />… digdeep<br />Let‘em do whatthey‘regoodat<br />… tune<br />… createtemplates<br />… spreadknowledge<br />
  274. 274. Language Designer<br />… works w/ domain expert<br />abstractions, notations<br />Let‘em do whatthey‘regoodat<br />… adds modularization, in-<br /> heritance, „abstract“, etc.<br />… works w/ architect<br />generators, interpreters<br />… requires „metapeople“<br />
  275. 275. App Developer<br />… caresaboutappdomain<br />… uses DSLs + metaware<br />Let‘em do whatthey‘regoodat<br />… isisolatedfrom<br /> technology, does not <br /> have to care (that much)<br />
  276. 276. Flip side:<br />Let‘em do whatthey‘regoodat<br />Youactuallyneedpeople<br />whoaregoodatthis! <br />
  277. 277. Domain Users<br />Programming?<br />
  278. 278. Precision<br />!=<br />Programming<br />Domain Users Programming?<br />
  279. 279. Precision<br />!=<br />Programming<br />Domain Users Programming?<br />DomainUsers<br />Programmers<br />Programming = Precision + X<br />
  280. 280. Precision<br />… Scientists<br />… Insurance Mathematicians<br />Domain Users Programming?<br />… Logisticians<br />… Medical Doctors<br />
  281. 281. Domain Users Programming?<br />
  282. 282. If Domain Users<br />don‘tgetit<br />Domain Users Programming?<br />itmighthintat a <br />problemwith<br />thelanguage!<br />… orthedocumentation!<br />
  283. 283. Things learned<br />from 3GLs<br />Domain Users Programming?<br />often not<br />intuitively<br />understandable<br />for domain people.<br />
  284. 284. Domain Users<br />vs. Experts<br />
  285. 285. Creatingthe Language<br />vs.<br />Domain Users vs. Experts<br />Usingthe Language<br />
  286. 286. Creating: Domain Expert<br />Domain Users vs. Experts<br />Using: Domain User<br />
  287. 287. Creating: Domain Expert<br />… senior<br />… complete<br />Domain Users vs. Experts<br />… bigpicture<br />… deep<br />… precise, formal<br />… guru<br />
  288. 288. Using: Domain User<br />… not senior<br />… narrower<br />Domain Users vs. Experts<br />… shallow<br />
  289. 289. Can Domain Users<br />understand <br />whattheExperts<br />putinto<br />Domain Users vs. Experts<br />thelanguage?<br />Verifyearlyandoften!<br />
  290. 290. MetawareasProduct<br />
  291. 291. Product:<br />… releaseschedule<br />… incrementaldevelopmt<br />MetawareasProduct<br />… requirementsmgt.<br />… issuetracking<br />… documentation<br />… supportstaff<br />
  292. 292. Exhange People<br />… makemetadevelopers<br />develop real apps<br />MetawareasProduct<br />… letappdevelopers<br />developmetaware<br />
  293. 293. Compatible<br />Organization<br />
  294. 294. MD* requires<br />cross-project<br />CompatibleOrganization<br />work.<br />
  295. 295. MD* requires<br />cross-project<br />CompatibleOrganization<br />work.<br />A strictproject-focused<br />organizationdoes<br /> not work<br />
  296. 296. Make<br />room & budget<br />forcross-cutting<br />CompatibleOrganization<br />work.<br />Open Source?<br />
  297. 297. Forget PublishedCase Studies<br />
  298. 298. How do youknow<br />ifitworks<br />foryoursituation?<br />Forget Published Case Studies<br />
  299. 299. How do youknow<br />ifitworks<br />foryoursituation?<br />Forget Published Case Studies<br />Do not judgeby<br />published<br />casestudies!<br />
  300. 300. How do youknow<br />ifitworks<br />foryoursituation?<br />Forget Published Case Studies<br />Do not judgeby<br />published<br />casestudies!<br />(yes, theyareworthreading<br /> but don‘tdecidebased on them)<br />
  301. 301. Instead:<br /> Prototype!<br />… meaningful<br />Forget Published Case Studies<br />… 4-8 personweeks<br />… incremental<br />… externalhelp?<br />
  302. 302.
  303. 303. <br /><br />Challenges<br />
  304. 304. Mixing Notations<br />Challenges<br />
  305. 305. Mixing Notations<br />Language Modularity<br />Challenges<br />
  306. 306. Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Challenges<br />
  307. 307. Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />
  308. 308. Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />Automatic Model Migration<br />
  309. 309. Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />Automatic Model Migration<br />Model Debugging<br />
  310. 310. Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />Automatic Model Migration<br />Model Debugging<br />Interpretation -&gt; Code Gen<br />
  311. 311. Mixing Notations<br />Language Modularity<br />MetawareRefactoring<br />Model/Code Refactoring<br />Challenges<br />Automatic Model Migration<br />Model Debugging<br />Interpretation -&gt; Code Gen<br />Cartridges<br />
  312. 312.
  313. 313. THE END.<br />Thankyou.<br />Questions?<br />

×