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.
23. Do you want users to build their own Limit Expressiveness abstractions with the language?
24. DSL is a compromise: … Domain Abstractions … Reuse, Modularization, … Limit Expressiveness … All Data for Generation … DSL Tool influences Viewpoints?
39. Text + Visualization … problem-specific … anwers specific questions … highlight specific aspects … several different Grapical vs. Textual visualizations
115. Teamwork Navigation Overviews Searching Quick-find Find-references Show usage Refactoring Debugging Code Completion Syntax Highlighting The Language is not ToolingMatters! enough!
116. The Language is not ToolingMatters! enough! Thisis also trueforthe Meta Developers!
141. Language Structure is not enough. Checks firstand separate Youneedconstraints. Boolean expressionsthatvalidate the model beyondstructure.
142. Model G Checks firstand separate … complex Constraints Code
143. Model Checks firstand separate G G‘ … complex … duplication Constraints Constraints Code Code‘
144. separate phase Model firstclasscitizens muchbetter. Constraints Checks firstand separate G G‘ check asmany aspossible. makeittight. Code Code‘
145. different constraints atdifferenttimes orfor Checks firstand separate different partitions ofthe model partition-local: editor, on-save global: batch, on-request
146. check early. Model moresemantics. Constraints bettermessages. T Model‘ Checks firstand separate T Model‘ G Code
147. Model Constraints 1 constraints 1 ok T implies Model‘ constraints 2 ok Checks firstand separate Constraints 2 implies T constraints 3 ok Model‘ Constraints 3 G Code
174. whenandhow do you and validate process Viewpoint-Aware Processing eachviewpoint?
175. whenandhow do you and validate process Viewpoint-Aware Processing eachviewpoint? Roles? Process?
176. Generate in phases: type developer implementmanualcode Viewpoint-Aware Processing deployment integrator run on targetsystem behaviour runtime interpretstatemachine
228. Better Testing Generator Example Models Code Don‘t Forget Testing Based On Binary Test Cases (hand written) Tests
229. Better Testing Generator Example Models Code Don‘t Forget Testing Based On Models and Language serve as meaningful „spec“ for what to test Binary Test Cases (hand written) Tests
234. TestingMetware Reference Model … maintaned! Don‘t Forget Testing … bymetaware Reference Test Cases developers Reference Constraints
235. This tests only the generators Generator Model Code Don‘t Forget Testing Tests Generator Test Code
236. This tests not the model: self fulfilling! Generator Model Code Don‘t Forget Testing Tests Generator Test Code
237. Separate test models and generated test code Model Generator Code Don‘t Forget Testing based on tests Test Model (Test Language) Generator Test Code
238. Separate test models and generate Mocks Model Generator Code Mocks Don‘t Forget Testing based on tests Generator Test Model (Test Language) Generator Test Code
239. Auto-Derived Test Models work sometimes. Model Generator Code Don‘t Forget Testing automatically derived tests Test Model (Test Language) Generator Test Code
273. Language Designer … works w/ domain expert abstractions, notations Let‘em do whatthey‘regoodat … adds modularization, in- heritance, „abstract“, etc. … works w/ architect generators, interpreters … requires „metapeople“
274. App Developer … caresaboutappdomain … uses DSLs + metaware Let‘em do whatthey‘regoodat … isisolatedfrom technology, does not have to care (that much)
275. Flip side: Let‘em do whatthey‘regoodat Youactuallyneedpeople whoaregoodatthis!
297. How do youknow ifitworks foryoursituation? Forget Published Case Studies
298. How do youknow ifitworks foryoursituation? Forget Published Case Studies Do not judgeby published casestudies!
299. How do youknow ifitworks foryoursituation? Forget Published Case Studies Do not judgeby published casestudies! (yes, theyareworthreading but don‘tdecidebased on them)
300. Instead: Prototype! … meaningful Forget Published Case Studies … 4-8 personweeks … incremental … externalhelp?
307. Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges Automatic Model Migration
308. Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges Automatic Model Migration Model Debugging
309. Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges Automatic Model Migration Model Debugging Interpretation -> Code Gen
310. Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges Automatic Model Migration Model Debugging Interpretation -> Code Gen Cartridges