Understand selected software architecture concepts, and see them being ...
Shaw/Garlan “Software Architecture – Perspectives on an Emerging Discipline” [
SG96] ..... Given up to 20 steps per process, and a peak hour load of 30% above
.... Design rationale is attached in the form of unstructured comments (free form).
IBM Research – Zurich
Model-Driven Software Engineering: Models in Software Architecture Design Dr. Olaf Zimmermann, Executive IT Architect (
[email protected])
IBM Research – Zurich
Learning Objectives
Understand selected software architecture concepts, and see them being applied to practical examples and industrial case studies – Software quality attributes – Architectural patterns (for application development and integration) – Architectural decisions
Understand role of models in software architecture design, and be able to consume and create such models – – – – –
2
Motivation for modeling Types of models Languages and notations Tool support Practical hints
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Contents
Software architecture fundamentals Motivation for architectural modeling Case study: order management in telecommunications Models in software architecture design: UMF and UML Concluding thoughts
3
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Contents
Software architecture fundamentals Motivation for architectural modeling Case study: order management in telecommunications Models in software architecture design: UMF and UML Concluding thoughts
4
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
A First Example: Core Banking SOA with Web Services Platform independent
Java Client
IBM WebSphere®
.NET Client
Browser
Office
WSDL
Documentation
generate SOAP
SOAP
(pSeries)
SOAP Web Application generate
Web Services Adapter Layer
Dynamic Interface
JavaTM API (Dynamic Interface)
IBM CICS
Access Layer Business Function
(zSeries)
5
Repository
Java Backend Connectors (IBM WebSphere MQ, CICS®)
Dr. Olaf Zimmermann | MDSE 2011
Database (IBM DB2®)
generate
IBM Research – Zurich
Architecture and Software Architecture Defined Most definitions indicate that an architecture is concerned with both structure and behavior, is concerned with significant elements only, may conform to an architectural style such as SOA, is influenced by its environment, and embodies important decisions [Eel11]. Three commonly used definitions are: Architecture is the fundamental organization of a system embodied in its components, their relationships to each other, and to the environment, and the principles guiding its design and evolution. [IEEE1471] The software architecture of a program or computing system is the structure or structures of the system, which comprise software elements, the externally visible properties of those elements, and the relationships among them. [BCK03] Software architecture as a set of architectural design decisions. [JB05]
Architecture vs. IT architecture vs. software architecture – all in scope in this lecture
6
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Software Architecture Fundamentals Responsibilities of a software architect in custom application development: – Synthesizes technical solution from requirements (supported by methods) – Technically leads project and estimates development efforts – Coaches developers and other technical staff
Key concepts: Quality attributes, architectural patterns, architectural decisions – Quality attributes are architecturally significant requirements – ... that drive selection of architectural patterns – … which is captured in the form of architectural decisions
Foundations date back to late 1990s (industry and academia) – Bass/Clements/Kazman “Software Architecture in Practice” [BCK03] – Shaw/Garlan “Software Architecture – Perspectives on an Emerging Discipline” [SG96] – Buschmann et al. “Patterns of Software Architecture” (POSA) [BMR+96]
7
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Software Quality Attributes (QAs)
How does a system provide its functionality (not what it does) – Reliability, usability, efficiency (e.g., performance, scalability), maintainability, and portability areas defined in ISO/IEC specification 9126-2001
Requirements in example deal with QAs tacitly or explicitly: – QA “Accuracy”: orders must not be lost, resource reservations must be undone – QA “Efficiency” (performance): sub-second response times specified – QA “Interoperability”: multiple platforms to be supported
Practical challenges: – Many attributes, many conflicts between them; many attributes hard to quantify – Often under-specified (unknown) or over-specified (overly ambitious) – Often stated on inadequate level of abstraction, e.g., per system (not per function/step)
8
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Architectural Patterns
Proven, common solution to known and recurring architecture design problem: – – – – –
Context captured by intent section QAs discussed in forces section A problem statement is given, often in question form There is a sketch of the solution (not a complete design!) See e.g. http://hillside.net/index.php/ag-template and http://hillside.net/index.php/apattern-language-for-pattern-writing for pattern writing support and advice
Top-level pattern in first example and in SOA case study:
– “Layers” pattern from [BMR+96] structures the architecture overview diagram – See http://www.vico.org/pages/PatronsDisseny/Pattern%20Layers/index.html
Practical challenges:
– Many eligible pattern languages – Link to requirements covered insufficiently – Transition to platform-specific design not addressed (or only in the form of examples)
9
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Example: SOA Patterns (UML Sketch of Solution) Source: [Zim09]
No industry consensus on SOA principles and patterns yet
Each author defines his/her own – many terminology mismatches
10
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
A Closer Look at the Process Manager Pattern “How do we route a message through multiple processing steps when the required steps may not be known at design-time and may not be sequential?”
“Use a central processing unit, a Process Manager, to maintain the state of the sequence and determine the next processing step based on intermediate results.” Source: [HW04] and http://www.eaipatterns.com/ProcessManager.html Process manager takes care of process instance creation and deletion, control flow routing, error handling in timeout situations, etc.
11
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Other Popular Patterns in Architecture Design
Layers, Pipes & Filters, Broker – POSA book series [BMR+96] Patterns of Enterprise Application Architecture such as Model-View Controller, Domain Model, Active Record [Fow03] Domain-Driven Design patterns such as Bounded Context [Eva03] Enterprise Integration Patterns such as Messaging, Channel [HW04] Adapter, Observer and other design patterns [GHJ+95] “Handbook of Software Architecture” collects such architectural patterns – Compiled by Grady Booch (one of the original authors of UML): http://www.handbookofsoftwarearchitecture.com/index.jsp?page=Main (registration/login required)
12
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Architectural Decisions
Capture the rationale justifying a design, in addition to design itself (answers to “why” questions) Example:
– “We selected the Layers pattern to make the core banking SOA future proof, e.g., to be able to add user channels in a flexible manner” – See http://www.ibm.com/developerworks/architecture/library/ar-knowwiki1 for full example and decision capturing template
Practical challenges:
– Retrospective decision capturing takes time and does not yield sufficient benefits – Relation to other architectural concepts and viewpoints (quality attributes, patterns) not understood well and not supported in methods and tools
13
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Methods for Software Architecture Design Software Engineering (SE) Method (Asset)
Project Usage of SE Method
Roles Phases, Activities, Tasks
Process
Project Plan
Performing Resources Work Breakdown Structure
suggest/prescribe
specify adopt
Artifact Formats Viewpoint Schema
Notation use
format
Techniques
tailor
Deliverables
Documents Models for Views
comprise
Content (Reference, Sample)
Project Documentation
Source: [Zim09]
Input and output of artifacts are documents or models Widely recognized and/or commonly practices methods: – ADD (SEI CMU), Siemens’ 4 Views, RUP (Rational/IBM), BAPO/CAFCR (Philips), ASC/ARES (Nokia) [HKN+07] – IBM Unified Method Framework (UMF), e.g. Application Development (AD) 2.0 [EC10] – Object-Oriented Analysis and Design (OOAD), e.g. codified in Open Unified Process (Open UP) [OUP]. Sample technique (a.k.a. method guidance): Focus on the architecture early to minimize risks and organize development – Domain-specific methods, e.g. for SOA design 14
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
The architect (a.k.a. technical lead) plays many roles. Project Management Software Method Browser
Project Plan incl. Work Breakdown Structure
Process Phases/Activities/Tasks
Roles
Executive ADs (Project Scoping)
Consult, tailor
Office Suite
Sample Content
Technique Papers
Artifacts
Traceability Management Tool
NFRs Create, review
Decision Log
Maintain
Issue List (ADs)
Software Architect
NFRs
Setup, review
Review Create
Analysis Modeling Environment
Analysis-Phase BPM
Business Processes Business Activities
Design Modeling Environment
Design Model (e.g., UML) Tacit ADs
Conceptual Workflows Service Contracts
Development Environment Configuration Files, Test Cases Tacit ADs
BPEL WSDL Java
ADs – Architectural Decisions
Reusable Asset Repository 15
Industry Models
Dr. Olaf Zimmermann | MDSE 2011
Enterprise Architecture
Pattern Literature
Code Libraries
Other Content
Source: [Zim09]
IBM Research – Zurich
Contents
Software architecture fundamentals Motivation for architectural modeling Case study: order management in telecommunications Models in software architecture design: UMF and UML Concluding thoughts
16
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
What is a Model (Engineering Definition)? From 1st lecture (MDSE fundamentals): “A model is an abstraction of something for the purpose of understanding it before building it” [RBT+91] Compare with definition by Bran Selic (an author of UML2): “abstraction is an intellectual defense mechanism for coping with overwhelming complexity” [Sel11]: – “Selective reduction of information of a system which preserves its salient properties relative to a given set of concerns” – “Refinement is the inverse process”
In engineering, abstractions are gained through modeling. An Engineering Model is [Sel11]: – “A selective representation of some system that captures accurately and concisely all of its essential properties of interest for a given set of concerns” – “We don’t see everything at once” – “What we do see is adjusted” View of real world
Analyse and design
is abstracted into
abstracts from
Model
program Code 17
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Why do Architects Model? Modeling forces you think deeply about the requirements and the emerging design – and understand and anticipate their ramifications (consequences) – Reason about choices – Trigger creativity, force certain decisions (e.g. type and cardinality of associations) – Abstract (leave out unnecessary details)
Models communicate (an architectural vision/intent)
– Within team of architects (same or different areas of specialization/expertise) – Within project team (architects, developers, testers, platform specialists, administrators) – With external stakeholders (sponsors, end users, maintenance teams)
Models document a design and allow to automate tasks, e.g. test case creation – Simulations (models often are cheaper/less risky to build than the real system) – Automation of routine tasks
Compare with Bran Selic’s view: “Model to understand, to predict, to communicate, to specify” [Sel11] Do not model without a purpose and a target audience in mind!
18
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Selected Models as UMF Work Products (Artifacts) Global Viewpoint Non-Functional Requirements (NFRs)
Use Case Model (UCM)
Architecture Overview Diagram (AOD)
Logical Viewpoint
Physical Viewpoint
Architectural Decisions (ARC 100)
19
Component Model (CM) L1
Operational Model (OM) L1 (Conceptual/ALOM)
Component Model (CM) L2
Operational Model (OM) L2 (Specified/LOM)
Component Model (CM) L3
Operational Model (OM) L3 (Physical)
Dr. Olaf Zimmermann | MDSE 2011
Adapted from: [ZKP09]
IBM Research – Zurich
Contents
Software architecture fundamentals Motivation for architectural modeling Case study: order management in telecommunications Models in software architecture design: UMF and UML Concluding thoughts
20
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
“T” Case Study: Context & Business Problems Wholesale subsidiary of large telecommunications company T (former monopolist, deregulated) – Provides wire line and wireless telephony services to retailer subsidiary of T and to 150 other companies, called Virtual Service Providers (VSPs) – One physical telephony network, owned and operated by T
Strategic imperative of T: – Drive down cost of operations by interacting with VSPs efficiently
Response: single, partially automated order management system – VSPs are expected to use the order management processes of T to connect, configure, or disconnect telephony services for their end users – Multiple channels required, including the World-Wide Web (Internet)
21
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
System Context
uses
VSP 1 (Browser)
VSP 2 (Other System via Web Service)
Move Create
Move Create
Internal Channel for T Staff
Move Create
T
Order Management System
Customer Database
22
Dr. Olaf Zimmermann | MDSE 2011
Telephony Network
Billing System
IBM Research – Zurich
Functional Requirements VSP 1 (Browser)
PSTN – Public Switched Telephone Network
VSP 2 (Other System via Web Service)
Move Create
Move Create
Internal Channel for T Staff
Move Create
T
Two Order Management Processes: „Create PSTN Service“, „Move PSTN Service“: About 20 steps per process, taking up to 24 hours to complete. Steps include: 1. Address validation – complex and requiring several user interactions 2. Resource reservation, e.g. copper transmission path, telephone number
Customer Database
23
Dr. Olaf Zimmermann | MDSE 2011
Telephony Network
Billing System
IBM Research – Zurich
Important Non-Functional Requirements (NFRs) 1.
The software system supporting the two order management processes must be accessible both over a private industry-sponsored network and the Internet. The VSPs and the backend systems to be integrated (e.g., billing system) change over time.
2.
Business volumes are approximately 20,000 “Create PSTN service” requests and 15,000 “Move PSTN service” requests per month. –
Given up to 20 steps per process, and a peak hour load of 30% above average, this equates to a peak load of about 4,550 steps executed per hour (based on core business hours of ten hours per day, 20 days per month)
3.
Initially, process instances must be able to persist from first step to last for three hours; however, this time will be extended to up to 24 hours in the future.
4.
VSPs are spread across a number of time zones, operating 23 hours per day and seven days per week.
5.
Average response time targets vary by process step, typically 3-5 seconds; 95% of the user interactions need to complete execution in 5-8 seconds.
6.
Domain-specific architecture design challenges include: 1. Address validation completeness and timeliness, 2. Releasing reserved resources (copper transmission path, telephone number) when a process instance fails or customer walks away.
7.
Communication patterns and protocols must support multiple platforms.
24
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Architecture Overview Diagram (First Design Iteration) VSP 1 (Browser)
VSP 2 (Other System via Web Service)
Move Create
T
Move Create
Move Create
Solution: Service-Oriented Architecture (SOA) with Process & Service Layers Process Layer
Service Layer
„Create“ Process
„Validation“ Service
Customer Database
25
Internal Channel for T Staff
Dr. Olaf Zimmermann | MDSE 2011
„Pricing“ Service
„Move“ Process
„Transmission Reservation“ Service
Telephony Network
Billing System uses
IBM Research – Zurich
Contents
Software architecture fundamentals Motivation for architectural modeling Case study: order management in telecommunications Models in software architecture design: UMF and UML Concluding thoughts
26
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
UML in an Architecture Design Context
The term “model” is overloaded – two primary meanings exist (MDSE vs. method) – Instance of a metamodel defining a modeling language (e.g., UML model) – Type of artifact in a method and instance thereof (e.g., UMF component model)
Several UML profiles for architects exist – IBM Architecture Description Standard (ADS) – IBM Rational UML Profile-Based Integrated Architecture (UPIA) V7.5.2 – Profiles supporting (enterprise) architecture frameworks such as DoDAF and MoDAF
UML concepts frequently used in architecture design: – Use cases, stereotyped class diagrams (e.g., domains models, logical/functional architecture viewpoint) – Sequence diagrams (for component interactions, system walkthroughs), and state machines (e.g., protocol specifications)
Architecture Description Languages increasingly popular, e.g. ArchiMate (subgenre of domain-specific languages) 27
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Sample Architecture: Multi-Channel Order Management (B2B) Firefox is a registered trademark of the Mozilla Foundation
Functional domain – Order entry management
Two business processes – New customer – Relocation
Main SOA drivers – Deeper automation grade – Share services between domains
Note: Architecture Overview Diagram (AOD) – drawn in an ADL, not in UML! – Proprietary ADL, first defined in an article on ADS [YRS+99] – Supported by IBM Rational Software Architect
28
Dr. Olaf Zimmermann | MDSE 2011
© 2011 IBM Corporation
IBM Research – Zurich
UMF Use Case Diagram and Component Model Traceability to functional requirements and NFRs required (a non-trivial task in practice) Dynamic view also to be provided (component interaction diagrams) Sunny day vs. rainy day design (error handling!)
Note: Both UMF deliverables contain a UML model/diagrams – and more! – Open UP/RUP give similar advice
E.g. Use case template to be filled out (structured text) – Preconditions, post conditions, scenario walkthroughs, etc. 29
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
UMF Operational Model
Note: Like in the AOD, the model elements (i.e., location node, deployment units, relations) and are defined in an ADL [YRS+99], not in UML. Design rationale is attached in the form of unstructured comments (free form). 30
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Important Model Types (Work Products/Artifacts) in UMF CIM (Analysis) Process Definition (+Business Use Cases)
Current Process Assessment (+Reference Model Alignment)
PIM 0
PIM 1
PIM 2 / PSM 1 (hybrid)
PSM 2
Process Definition (Design Model)
System Context
Architecture Overview Diagram
Use Case Model 1 (external)
Use Case Model 2 (+internals)
Service Model 1 (incl. WSDL-i)
Service Model 2 (incl. WSDL-b)
Deployment Units (SCA)
Component Model 1 (UML outline)
Component Model 2 (UML refined)
Component Model 3 (WPS, JEE)
Current IT Environment
Operational Model 1 (conceptual)
Operational Model 2 (WPS, specified)
Architectural Template
Nonfunctional Requirements
31
Analysis to High to Low Level Design Design to Implementation Design (manual) (manual, tool supported) (possibly automated) Dr. Olaf Zimmermann | MDSE 2011
Operational Model 3 (WPS, physical)
IBM Research – Zurich
More Information on Architecture Modeling in UMF/UML
IBM Architectural Thinking class (subset also available in lecture form) [Eel11] IBM Architecture Description Standard (ADS) [ZRS+99] “The Software Architecting Process” by Eeles/Cripps is a definite reference [EC10]: – http://www.architecting.co.uk/index.php
Also see Unified Process (an Open UP is available from Eclipse) [OUP]: – http://epf.eclipse.org/wikis/openup/
Many commercial UML tools, e.g. IBM Rational Software Architect and Design Manager are available, as well as open source assets Vision stencils (for UML and ADLs) Quick reference guides (for UML and ADLs) 32
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Contents
Software architecture fundamentals Motivation for architectural modeling Case study: order management in telecommunications Models in software architecture design: UMF and UML Concluding thoughts
33
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Why Model (Revisited)? Abstraction helps the architect to deal with complexity Support a divide-and-conquer strategy to problem solving – Componentization supports division of labor – Encapsulation, esp. layering eases maintenance (swap parts in/out) – Traceability and auditability (think of recent financial crisis/crises)
Promotes accuracy and precision (faithful to engineering spirit) – Example: Cardinalities of relations between domain entities and architectural components may make or break your project • • • •
34
E.g. database design (normalization?) E.g. API design (method/operation signatures?) E.g. number of test cases and structure of test data E.g. security concerns (denial of service attacks)
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Take Aways and Additional Information
Software architecture – Start from functional requirements and – even more importantly – NFRs, particularly the explicit and tacit software quality attributes – Find architectural patterns which resolve the forces underneath the NFRs, e.g., in the POSA book series [BMR+96] and the [Fow03] and [HW04] books – Make conscious pattern selection decisions and follow-on decisions about technologies and products • Based on experience or reusable asset
Full lecture on enterprise-wide IT architectures available locally! (Hoidn/Schlatter/Schwidder) – Link to 2010 edition
35
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Recommended Reading: Fundamentals and Process [BCK03] Bass, L., Clements, P., Kazman, R., Software Architecture in Practice, Second Edition. Addison Wesley, 2003. [EC10] Eeles O., Cripps P., The Process of Software Architecting. Addison Wesley, 2010. [Eel11] An Introduction to Software Architecture. IBM course, 2011. [HKN+07] Hofmeister C., Kruchten P., Nord, Obbink J. H., Ran A., America P., A General Model of Software Architecture Design Derived from Five Industrial Approaches. Journal of Systems and Software 80(1), Elsevier, 2007. Pages 106-126 [IEEE1471] ISO/IEC IEEE Std 1471-2000, Systems and Software Engineering – Recommended Practice for Architectural Description of Software-Intensive Systems, ISO/IEC, 2007. [JB05] Jansen A., Bosch J., Software Architecture as a Set of Architectural Design Decisions, Proc. of the 5th Working International Conference on Software Architecture, IEEE, 2005. [OG09] The Open Group, The Open Group Architecture Framework, Version 9, 2009. http://www.opengroup.org/togaf [OG09a] The Open Group, ArchiMate 1.0 Specification, 2009. [OUP] Open UP, http://epf.eclipse.org/wikis/openup/ [SG96] Shaw M., Garlan D., Software Architecture – Perspectives on an Emerging Discipline. Prentice Hall, 1996. 36
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Recommended Reading: Patterns and SOA Design [BMR+96] Buschmann F., Meunier R., Rohnert H., Sommerlad P., and Stal M., PatternOriented Software Architecture – a System of Patterns. Wiley, 1996. [Eva03] Evans E., Domain-Driven Design. Tackling Complexity in the Heart of Software. Addison Wesley, 2003. [Fow03] Fowler M., Patterns of Enterprise Application Architecture. Addison Wesley, 2003. [GHJ+95] Gamma E., Helm R., Johnson R., Vlissides J., Design Patterns – Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995. [HW04] Hohpe G., Woolf, B., Enterprise Integration Patterns. Addison Wesley, 2004. [KBS05] Krafzig D., Banke K., Slama D., Enterprise SOA, Prentice Hall, 2005. [Pap08] Papazoglou, M., Web Services: Principles and Technology. Pearson/Prentice Hall, 2008. [Zim09] Zimmermann O., An Architectural Decision Modeling Framework for SOA Design. Dissertation.de, 2009 [ZKP09] Zimmermann O., Kopp P., Pappe S., Architectural Knowledge in a SOA Infrastructure Reference Architecture, invited book chapter, in: M. Ali Babar, T. Dingsøyr, P. Lago, H. van Vliet (eds.), Software Architecture Knowledge Management: Theory and Practice, SpringerVerlag (2009) 37
Dr. Olaf Zimmermann | MDSE 2011
IBM Research – Zurich
Recommended Reading: Agile and Miscellaneous [Amb] Ambler S., articles and book references available via his blog: https://www.ibm.com/developerworks/mydeveloperworks/blogs/ambler/?lang=en [SB02] Schwaber K., Beedle M., Agile Software Development with Scrum. Prentice Hall, 2002 [RBP+91] Rumbaugh, M. Blaha, W. Premerlani, F. Eddy, and W. Lorensen. Object-Oriented Modeling and Design. Prentice Hall, 1991. [RW05] Rozanski N., Woods E., Software Systems Architecture. Addison Wesley, 2005. [Sel11] Selic B., Making Abstraction Concrete, CompArch/WICSA 2011 keynote [YRS+99] Youngs R., Redmond-Pyle D., Spaas P., and Kahan E., A Standard for Architecture Description, IBM Systems Journal, Volume 38, Number 1, 1999. Pages 32-50. IEEE Software magazine: http://www.computer.org/portal/web/software/ Software Architecture and Design at USI Lugano (link to 2011 edition) Also see the recommended reading list in lecture “enterprise-wide IT architectures” (link to 2010 edition) 38
Dr. Olaf Zimmermann | MDSE 2011