Architecture As Language - Presentation Transcript
Architecture As Language MarkusVoelter www.voelter.devoelter@acm.org
About Markus Voelter Independent Consultant
About Markus Voelter Independent Consultant Software Architecture DSLs & MDSD ProductLines
About Markus Voelter Independent Consultant http://www.voelter.de voelter@acm.org skype: schogglad
Architecture
Architecture DSLs/MDSD
Architecture DSLs/MDSD ProductLines
Architecture DSLs/MDSD ProductLines This Talk
Architecture Whatever has to be consistent throughout a system to satisfy requirements and -ilities. != granularity evolves over time
DSLs/MDSD Modeling Language Design Code Generation UML, SysML or ADLs here: Textual
ProductLines Managing the Variability between a family of related, but not identical products
Based on actualpracticalexperience
Currently in usewithfourofmycustomers
Benchmarkedby suitabilityforuse in today‘sprojects
Part 1 A real-word Story 1.1 System Background 1.2 The Starting Point 1.3 What is a language? 1.4 Developing the Language …
Part 2 TheoryandConcepts 2.1 What we did in a Nutshell 2.2 Domain Specific Languages 2.3 The Importance of Viewpoints 2.4 Benefits 2.5 Why Textual? 2.6 Model Validation 2.7 Generating Code 2.8 Architecture Analysis Tools 2.9 Standards, UML and ADLs …
Part 2 TheoryandConcepts 2.10 Why not use a 3GL? 2.11 My Notion of Components 2.12 Component Implementation 2.13 The Role of Patterns 2.14 Documentation 2.15 Expressing Variability 2.16 PLE – Big Picture 2.17 Process 2.18 Underlying Concepts
More Reading: Thispresentationis not suitableforreadingwithoutmetalking in parallel. Youcan find documentsdescribingthecontentat http://www.voelter.de/data/articles/ArchitectureAsLanguage-PDF.pdf http://www.voelter.de/data/articles/ArchitectureAsLanguage-Part2-PDF.pdf
1 A Real-World Story
Customer Consultant
Requirements Domain Expertise Solution Approach
1.1 A Real-World Story System Background
Flight Management System
Monitors Website Aircraft-Module Data Center
Distributed System
A lotofexperiencewithsystemslikethese
Evolveover 15 – 20 years
Multiple Languages Java C++ C#
Technology Abstraction
Cannot update everythingatonce
Loose coupling Versioning
Different Installations have different features
Variants ProductLines
1.2 A Real-World Story The Starting Point
Backbone:Messaging [Good]
Technology Evaluated
BusinessObject Model [Not so good]
Problem:Consistence? Big Picture? Technology Abstraction?
Huge & Typical Problem
Language!
Formal Language!
1.3 A Real-World Story Whatis a language?
INFORMAL Set of well-definedterms
INFORMAL Stakeholders agree on meaning
FORMAL Metamodel
FORMAL Metamodel Grammar
FORMAL Metamodel Grammar Notation
1.4 A Real-World Story Developingthe Language
Let‘sdefine a formal languagetodescribethesystem‘sarchitecture
Components
Component:SmallestArchitecturally Relevant Building Block
Component:Piece offunctionality
Component:Can beinstantiated
Initial Components: Delay Calculator Info Screen Aircraft Module
Dynamic Connector:Discovers target(s) atruntimeusing a naming/trader/registryservice
namespacecom.mycompany.production { instance dc: DelayCalculator // InfoScreen instances are created and // started in other configurations dynamicconnectdc.screensevery 60 query { type = IInfoScreen status = active } }
Dynamic Wiring does not invalidate theoverallapproach
Similar Approach canbeusedfor redundant connectors
Registration Properties forinstances used in lookup
interfaceIAircraftStatus { onewaymessageregisterAircraft(aircraft: ID! ) onewaymessageunregisterAircraft(aircraft: ID! ) onewaymessagereportPosition(aircraft: ID!, pos: Position! ) request-replymessagereportProblem { request (aircraft: ID!, problem: Problem!, comment: String!) reply (repairProcedure: !ID) } protocolinitial = new { state new { registerAircraft => registered } state registered { unregisterAircraft => new reportPosition reportProblem } } }
Invariantsfor Data Structures
struct Time { hour: int min: int seconds: int inv hour >= 0 && hour <= 23: “hour must be 0-23” inv min >= 0 && min <= 59: “min must be 0-59” inv seconds >= 0 && seconds <= 59: “seconds must be 0-59” }
But everything isexpressedexplicitlyandconsistently, all in oneplace.
2 TheoryandConcepts
2.1 TheoryandConcepts Whatwedid in a Nutshell
As you understand anddevelopyour Architecture…
Develop a languageto express it!
Language resemblesarchitecturalconcepts
We express theapplication(s) withthelanguage.
Architecture DSL
2.2 TheoryandConcepts Domain SpecificLanguages
Definition
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.
focussed
processable
language
concern/viewpoint
domain
abstractions
notation
stakeholders
Dimensions
internal vs. external
compiled vs. interpreted
customization vs. configuration
graphical vs. textual
2.3 TheoryandConcepts The ImportanceofViewpoints
viewpoint A „perspective“ towardsthesystem
Based on a slideby Steve Cook and IEEE 1471
Type Deployment Composition
2.4 TheoryandConcepts Benefits
Clear Understanding frombuildingthelanguage
Unambigious Vocabulary
Conceptsindependent from Technology
Programming Model canbedefinedbased on ConceptualArcitecture
Model evolutionistrivial, youcanalwaysusegrep. adaptingexistingmodelsasthe DSL evolves
Many Developers prefertextualnotations
When a graphical notation isbetter, youcanvisualize.
Via M2M Read-Only Auto-Layout Drill-Down
Textual DSLs vs. Graphical vs. Visualization
Graphviz
Prefuse
I am aware of the usefulness of graphical notations. I am exaggerating here a little bit. But: We’ve been building software with text only for a long time. We know it works.
DefinitionsAbound: Something thatcontainsbusinesslogicandruns in a container
My Understanding: Smallestarchitecturally relevant building block
My Understanding: Black Box - Architecturally
My Understanding: All architecturally relevant aspectsspecifieddeclaratively (model)
My Understanding: Analyzable, Composablebytools
My Understanding: Running in container, providestechnicalservicesatcomponentboundary
The specificstructureandmetadataof a componentdefinedspecificallyforeachproject/system/ productline
Thisiswhatwe do withthe … Architecture DSL
2.12 TheoryandConcepts ComponentImplementation
By Default: ManualyProgrammingagainsttheProgMod API
Alternatives: Generate, based on config
Alternatives: Generate, based on config State Machines
Alternatives: Generate, based on config State Machines RuleLanguages + Engines
Alternatives: Generate, based on config State Machines RuleLanguages + Engines Specific DSL
Tointegratebehavior, createspecificabstractionsin thearchitecture DSL. ADD THE CASCADING STUGGF HERE
Note: A lotofimplementationcanbegeneratedautomatically (noconfig) fromthe model (persistence, serialization, …)
2.13 TheoryandConcepts The Roleof Patterns
Pattern: Proven solutions to recurring problems, including their applicability, trade-offs and consequences.
Architecture Patterns: “Blueprint” for a specific architectural style
Architecture Patterns: “Blueprint” for a specific architectural style Inspires the concepts for architecture DSL
Design Patterns: More concrete, moreimplementation-relatedthanarch. patterns
Design Patterns: More concrete, moreimplementation-relatedthanarch. patterns Typicallydoes not end up in the DSL, but …
Design Pattern: More concrete, moreimplementation-relatedthanarch. patterns putintothecodegenerator
It‘s not thecodegeneratorwhodecidesabouttheimplementationof a pattern – it‘s still the (generator) developer! A Pattern ismorethanthesolution UML diagram!
2.14 TheoryandConcepts Documentation
The DSL andthe „programs“ aredocumentation.
So I don‘thavetowrite… … moredocs?
Not quite.
1
Grammaris a good formal definition, but not a teachingtool.
Grammaris a good formal definition, but not a teachingtool. Tutorials
Tutorials: ArchitecturalConcepts (Meta Model) Howtousethelanguage Howtousetheprogramming model (Howtogeneratecode) (Howtoaddmanualcode)
Tutorials: ArchitecturalConcepts (Meta Model) Howtousethelanguage Howtousetheprogramming model (Howtogeneratecode) (Howtoaddmanualcode) ExampleDriven!
Weaver isgeneric: workswith all (container) model elements
aspect (*) <type> all instancesoftype aspect (tag=bla)<type> all instanceswith tag bla aspect (name=S*) <type> all instanceswhosenamestartswith S
AO + Features namespacemonitoring feature monitoring {
Software Architecture is often either imprecise and more
Software Architecture is often either imprecise and hard to grasp or technology specific. What you really want is a succinct, precise, technology-independent and tool-processable description of an architecture. In this tutorial we illustrate how textual DSLs can be used to this end. The core idea is to actually develop an architecture language as you understand the architecture, formalizing the growing intuitive understanding into a formal language. This removes ambiguity from the discussion, requires answers to arising questions and results in a more consistent and (re-)usable architecture. The tutorial has three parts: we start with a role play where we showcase how an architecture DSL is developed as part of a discussion about a system's architecture. We actually build an example DSL in real time. In part two we look at some of the concepts, rationales and benefits of the approach, and briefly point to tools that can be used to build languages and associated tooling. The third part looks at how to use the approach for product lines: how to express variability in the architectural descriptions, and how to integrate the DSL with feature-modeling based variability management. The tutorial is for practitioners, by practitioners. It is guaranteed to contain only practice-oriented material. less
0 comments
Post a comment