Professional Documents
Culture Documents
ARCHITECTURE
Page 1
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
A challenging question!
Observation
Many architects have a sound knowledge in software engineering methods and concrete design and programming technologies, both broad and deep Yet time and again architectures and their realizations suffer from insufficient quality, regarding modularization, interactions, or non-functional quality
What makes architects a master of their craft? How do master architects design?
Page 2 The Craft of Software Architecture Seven Secrets Every Architect Should Know Frank Buschmann, all rights reserved
ARCHITECTURE
Drive Design Through User Tasks Be Minimalist Ensure Visibility of Domain Concepts Use Uncertainty as a Driver Design Between Things Pay Attention To Implicit Assumptions Eat Your Own Dog Food
Page 3
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Secret One
Page 4
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
An architecture is more than a set of interacting parts, technical infrastructure, and smart design concepts!
EAI (SAP ) OPC (s) Communication Framework Common Services SNMP
Plant UI Alarm Client Network View Diagnostic Client
Northbound Gateway
Application Services Information Repository Configuration & Activation Managed Object Common Nam e Archiving Services Trend Logging Audit Trail Alarm Logging Operational and Maintenance Services Monitor & Control
Alarm
Tracing
Time
(s) SNMP
Key Application Clients Entities (Field Devices , Network Elements ) Communication Framework Communication
HLV
- 060608
- UB
. vsd
: NM
How well does it support developers in its use, realization, test, maintenance and evolution?
& CS
ARCHITECTURE
Task-oriented design Design software systems with explicit consideration of how they will be used and how they can best support the work their users will be doing
[Larry Constantine] Select essential user scenarios
Operational scenarios: user tasks and workflows; including their quality attributes Developmental scenarios: realization, adaptation, configuration, evolution,
ARCHITECTURE
Walking skeletons
Goal of a task-driven architecture specification is to create a walking skeleton
A set of end-to-end slices through the system that correspond to architecturally significant user tasks with users being end users and developers Implemented in product quality: functionality with associated quality
Application Assistant Application
Prototype only
(based on portlet technology)
User interface
Sys Mgmt UI
Fault Mgmt UI
Logon Web UI
Business logic
Authenticatio n and Privilege Service
Presence Aggregator
Common service
Domain Service
Presence Service
Infrastructure
System Management
Fault Management
Persistence Framework
Runtime environment
Database
Symphonia
SyMOM
Event Model Messaging
Runtime Env.
Logging
EJB, OSGi)
ARCHITECTURE
Secret Two
Be Minimalist
Page 8
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
On minimalism
A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away
[Antoine de Saint-Exupry]
Page 9 The Craft of Software Architecture Seven Secrets Every Architect Should Know Frank Buschmann, all rights reserved
ARCHITECTURE
Maximalism
interface Iterator { boolean set_to_first_element(); boolean set_to_next_element(); boolean set_to_next_nth_element(in unsigned long n) raises(); boolean retrieve_element(out any element) raises(); boolean retrieve_element_set_to_next(out any element, out boolean more) raises(); boolean retrieve_next_n_elements (in unsigned long n, out AnySequence result, out boolean more) raises(); boolean not_equal_retrieve_element_set_to_next(in Iterator test, out any element) raises(); void remove_element() raises(); boolean remove_element_set_to_next() raises(); boolean remove_next_n_elements(in unsigned long n, out unsigned long actual_number) raises(); boolean not_equal_remove_element_set_to_next(in Iterator test) raises(); void replace_element(in any element) raises(); boolean replace_element_set_to_next(in any element) raises(); boolean replace_next_n_elements (in AnySequence elements, out unsigned long actual_number) raises(); boolean not_equal_replace_element_set_to_next(in Iterator test, in any element) raises(); boolean add_element_set_iterator(in any element) raises(); boolean add_n_elements_set_iterator (in AnySequence elements, out unsigned long actual_number) raises(); void invalidate(); boolean is_valid(); boolean is_in_between(); boolean is_for(in Collection collector); boolean is_const(); boolean is_equal(in Iterator test) raises(); Iterator clone(); void assign(in Iterator from_where) raises(); void destroy(); };
The Craft of Software Architecture Seven Secrets Every Architect Should Know
Page 10
ARCHITECTURE
Minimalism
interface BindingIterator { boolean next_one(out Binding result); boolean next_n(in unsigned long how_many, out BindingList result); void destroy(); };
Abstraction is a matter of choice: the quality of abstraction relates to compression and clarity
Encapsulation is a vehicle for abstraction What is the simplest design that possibly could work? [Ward Cunningham]
Page 11
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Secret Three
Page 12
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Information hiding
string
int
What are the implied application concepts behind string and int? What is their intended usage contract? How can we ensure intention and contract are visible and enforced?
Page 13
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Velocity was represented as a 64 bit float A conversion into a 16 bit signed integer caused an overflow The current velocity of Ariane 5 was too high to be represented as a 16 bit integer Error handling was suppressed for performance reasons Damage 370 Mio. USD
*Source: http://moscova.inria.fr/~levy/talks/10enslongo/enslongo.pdf
Page 14 The Craft of Software Architecture Seven Secrets Every Architect Should Know Frank Buschmann, all rights reserved
ARCHITECTURE
For example
Strings for keys and codes become types in their own right, for example ISBNs, SQL statements, URLs Recurring value groupings become whole objects, for example date, address, access rights
Date Integer day, month, year String getDate() Integer getDayInMonth() Integer getMonth() Integer getYear()
Page 15 The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
passes telegrams to
Telegram Forwarder
The network Telegram Receiver passes telegrams to passes Telegram commands to Converter applies
Logging Strategy Log Alarms Logger
Expressive designs are easier to understand, communicate, realize, test, and review
Pick Workpiece
SetPoint Calculation
Page 16
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Secret Four
Page 17
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Property Class A
Property Class B
Property Class C
When architects cannot agree on an explicit domain model and escape in genericity
Strategy to allow instance-specific overriding of all inherited behavior
Network Element
... // Hard-coded instance configuration switch (node->type()) { case A: node->add_property (new Persistance(new Data_Visitor_A)); node->add_property (new Network_Connectivity()); ...
Frank Buschmann, all rights reserved
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Use uncertainty as a driver The most interesting thing is not actually the choice between A and B, but the fact that there is a choice between A and B [Kevlin Henney]
Limit uncertainty scope Make uncertainty explicit Drive uncertainty resolution
Decide explicitly (!) to not decide now (!!) Take concrete action to (iteratively) drive decision
Spikes to sharpen requirements and technology understanding Spikes to get feedback on each options sustainability Scenarios in a walking skeleton to stress operational consequences of the most promising option Active Design Reviews to explore the developmental consequences of the most promising option
Frank Buschmann, all rights reserved
Decide
Page 19
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Secret Five
Page 20
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
The solution
Developers discovered need for tag removal but changing a released interface is difficult
Tag removal added without interface modification
1 2
Page 21
Change set() implementation to handle both set() and remove() Convention to use a prefix "r:" in tagName to indicate removal
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Be where things meet The architects main territory is between things, where they meet and hurt: Interfaces, Interactions, Integration.
Interfaces Complete, meaningful Role-specific, expressive, usable Defined contract, stability Simple, meaningful, direct, efficient Quality of Service (reliable, fast, scalable, secure, configurable, ) Task-oriented, end-to-end quality Systems integration, plant integration, HW / SW integration Application integration, service integration, process-level integration, data integration, UI integration, device integration
Interaction
Integration
Deficiencies in interfaces, interactions, and integration tend to show up later in the SW lifecycle than modularization and implementation issues: during system integration, system test, roll out, operation thus their resolution is costly!
Page 22 The Craft of Software Architecture Seven Secrets Every Architect Should Know Frank Buschmann, all rights reserved
ARCHITECTURE
Secret Six
Page 23
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Page 24
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
The business success or acceptance of software often depends on qualities that are rarely explicitly stated
85% of SW Lifecycle costs are devoted to maintenance and evolution
ARCHITECTURE
Watch out for dissatisfiers Pay attention to implicit assumptions: features or qualities that are expected and create trouble if not present, but rarely expressed explicitly!
Functionality of competitor or previous generation systems Performance Robustness Maintainability [check your spec]
Address expected features prominently, constantly, and from the very beginning
To make them visible and explicit in your architecture To avoid costly late changes and nonconformance costs To avoid customer dissatisfaction
Page 26 The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Secret Seven
Page 27
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
Business Logic
Data Logic
Actual use
Interceptors
Were not closed but called back normal application logic Application logic issued nested calls to data logic
Solution
Interceptor framework in data handling logic; Self-contained interceptors provide local extension logic
Page 28 The Craft of Software Architecture Seven Secrets Every Architect Should Know
Effect
Oscillating control flow between business logic and data logic Circular, uncontrollable, unstable call chains
Frank Buschmann, all rights reserved
ARCHITECTURE
Architect also implements! Eat your own dog food! Actively participate in implementation!
To experience the consequences of your own designs! To communicate your intention, and minimize misunderstanding To discover the devil in the detail
ARCHITECTURE
In Retrospect
Page 30
The Craft of Software Architecture Seven Secrets Every Architect Should Know
ARCHITECTURE
In retrospect The seven practices complement an architects knowledge, technical experience, and design skills regarding
Communication to stakeholders Key measures: explicit attention to their interests, making interests visible and tangible, e.g., through walking skeletons or attention to uncertainty Economic architecture Key measure: strict adherence to KISS principle Understanding that code matters Key measure: explicit consideration of developer needs, early coding, presence and participation in coding Seek for feedback Key measure: visibility and explicit attention to challenges, both known and unknown
Page 31 The Craft of Software Architecture Seven Secrets Every Architect Should Know Frank Buschmann, all rights reserved
ARCHITECTURE
A departing thought
Structural engineering is the science and art of designing and making, with economy and elegance, buildings, bridges, frameworks, and other similar structures so that they can safely resist the forces to which they may be subjected. [The Institution of Structural Engineers]
Page 32
The Craft of Software Architecture Seven Secrets Every Architect Should Know