Textual Real simple… …CVS/SVN Integration … Diff/Merge … Buildautomation … Model Migration Grapical vs. Textual
Text + Visualization Grapical vs. Textual
Text + Visualization … problem-specific … anwers specific questions … highlight specific aspects … several different Grapical vs. Textual visualizations
Reuse andVariations Makesureyou delineate the API!
Reuse andVariations Domain Users might not understand this!
Who are 1st Class Citizens?
Big Language Who are 1st Class Citizens withmanyconcepts!
Small Language Who are 1st Class Citizens withfew, but powefulconcepts!
Big Language Easierfor Business Users Concepts easy to find COBOL style Who are 1st Class Citizens
Small Language Technical DSLs Conceptsharderto find More expressive Lisp Style Who are 1st Class Citizens
Do not mix Reuse andVariations thetwostyles!
Teamwork Support
Versioning Lock Check in/out Diff/compare Merge Branch Tag Teamwork Support
Versioning Lock Check in/out Diff/compare Merge Branch Tag Teamwork Support On the Level ofthe Concrete Syntax!
Versioning Lock Check in/out Diff/compare Merge Branch Tag Teamwork Support Together withmanually written Source!
Repository vs. Teamwork Support File-Based
Repository … Element-Specific … Real-Time … Oftengoodfor Business DSLs Teamwork Support
File-Based … like SCMs … integrates wellwithmanuallywrittencode … Technical DSLs Teamwork Support
File-Based … integratesvery well with (real) textual DSLs Teamwork Support
Teamwork Support Tool Specific!
ToolingMatters!
The Language is not ToolingMatters! enough!
Teamwork Navigation Overviews Searching Quick-find Find-references Show usage Refactoring Debugging Code Completion Syntax Highlighting The Language is not ToolingMatters! enough!
The Language is not ToolingMatters! enough! Thisis also trueforthe Meta Developers!
Users shouldbeable toworkwithandstore wrong or ToolingMatters! incomplete models!
Users shouldbeable toworkwithandstore wrong or ToolingMatters! incomplete models! Temporarily. Noprocessing!
ToolingMatters! Nightly Build!
ProcessingModels the
Interpretation Generation vs.
Interpretation Interpretation vs. Generation
Generation Interpretation vs. Generation
Generation resultingcode Interpretation vs. Generation canbeeasily inspected
Generation resultingcode Interpretation vs. Generation canbeeasily debugged
Generation resultingcode canbe Interpretation vs. Generation optimized andmore efficient
Generation Templates canbe Interpretation vs. Generation derived fromexistingcode
Generation workaround Interpretation vs. Generation limitations oftargetlanguage
Generation nochanges Interpretation vs. Generation totargetenvironment (leavesnotrace)
Generation reuse Interpretation vs. Generation runtime infrastructure (garbage collection, monitoring…)
Interpretation faster turnaround Interpretation vs. Generation noregeneration test build deploy
Interpretation for platform indepenence an interpreter might be Interpretation vs. Generation less porting effort
Combinations Interpretation vs. Generation
Rich Domain SpecificPlatform
Rich Platform
Rich Platform Grownwiththe DSL!
Extreme Case Rich Platform populates
Checks Firstand Separate
Language Structure is not enough. Checks firstand separate Youneedconstraints. Boolean expressionsthatvalidate the model beyondstructure.
Model G Checks firstand separate … complex Constraints Code
Model Checks firstand separate G G‘ … complex … duplication Constraints Constraints Code Code‘
separate phase Model firstclasscitizens muchbetter. Constraints Checks firstand separate G G‘ check asmany aspossible. makeittight. Code Code‘
different constraints atdifferenttimes orfor Checks firstand separate different partitions ofthe model partition-local: editor, on-save global: batch, on-request
check early. Model moresemantics. Constraints bettermessages. T Model‘ Checks firstand separate T Model‘ G Code
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
ERROR WARNING Checks firstand separate INFO
IntegratingGeneratedandManuallyWritten Code
Ifat all possible, Do not modify Integrated Gen/Man Code Generated Code!
ProtectedRegions are a badideabecause generatedcode Integrated Gen/Man Code is not a throwaway anymore.
ProtectedRegions … needto check in … sedimentofgeneratedcode Integrated Gen/Man Code
Better Approach: Hooks Integrated Gen/Man Code in thegeneratedcode
Analyses on the model canverify all kindsof properties aboutthe Code truetothe Model system.
Analyses on the model canverify all kindsof properties aboutthe Code truetothe Model system. Iffthecodeis true tothe model
Use a clever programming model Code truetothe Model thatdoes not allow violations.
generatethe configuration for architectureanalysis tools. SoftwareTomographySonarJ Structure 101 … andthelike Code truetothe Model
Viewpoint-AwareProcessing
whenandhow do you and validate process Viewpoint-Aware Processing eachviewpoint?
whenandhow do you and validate process Viewpoint-Aware Processing eachviewpoint? Roles? Process?
Generate in phases: type developer implementmanualcode Viewpoint-Aware Processing deployment integrator run on targetsystem behaviour runtime interpretstatemachine
Also consider partitions Viewpoint-Aware Processing in thiscontext!
Classify! … statebased … businessrules ClassifyBehaviour … mathematics … or a specific DSL
Classify! … statebased … businessrules ClassifyBehaviour … mathematics … or a specific DSL … 3GL code
Don‘tforget Testing
Don‘t Forget Testing Limited Expressiveness. Reduced Need For Tests.
Don‘t Forget Testing Constraint Checks. A Form of Test.
Better Testing Generator Example Models Code Don‘t Forget Testing Based On Binary Test Cases (hand written) Tests
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
Testing Generators Generator Reference Model Code Don‘t Forget Testing
Testing Generators Generator Reference Model Code Don‘t Forget Testing Based On Binary Reference Test Cases Tests
TestingTransformations M2M ResultModel Reference Model Don‘t Forget Testing
TestingTransformations M2M ResultModel Reference Model Don‘t Forget Testing Based On Reference Constraints Tests
TestingMetware Reference Model … maintaned! Don‘t Forget Testing … bymetaware Reference Test Cases developers Reference Constraints
This tests only the generators Generator Model Code Don‘t Forget Testing Tests Generator Test Code
This tests not the model: self fulfilling! Generator Model Code Don‘t Forget Testing Tests Generator Test Code
Separate test models and generated test code Model Generator Code Don‘t Forget Testing based on tests Test Model (Test Language) Generator Test Code
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
Auto-Derived Test Models work sometimes. Model Generator Code Don‘t Forget Testing automatically derived tests Test Model (Test Language) Generator Test Code
ProcessOrganization the
Iterate!
Waterfallisbad! WithorWithout MD* Iterate!
Iterate! Concepts
Iterate! Concepts Language
Iterate! Examples Concepts Language
Generator+Tests Iterate! Examples Concepts Language
Generator+Tests Editor Beautification Iterate! Examples Concepts Language
Co-Evolve Language andConcepts
Co-Evolve Language & Domain
Co-Evolve Language & Domain
Building a language requires Formalization Co-Evolve Language & Domain
Building a language requires Formalization Co-Evolve Language & Domain requiresyouto thinkanddecide aboutthedomain.
Co-Evolve Language & Domain requiresfrequent Evolution!
Co-Evolve Language & Domain and flexible, agile Tooling!
Documentationis still necessary
The DSL and the „programs“ are documentation. Documentation still necessary
The DSL and the „programs“ are documentation. Not Quite! Documentation still necessary
Language Definition is not a Teaching Tool! Documentation still necessary
Tutorials … Concepts … Howtouse Language Documentation still necessary … Howtointegrate manualcode Example-Driven!
Language Definition captures the WHAT but not the WHY Documentation still necessary
Rationales … whytheconcepts? … whywegenerate Documentation still necessary whatwegenerate … targetplatform de- cisionsandidioms Grammar as Reference!
Different Media Documentation still necessary
Reviews
Reviews In mostcases, peoplecan still makemistakes.
DSL programs aremoreconcise, so Reviews reviewsare moreefficient.
MD* requires cross-project CompatibleOrganization work. A strictproject-focused organizationdoes not work
Make room & budget forcross-cutting CompatibleOrganization work. Open Source?
Forget PublishedCase Studies
How do youknow ifitworks foryoursituation? Forget Published Case Studies
How do youknow ifitworks foryoursituation? Forget Published Case Studies Do not judgeby published casestudies!
How do youknow ifitworks foryoursituation? Forget Published Case Studies Do not judgeby published casestudies! (yes, theyareworthreading but don‘tdecidebased on them)
Instead: Prototype! … meaningful Forget Published Case Studies … 4-8 personweeks … incremental … externalhelp?
Challenges
Mixing Notations Challenges
Mixing Notations Language Modularity Challenges
Mixing Notations Language Modularity MetawareRefactoring Challenges
Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges
Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges Automatic Model Migration
Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges Automatic Model Migration Model Debugging
Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges Automatic Model Migration Model Debugging Interpretation -> Code Gen
Mixing Notations Language Modularity MetawareRefactoring Model/Code Refactoring Challenges Automatic Model Migration Model Debugging Interpretation -> Code Gen Cartridges
In this deck I describe twenty best practices for u more
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. less
0 comments
Post a comment