architecturearchitecture as as language -...
TRANSCRIPT
26.06.2009
1
ArchitectureArchitecture As LanguageAs Language
[email protected]@acm.org
MarkusMarkus [email protected]@itemis.de
Andreas GrafAndreas Graf
26.06.2009
2
AboutAboutAboutAbout
26.06.2009
3
11
What What isis a a languagelanguage??g gg g
INFORMALSet Set ofof wellwell‐‐
defineddefined termsterms
26.06.2009
4
StakeholdersStakeholders
INFORMALStakeholdersStakeholdersaagreegree on on meaningmeaningmeaningmeaning
MetamodelMetamodelFORMALMetamodelMetamodel
26.06.2009
5
MetamodelMetamodelFORMALMetamodelMetamodelGrammarGrammar
MetamodelMetamodelFORMALMetamodelMetamodelGrammarGrammarN t tiN t tiNotationNotation
26.06.2009
6
A DSL is a focussed, processablelanguage for describing a specific g g g pconcern when building a system in a specific domain. The abstractions andnotations used are natural/suitable for h k h ld h if hthe stakeholders who specify that particular concern.
26.06.2009
7
22
Architecture DSLsArchitecture DSLs
ArchitectureArchitecture
26.06.2009
8
As As youyouunderstandunderstandunderstandunderstandaandnd developdevelop
youryouryouryourArchitectureArchitecture……
DevelopDevelop a a languagelanguage totoexpressexpress it!it!express express it!it!
26.06.2009
9
Language Language resemblesresemblesarchitecturalarchitectural conceptsconceptsarchitecturalarchitectural conceptsconcepts
WeWe express express thetheapplicationapplication(s) (s) withwith
thethe languagelanguage..
26.06.2009
10
DEMO I
An architectural DSL for embedded systems
26.06.2009
11
33
BenefitsBenefits
ClearClear UnderstandingUnderstandingfromfrom buildingbuilding thethegg
languagelanguage
26.06.2009
12
bbUnambigiousUnambigiousVocabularyVocabulary
ConceptsConcepts independentindependentfromfrom TechnologyTechnologyfromfrom TechnologyTechnology
26.06.2009
13
P iP i M d lM d lProgrammingProgramming Model Model cancanbebe defineddefined basedbased on on
ConceptualConceptual ArcitectureArcitectureConceptualConceptual ArcitectureArcitecture
ArchitectureArchitecture „„executableexecutable““(i e(i e moremore thanthan rulesrules andand docsdocs))(i.e. (i.e. moremore thanthan rulesrules andand docsdocs))
26.06.2009
14
44
Why Why TextualTextual??yy
26.06.2009
15
44
… … oror:: whywhy not not graphicalgraphical??yy g pg p
LanguagesLanguages andand EditorsEditorsareare easiereasier toto buildbuild
26.06.2009
16
LanguagesLanguages andand EditorsEditorsareare easiereasier toto buildbuildEvolveEvolve Language Language andand simple simple editoreditor
d dd d dd didi hhasas youyou understand understand andand discussdiscuss thethearchitecturearchitecture, in real time!, in real time!
I t tI t t ilil ithithIntegratesIntegrates easilyeasily withwithcurrentcurrent infrastructureinfrastructure::CVS/SVNCVS/SVN diffdiff//mergemergeCVS/SVN CVS/SVN diffdiff//mergemerge
26.06.2009
17
M d lM d l l til ti
adaptingadapting existingexistingmodelsmodels asas thethe DSL DSL evolvesevolves
Model Model evolutionevolutionisis trivialtrivial, , youyou cancanalwaysalways useuse grepgrepalwaysalways useuse grepgrep..
MM D lD lManyMany Developers Developers preferprefer textualtextualnotationsnotationsnotationsnotations
26.06.2009
18
WhenWhen a a graphicalgraphicalnotationnotationnotationnotation
isis betterbetter, , youyou cancan
i lii livisualizevisualize. .
26.06.2009
19
55
ToolingToolinggg
SeveralSeveral toolstools availableavailable..ExampleExample:: oAWoAW XtextXtext
26.06.2009
20
SpecifySpecify GrammarGrammar
A tlA tl GG ddAntlrAntlr GrammarGrammar andandParserParser isis generatedgenerated
fromfrom thisthis specificationspecificationfromfrom thisthis specificationspecification
26.06.2009
21
GeneratedGenerated MetamodelMetamodel
SpecifySpecify ConstraintsConstraints
26.06.2009
22
GeneratedGenerated EditorEditor
DEMO II
The language‐aware editor for our DSL
26.06.2009
23
66
Generating Generating CodeCodegg
26.06.2009
24
SinceSince wewe alreadyalreadyhavehave a formal a formal modemodel….l….
GenerateGenerate APIAPIMapsMaps ArchitecturalArchitectural ConceptsConcepts toto
ImplementationImplementation languagelanguage (non(non‐‐trivial!)trivial!)pp g gg g (( ))
Implementation Code
ProgrammingModel API
Glue Code
Runtime Infrastructure(Platform/Middleware)
Glue Code
26.06.2009
25
ImplementationImplementationImplementationImplementation onlyonly dependsdepends onon
thethe generatedgenerated programmingprogramming model APImodel APIgg p g gp g g
Implementation Code
ProgrammingModel API
Glue Code
Runtime Infrastructure(Platform/Middleware)
Glue Code
ProgrammingProgramming ModelModelGeneratedGenerated API + API + UsageUsage IdiomsIdioms
CompletelyCompletely TechnologyTechnology‐‐IndependentIndependentp yp y gygy pp
Implementation Code
ProgrammingModel API
Glue Code
Runtime Infrastructure(Platform/Middleware)
Glue Code
26.06.2009
26
RuntimRuntimee InfrastructureInfrastructureSelect Select basedbased on on fifit t wrtwrt. . toto architecturalarchitectural
conceptsconcepts andand nonnon‐‐functionalfunctional requirementsrequirementspp qq
Implementation Code
ProgrammingModel API
Glue Code
Runtime Infrastructure(Platform/Middleware)
Glue Code
GlueGlue CodeCodeAka Technology Mapping CodeAka Technology Mapping CodeMapsMaps API API toto selectedselected platformplatformpp pp
Implementation Code
ProgrammingModel API
Glue Code
Runtime Infrastructure(Platform/Middleware)
Glue Code
26.06.2009
27
GlueGlue CodeCodeContainsContains ConfigurationConfiguration Files Files forfor PlatformPlatform
MightMight requirerequire „mix in „mix in modelsmodels““gg qq
Implementation Code
ProgrammingModel API
Glue Code
Runtime Infrastructure(Platform/Middleware)
Glue Code
SeveralSeveral PlatformsPlatformsDifferent Different PlatformsPlatforms, not , not LanguagesLanguages
Support Support forfor ScalingScaling (non(non‐‐functionalfunctional reqreq))pppp gg (( qq))
Implementation Code
ProgrammingModel API
l d l d
Runtime Infrastructure(Platform/Middleware)
Glue Code
Platform 2
Glue Code 2
Testing!
26.06.2009
28
BenefitsBenefits::ffi iffi i llMore More EfficientEfficient ImplImpl..
Technology IndependentTechnology IndependentConsistenceConsistence/Quality/QualityConsistenceConsistence/Quality/QualityArchitectureArchitecture‐‐ConformanceConformance
Code Gen Code Gen SequenceSequence
Implementation Code
ProgrammingModel API1) 1) GenerateGenerate APIAPI
2) Write 2) Write ImplImpl CodeCodePlatform
Glue Code
3) Select 3) Select PlatformPlatform
4) 4) GenerateGenerate GlueGlue CodeCode
26.06.2009
29
SeparateSeparate ModelsModelsforfor stuffstuff relevant relevant forfor thethe APIAPIvs.vs. systemsystem//deploymentdeployment stuffstuffvs. vs. systemsystem//deploymentdeployment stuffstuff
ProgrammingModel API
Model 1(Types)
Model 2(System,
Deployment)Glue Code
DEMO III
Generating C for thetarget device
26.06.2009
30
77
Expressing Expressing VariabilityVariabilityp gp g yy
26.06.2009
31
Different Different VariantsVariantsofof thethe SystemSystemforfor different different customerscustomers..
HowHow do I do I expressexpress
thisthis in in thethemodelsmodels??
26.06.2009
32
Negative Negative VariabilityVariability::ConditionallyConditionally takingtakingsomethingsomething awayaway
Negative Negative VariabilityVariability::ConditionallyConditionally takingtakingsomethingsomething awayaway
FeatureFeature ModelsModelsFeature Feature ModelsModels
26.06.2009
33
component DelayCalculator {provides default: IDelayCalculatorrequires screens[0..n]: IInfoScreenprovides mon: IMonitoring feature monitoring
}
26.06.2009
34
component DelayCalculator {provides default: IDelayCalculatorrequires screens[0..n]: IInfoScreenprovides mon: IMonitoring feature monitoring
}
namespace monitoringStuff feature monitoring {
component MonitoringConsole {p g {requires devices:[*]: IMonitor
}
instance monitor: MonitoringConsole
dynamic connect monitor.devices query {type = IMonitor
}}
}
26.06.2009
35
Positive Positive VariabilityVariability::ConditionallyConditionally addingaddingConditionallyConditionally addingadding
somethingsomething toto a a minimal minimal corecore
26.06.2009
36
Positive Positive VariabilityVariability::ConditionallyConditionally addingaddingConditionallyConditionally addingadding
somethingsomething toto a a minimal minimal corecore
AspectsAspects
namespace monitoring {
component MonitoringConsole …instance monitor: …dynamic connect monitor.devices …
aspect (*) component {provides mon: IMonitoring
}}}
26.06.2009
37
component DelayCalculator {…
}
component AircraftModule {…
}
component InfoScreen {…
}
component DelayCalculator {…
}
component AircraftModule {…
}
component InfoScreen {…
} component DelayCalculator {…provides mon: IMonitoring
}
component AircraftModule {…
aspect (*) component {provides mon: IMonitoring
}
provides mon: IMonitoring}
component InfoScreen {…provides mon: IMmonitoring
}
26.06.2009
38
iiWeaver Weaver isis genericgeneric::worksworks withwith all (all (containercontainer))
d ld l l tl tmodel model elementselements
aspectaspect (*) (*) <type><type>all all instancesinstances ofof type type
aspectaspect (tag=(tag=blabla)) <type><type>all all instancesinstances withwith tag tag blabla
aspectaspect ((namename=S*) <type>=S*) <type>aspectaspect ((namename=S*) <type>=S*) <type>all all instancesinstances whosewhose namenamestartsstarts withwith SS
26.06.2009
39
namespace monitoring feature monitoring {
AO + FeaturesAO + Features
component MonitoringConsole …instance monitor: …dynamic connect monitor.devices …
aspect (*) component {provides mon: IMonitoring
}}}
DEMO III
Adding Variability and connectivity to a feature model to the previous DSL
26.06.2009
40
BasedBased on on actualactualpracticalpractical experienceexperience
26.06.2009
41
CurrentlyCurrently in in useuse withwithfourfour ofof mymy customerscustomers
BenchmarkedBenchmarked bybysuitabilitysuitability forfor useuse in in t d ‘t d ‘ j tj ttoday‘stoday‘s projectsprojects
26.06.2009
42
THE END.THE END.ThankThank youyouThankThank youyou..QuestionsQuestions??
26.06.2009
43