software architecture - kpi.fei.tuke.sk · be a big boss … in fact do many things by yourself....

63
Software Architecture Theory and Practice Radovan Semančík April 2018

Upload: truongdieu

Post on 16-May-2018

220 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Software ArchitectureTheory and Practice

Radovan SemančíkApril 2018

Page 2: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Who Am I?

Ing. Radovan Semančík, PhD.

Software Architect at Evolveum

Architect of Evolveum midPoint

Apache Foundation committer

Contributor to ConnId and Apache Directory API

Page 3: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Poll

Who wants to be:1. Coder/developer

2. Software designer/architect

3. Manager

Page 4: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

So, you wanna bean architect?

Page 5: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

What Does Software Architect Do?Theory

● Draw diagrams (UML anyone?)

● Design great and important systems

● Be a big boss

Page 6: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

What Does Software Architect Do?Practice

● Draw diagrams (UML anyone?)

… implement it too. And test. And document.

● Design great and important systems

… more like databases and JavaScript.

● Be a big boss

… in fact do many things by yourself.

Page 7: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

architectureThe art or science of building; especially, the art of building houses, churches, bridges, and other structures, for the purposes of civil life; -- often called civil architecture.Construction, in a more general sense; frame or structure; workmanship.

Webster, 1913

Page 8: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

How it all works in practice ...

Page 9: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

What Client Wanted

Page 10: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

What Client Described

Page 11: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

How Architect Understood

Page 12: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Empty Set of Constraints

Page 13: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Adding Constraints

Page 14: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Adding Constraints

Page 15: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Architecture Finished

Page 16: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Architecture Documented

Page 17: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Start of Development

Page 18: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Development

Page 19: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Architectural Issue Discovered

Page 20: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Development

Page 21: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Development Finished

Page 22: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Delivery

Page 23: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Morphing the System

Desired Described Designed Deployed

Page 24: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

We could do better than that

… in theory

Page 25: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Waterfall Model

Analysis

Design

Implementation

Operation

Validation

Very popular softwaredevelopment model

Page 26: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Waterfall Model

Analysis

Design

Implementation

Operation

Validation

DOES NOT WORK

Page 27: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Waterfall Model

Analysis

Design

Implementation

Operation

Validation

DOES NOT WORK

DO NOT USE

Hic sunt liones

Beware of the Leopard

High voltage!

Danger!!!

Page 28: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Iterative Development

● Feedback• Use knowledge gained in previous iteration

Analysis

Design

Implementation

Operation

Deployment

Termination

Iteration

Validation

Page 29: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Development Methods Summary

Predictive Adaptive

CostUncertainty of Result

Suitability of ResultLimitations

WaterfallIterative

Iterative

Agile

Page 30: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

We could do better… even in practice

Page 31: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Iterations and Increments

Page 32: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Software Developement… in practice

● Do not try to design/implement everything• Waterfall does not work!

● Iterations and increments• But you need to have some idea about the desired result

● Beware the limitations• One size does not fit all

• Agile does not always work

• Golden hammer (anti-pattern)

Vision

Page 33: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Architecture and design

… in theory

Page 34: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Model

Simplified

= imprecise

Overview

= better “handling”

Page 35: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

UML

Page 36: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Architecture and design

… in practice

Page 37: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Models

● Models in pure form (e.g. pure UML)• Limited usefulness

• Fighting with tools instead of making progress

● Hybrid (customized) models• Very useful, especially in early phases

• Difficult to maintain

● Free-form diagrams• Whiteboard – absolutely necessary

• Brainstorming, early “validation”

Page 38: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Informal Architecture Diagram(Technical marketing)

HR

Workflow

Domain

Database Applications

ERPLegacySystem

Agent

Identity ManagementSystem

LDAP

SOAPSQL

Page 39: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Formal Architecture Diagram(I have UML and I’m not afraid to use it)

Page 40: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Informal Component Diagram(Whiteboard 2.0)

User InterfaceUser Interface

Business Logic

IDM Model

RepositoryProvisioning

AdministratorsUsers

Resources

Page 41: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Marketing-Oriented Diagram(Boxes and more boxes)

Infrastructure

RepositoryProvisioning

Connectors

IDM Model

User InterfaceCustom Business Logic

Custom User Interface

If you ever see this: run away!

Page 42: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

System Decomposition

Page 43: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Modular and Component Structure

Page 44: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Component Interactions

Page 45: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Component Interactions

Page 46: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Component Interactions

Page 47: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Data Structures

Page 48: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Complex Data Structures

● Hard to maintain● Data schema● Generate?

Page 49: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Architecture Model Summary● Operates with concepts

• May or may not map to final components, interfaces, ...

● Difficult to align with implementation• ... and not efficient to reach 100% alignment

• The model should be guideline, not dogma

● Model ≠ Architecture• Architecture is much more:

• Textual descriptions, explanations, description of concepts

• Motivations, design decisions, trade-offs, future expectations

• Beware of tools that promise to simplify that

WARNING

Page 50: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Architectural Principles

● Separation of concerns

● Dependency inversion principle

● Acyclic dependencies principle

● Stable abstractions principle

● Stable dependencies principle

● Open-closed principle

● Single responsibility principle

● Interface segregation principle

● …

Those are (very) useful

Page 51: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

When architecture goes wrong …

Page 52: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Fallacies, Antipatterns, Rot & Smell

● Fallacies of distributed computing• Network is reliable, Latency is zero, Bandwidth is infinite, ...

● Architectural antipatterns• Big ball of mud, Design by committee, Not invented here, ...

● Symptoms of rotting design• Rigidity, Fragility, Immobility, Viscosity

● Code smell• Duplicated code, Contrived complexity, Feature envy, ...

Page 53: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Common Problems● Too little analysis / design

• Especially in agile and open source

● Too much architecture (“stratospheric architecture”)

• Pretty concepts that never get implemented

● No environment analysis

● Unmaintained architecture• Architect did his work at beginning of the project

… and then left

• Architecture is a mutable thing! Needs constant maintenance.

Page 54: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Iron Triangle

Fast Cheap

Good

Quality

Schedule Cost

Scope

Pick any two ... ... the third will follow

At least one corner must bevariable, otherwise qualitywill suffer

Page 55: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Moving Target

Fast Cheap

Good

● Requirements are incomplete and changing

● Environment is changing

=> software must change

● Architecture must be able to adapt

● Expect that you will have to make changes

● Do not forget about Iron Triangle

Page 56: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Buzzword-Oriented Architecture

● Very common approach

● Huge problem

● Solution: known what you are doing• Understand the technology before committing to it

● History repeating• Basic principles do not change often

Page 57: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

History Repeating

● 1976: RFC 707

● 1981: Xerox Courier

● 1991: CORBA

● 1993: DCE/RPC → DCOM

● 1995: SunRPC

● 1998: SOAP

● 200x: “RESTful” API

Page 58: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

What we can do?

Page 59: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Form follows purpose

Page 60: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Form Follows Purpose

versus

Page 61: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Pragmatic Approach

● Focus on the effects of the architecture• Emphasize the aspects that can help achieve results

• Ignore aspects that does not influence result

● Common sense, simplicity

● Continuous change

● Skepticism• Continual testing, systematic doubt

• True knowledge is uncertain

Page 62: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Questions and Answers

Page 63: Software Architecture - kpi.fei.tuke.sk · Be a big boss … in fact do many things by yourself. architecture The art or science of building; especially, the art of ... 1993: DCE/RPC

Radovan Semančík

www.evolveum.com

Thank You