Architecture As Language

1,600 views
1,512 views

Published on

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,600
On SlideShare
0
From Embeds
0
Number of Embeds
72
Actions
Shares
0
Downloads
56
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Architecture As Language

  1. 1. Architecture As Language<br />Andreas Graf<br />MarkusVoelter<br />www.itemis.degraf@itemis.de<br />www.voelter.devoelter@acm.org<br />
  2. 2.
  3. 3. About<br />
  4. 4.
  5. 5. 1<br />What is a language?<br />
  6. 6. INFORMAL<br />Set of well-definedterms<br />
  7. 7. INFORMAL<br />Stakeholders<br />agree on meaning<br />
  8. 8. FORMAL<br />Metamodel<br />
  9. 9. FORMAL<br />Metamodel<br />Grammar<br />
  10. 10. FORMAL<br />Metamodel<br />Grammar<br />Notation<br />
  11. 11. A DSL is a focussed, processablelanguagefor describing a specific concernwhen building a system in a specific domain. Theabstractionsandnotationsused are natural/suitablefor the stakeholderswho specify that particular concern.<br />
  12. 12.
  13. 13. 2<br />Architecture DSLs<br />
  14. 14. Architecture<br />DSL<br />
  15. 15. As you understand<br />anddevelopyour<br />Architecture…<br />
  16. 16. Develop a languageto express it!<br />
  17. 17. Language resemblesarchitecturalconcepts<br />
  18. 18. We express theapplication(s) withthelanguage.<br />
  19. 19. DEMO I<br />An architectural DSL for embedded systems<br />
  20. 20.
  21. 21. 3<br />Benefits<br />
  22. 22. Clear Understanding<br />frombuildingthelanguage<br />
  23. 23. Unambigious<br />Vocabulary<br />
  24. 24. Conceptsindependent<br />from Technology<br />
  25. 25. Programming Model canbedefinedbased on ConceptualArcitecture<br />
  26. 26. Architecture„executable“<br />(i.e. morethanrulesanddocs)<br />
  27. 27.
  28. 28. 4<br />Why Textual?<br />
  29. 29. 4<br />… or:why not graphical?<br />
  30. 30. Languagesand Editors<br />areeasiertobuild<br />
  31. 31. Languagesand Editors<br />areeasiertobuild<br />Evolve Language and simple editorasyou understand anddiscussthearchitecture, in real time!<br />
  32. 32. Integrateseasilywithcurrentinfrastructure:<br />CVS/SVN diff/merge<br />
  33. 33. Model evolutionistrivial, youcanalwaysusegrep.<br />adaptingexistingmodelsasthe DSL evolves<br />
  34. 34. Many Developers <br />prefertextualnotations<br />
  35. 35. When a graphical<br />notation<br />isbetter, youcanvisualize. <br />
  36. 36.
  37. 37. 5<br />Tooling<br />
  38. 38. Severaltoolsavailable.<br />Example:oAWXtext<br />
  39. 39. SpecifyGrammar<br />
  40. 40. AntlrGrammarandParserisgeneratedfromthisspecification<br />
  41. 41. Generated Metamodel<br />
  42. 42. SpecifyConstraints<br />
  43. 43. Generated Editor<br />
  44. 44. DEMO II<br />The language-aware editor for our DSL<br />
  45. 45.
  46. 46. 6<br />Generating Code<br />
  47. 47. Sincewealready<br />have a formal model….<br />
  48. 48. Generate API<br />MapsArchitecturalConceptsto<br />Implementationlanguage (non-trivial!)<br />
  49. 49. Implementation<br />Implementationonlydepends onthegeneratedprogramming model API<br />
  50. 50. Programming Model<br />Generated API + Usage Idioms<br />Completely Technology-Independent<br />
  51. 51. Runtime Infrastructure<br />Select based on fit wrt. toarchitectural<br />conceptsand non-functionalrequirements<br />
  52. 52. Glue Code<br />Aka Technology Mapping Code<br />Maps API toselectedplatform<br />
  53. 53. Glue Code<br />ContainsConfiguration Files forPlatform<br />Mightrequire „mix in models“<br />
  54. 54. SeveralPlatforms<br />Different Platforms, not Languages<br />Support forScaling (non-functionalreq)<br />Testing!<br />
  55. 55. Benefits:More EfficientImpl.<br />Technology Independent<br />Consistence/Quality<br />Architecture-Conformance<br />
  56. 56. Code Gen Sequence<br />1) Generate API<br />2) Write Impl Code<br />3) Select Platform<br />4) GenerateGlue Code<br />
  57. 57. Separate Models<br />forstuff relevant forthe API<br />vs. system/deploymentstuff<br />
  58. 58. DEMO III<br />Generating C for the<br />target device<br />
  59. 59.
  60. 60. 7<br />Expressing Variability<br />
  61. 61. Different Variants<br />ofthe System<br />for different customers.<br />
  62. 62. How do I <br />express<br />this in themodels?<br />
  63. 63. Negative Variability:<br />Conditionallytakingsomethingaway<br />
  64. 64. Negative Variability:<br />Conditionallytakingsomethingaway<br />Feature Models<br />
  65. 65.
  66. 66. componentDelayCalculator {<br />provides default: IDelayCalculator<br />requires screens[0..n]: IInfoScreen<br />providesmon: IMonitoringfeature monitoring<br />}<br />
  67. 67. componentDelayCalculator {<br />provides default: IDelayCalculator<br />requires screens[0..n]: IInfoScreen<br />providesmon: IMonitoringfeature monitoring<br />}<br />
  68. 68. namespacemonitoringStufffeature monitoring {<br /> <br />componentMonitoringConsole {<br />requires devices:[*]: IMonitor<br /> }<br />instance monitor: MonitoringConsole<br />dynamicconnectmonitor.devicesquery {<br /> type = IMonitor<br /> }<br /> <br />}<br />
  69. 69.
  70. 70. Positive Variability:Conditionallyaddingsomethingto a minimal core<br />
  71. 71. Positive Variability:Conditionallyaddingsomethingto a minimal core<br />Aspects<br />
  72. 72. namespacemonitoring {<br /> <br />componentMonitoringConsole …<br />instance monitor: …<br />dynamicconnectmonitor.devices …<br /> <br />aspect (*) component {<br />providesmon: IMonitoring<br /> }<br />}<br />
  73. 73. componentDelayCalculator {<br /> …<br />}<br />componentAircraftModule {<br /> …<br />}<br />componentInfoScreen {<br /> …<br />}<br />
  74. 74. componentDelayCalculator {<br /> …<br />}<br />componentAircraftModule {<br /> …<br />}<br />componentInfoScreen {<br /> …<br />}<br />componentDelayCalculator {<br /> …<br />providesmon: IMonitoring<br />}<br />componentAircraftModule {<br /> …<br />providesmon: IMonitoring<br />}<br />componentInfoScreen {<br /> …<br />providesmon: IMmonitoring<br />}<br />aspect (*) component {<br />providesmon: IMonitoring<br /> }<br />
  75. 75. Weaver isgeneric:<br />workswith all (container)<br />model elements<br />
  76. 76. aspect (*) &lt;type&gt;<br /> all instancesoftype <br />aspect (tag=bla)&lt;type&gt;<br /> all instanceswith tag bla<br />aspect (name=S*) &lt;type&gt;<br />all instanceswhosenamestartswith S<br />
  77. 77. AO + Features<br />namespacemonitoring feature monitoring {<br /> <br />componentMonitoringConsole …<br />instance monitor: …<br />dynamicconnectmonitor.devices …<br /> <br />aspect (*) component {<br />providesmon: IMonitoring<br /> }<br />}<br />
  78. 78. DEMO III<br />Adding Variability and connectivity to a feature model to the previous DSL<br />
  79. 79.
  80. 80. Based on actualpracticalexperience<br />
  81. 81. Currently in usewithfourofmycustomers<br />
  82. 82. Benchmarkedby<br />suitabilityforuse in today‘sprojects<br />
  83. 83.
  84. 84. THE END.<br />Thankyou.<br />Questions?<br />

×