software architecture for developers by simon brown

86
Follow me on Twitter @simonbrown Simon Brown Software architecture for developers

Upload: codemotion

Post on 10-May-2015

2.566 views

Category:

Technology


5 download

DESCRIPTION

The agile and software craftsmanship movements are pushing up the quality of the software systems we build, but there’s more we can do because even a small amount of software architecture can prevent many of the problems that projects still face, particularly if the team seems to be more chaotic than they are self-organising. Successful software projects aren’t just about good code and sometimes you need to step away from the IDE for a few moments to see the bigger picture. This session is about that bigger picture, software architecture, technical leadership and the balance with agility.

TRANSCRIPT

Page 1: Software architecture for developers by Simon Brown

Follow me on Twitter @simonbrown

Simon Brown

Software architecture for developers

Page 2: Software architecture for developers by Simon Brown

I help software teams understand

software architecture,

technical leadership and

the balance with agility(I code too)

Training Book Speaking

Buy the book for $10

YI85bLbAXGks(expires 30th March 2013)

Page 3: Software architecture for developers by Simon Brown

[email protected]

@simonbrown on Twitter

Jersey, Channel Islands

Page 4: Software architecture for developers by Simon Brown

What is software architecture?

Page 5: Software architecture for developers by Simon Brown

What is architecture?As a noun...

StructureThe definition of something in terms

of its components and interactions As a verb...

VisionThe process of architecting,

making (significant) design decisions, etc

and

Page 6: Software architecture for developers by Simon Brown

Grady Boochhttp://www.handbookofsoftwarearchitecture.com/index.jsp?page=Blog&part=2006

What is design?

Architecture represents the

significant decisions,where significance is measured

by cost of change.

Can you refactorit in an aftern

oon?

Page 7: Software architecture for developers by Simon Brown

Chaos!Does the team understand what they are building and how they are building it?

Page 8: Software architecture for developers by Simon Brown

Chaos!Does the team understand what they are building and how they are building it?

No defined structure, inconsistent approaches,

big ball of mud,spaghetti code, ...

STOPSlow, insecure, unstable, unmaintainable,

hard to deploy, hard to change, over time, over budget, ...

Page 9: Software architecture for developers by Simon Brown

Shared vision of

TL; DRSoftware

ArchitectureDocument

Page 10: Software architecture for developers by Simon Brown

Shared vision of

WTF?!

Page 11: Software architecture for developers by Simon Brown

The software

architecture role

Page 12: Software architecture for developers by Simon Brown

The software architecture role is

differentto the lead developer role

It’s an inward and

outward facing role

Page 13: Software architecture for developers by Simon Brown

It’s about the

big picture

Page 14: Software architecture for developers by Simon Brown

Abstract Specific

As software developers, the

codeis usually our main focus

Lines of codeClasses, functionsDesign patterns

Unit testsRefactoring

Page 15: Software architecture for developers by Simon Brown

Abstract Specific

Sometimes you need to

step back

from the IDE

Lines of codeClasses, functionsDesign patterns

Unit testsRefactoring

Page 16: Software architecture for developers by Simon Brown

The low-level detailis equally important

Don’t code 100% of

the time though!

Page 17: Software architecture for developers by Simon Brown

Would we

codeit that way?

Page 18: Software architecture for developers by Simon Brown

All decisionsinvolve a

trade-off

Page 19: Software architecture for developers by Simon Brown

Should software architects write

codeon software projects?

Ideally yes, but...

Page 20: Software architecture for developers by Simon Brown

Software architectsmust be

master builders

And coding is a great way

to retain this skill Plus it reduces many of the problems associated withivory tower architecture

Page 21: Software architecture for developers by Simon Brown

DepthDeep hands-on technology

skills and knowledge

BreadthBroad knowledge ofpatterns, designs,

approaches, technologies,non-functional requirements,different ways of working, etc

...options and trade-offs

Generalising

Spec

ialis

t

Page 22: Software architecture for developers by Simon Brown

Every software development team

needs amaster builder

1 or many

Page 23: Software architecture for developers by Simon Brown

Software architecture is about

technicaland

soft skills

Page 24: Software architecture for developers by Simon Brown

Software Architect

Leadership

Communication

Influencing

Negotiation

Collaboration

Coaching and Mentoring

Motivation

Facilitation

Political

Page 25: Software architecture for developers by Simon Brown

The irresponsible architect

Cross-site scripting attacks possible; weak passwords allowed; HTTP sessions

didn’t timeout; ...

Basic functionality errors; little or no quality

assurance; rework required late in the project because

of assumptions; ...

Even on“strategic platform”

projects :-o

No non-functional testing (e.g. penetration testing or

load testing); ...

No documentation; ...

Page 26: Software architecture for developers by Simon Brown

The software architecture role

ArchitecturalDrivers

Understanding requirements and constraints

ArchitectureEvolution

Ownership of the architecture throughout the delivery

Coaching and

MentoringGuidance and assistance

Quality Assurance

Introduction and adherenceto standards and principles

CodingInvolvement in the hands-on

elements of software delivery

TechnologySelection

Choosing and evaluating technology

ArchitectingDesigning software

ArchitectureEvaluation

Understanding that the architecture works

Page 27: Software architecture for developers by Simon Brown

Software architecture introduces

control?

Page 28: Software architecture for developers by Simon Brown

Chaos!Does the team understand what they are building and how they are building it?

Let’s agreeon some things

Let’s make the implicit,

explicitPut some boundariesand guidelines in place

Page 29: Software architecture for developers by Simon Brown

Software Architect

Software Developers

ControlGuidelines, consistency,

discipline, rigour, boundaries,...

Feedback“I don’t understand why...”

“How should we...”“I don’t like the way that...”

Page 30: Software architecture for developers by Simon Brown

Developer Developer Developer Developer Developer

Gap

Architect

Sits in an ivory tower

Focusses on thelow level detail

Page 31: Software architecture for developers by Simon Brown

Collaborating and sharing

Architecturally aware

Software Architect

Software Developer

Reduced gap

Avoid ivory towers by

collaborating andbeing engaged

Do this well and everybody becomes an architect :-)

Page 32: Software architecture for developers by Simon Brown

Designing software

Page 33: Software architecture for developers by Simon Brown

1. Current Situation

We have an existing Internet Banking offering that allows customers to securely view

information about their bank accounts held with us via the web. Although we were one of the

first to market with such a product, the system itself is a number of years old now and a series

of problems has been identified during a consulting exercise that we recently initiated. In

summary:

• The system only provides customers with read-only access to information about their

bank accounts. This includes account balances, recent transactions and recent

statements.

• The information presented to customers is slightly out-of-date, because information from

the core banking system is exported to the website on a nightly basis.

• Transactional requests are not possible through the site, with customers instead sending

a secure message to the call centre with their request instead. This process is open to

abuse and fraud.

• The number of features supported by the offering is limited.

• The technology is no longer seen as “leading edge”, is hard to enhance and costly to

maintain. In addition, the technology has reached “end of life” and is no longer

proactively supported by the vendor.

• The system doesn’t meet current website accessibility standards.

In a recent survey, our Internet Banking system was perceived as poor in terms of the user

experience and the level of information available through the website. With our competitors

now offering fully transactional systems, there is a risk that we will lose business.

2. Vision

The board have given us the go-ahead to initiate a project to replace the current Internet

Banking system, which will need to coincide with the corporate rebranding that will be taking

place in 12 weeks. The replacement system should:

• Provide customers with real-time access to information about their bank accounts.

• Provide customers with the ability to perform common transactions through the website.

This includes making payments, setting up standing orders, transferring money and so on.

• Provide customers with a rich user experience.

• Meet current website accessibility standards.

• Be developed using the new corporate website design guidelines.

Big Bank plcInternet Banking System

Options

Func

tiona

l & n

on-

func

tiona

l req

uire

men

ts

Prin

cipl

es

Cons

trai

nts

Page 34: Software architecture for developers by Simon Brown

(003) As a business customer, I

want to login so that

I can manage

my bank accounts online

.

Priority: Must

(009) As a personal customer I want to download statements for the last three months.Priority: Must

Understanding the functional requirements is

obvious but forgotten

(003) As a business customer, I

want to login so that

I can manage

my bank accounts online

.

Priority: Must

(009) As a personal customer I want to download statements for the last three months.Priority: Must

Page 35: Software architecture for developers by Simon Brown

PerformanceScalabilityAvailabilitySecurityDisaster RecoveryAccessibilityMonitoringManagementAudit...

FlexibilityExtensibilityMaintainabilityInteroperabilityLegalRegulatoryCompliancei18nL10n...

✓✓

✓✓

Know which are

important to you

Quality Attributes

Page 36: Software architecture for developers by Simon Brown

Learn about and understand the(often complex) quality attributes

in order to build

sufficient foundations

Page 37: Software architecture for developers by Simon Brown

Software lives in the real world,and the real world has

constraintsConstra

ints are usually

forced upon yo

u

Page 38: Software architecture for developers by Simon Brown

Understand what the constraints are, who imposed them,

why they are being imposed and

how they affect the architecture

Given total fre

edom the

work is likely t

o sprawl.

T.S.Eliot

Page 39: Software architecture for developers by Simon Brown

Principlesare the things

you want to adopt

They help to in

troduce

consistency a

nd clarity

Page 40: Software architecture for developers by Simon Brown

Principles are good, but make sure

they’re realisticand don’t have a

negative impact

Page 41: Software architecture for developers by Simon Brown

1. Current Situation

We have an existing Internet Banking offering that allows customers to securely view

information about their bank accounts held with us via the web. Although we were one of the

first to market with such a product, the system itself is a number of years old now and a series

of problems has been identified during a consulting exercise that we recently initiated. In

summary:

• The system only provides customers with read-only access to information about their

bank accounts. This includes account balances, recent transactions and recent

statements.

• The information presented to customers is slightly out-of-date, because information from

the core banking system is exported to the website on a nightly basis.

• Transactional requests are not possible through the site, with customers instead sending

a secure message to the call centre with their request instead. This process is open to

abuse and fraud.

• The number of features supported by the offering is limited.

• The technology is no longer seen as “leading edge”, is hard to enhance and costly to

maintain. In addition, the technology has reached “end of life” and is no longer

proactively supported by the vendor.

• The system doesn’t meet current website accessibility standards.

In a recent survey, our Internet Banking system was perceived as poor in terms of the user

experience and the level of information available through the website. With our competitors

now offering fully transactional systems, there is a risk that we will lose business.

2. Vision

The board have given us the go-ahead to initiate a project to replace the current Internet

Banking system, which will need to coincide with the corporate rebranding that will be taking

place in 12 weeks. The replacement system should:

• Provide customers with real-time access to information about their bank accounts.

• Provide customers with the ability to perform common transactions through the website.

This includes making payments, setting up standing orders, transferring money and so on.

• Provide customers with a rich user experience.

• Meet current website accessibility standards.

• Be developed using the new corporate website design guidelines.

Big Bank plcInternet Banking System

Options

Func

tiona

l & n

on-

func

tiona

l req

uire

men

ts

Prin

cipl

es

Cons

trai

nts

Page 42: Software architecture for developers by Simon Brown

Start analysingor start coding?

“Analysis paralysis” &

“refactor distractor”

are both bad

Page 43: Software architecture for developers by Simon Brown

Boxes & lines

Thing

Other ThingImportant line

Page 44: Software architecture for developers by Simon Brown

Visualising software

Page 45: Software architecture for developers by Simon Brown

UML tool?

Whiteboard or flip chart?

You don’t need a UML

tool to do architecture

but agree on notation

Page 46: Software architecture for developers by Simon Brown

Collaborative design(e.g. pair architecting)

Page 47: Software architecture for developers by Simon Brown

NoUMLdiagrams?

Page 48: Software architecture for developers by Simon Brown

We can visualise our process...

...but not our software!

Page 49: Software architecture for developers by Simon Brown

Moving fast (agility) requires

good communication

Page 50: Software architecture for developers by Simon Brown

System

Container

Container

Container

Component

Component

Component

Class

Class Class

Class

Page 51: Software architecture for developers by Simon Brown

1. Context 2. Containers 3. Components

Thinking inside the box

... and, optionally,4. ClassesC4

ContextContainersComponentsClasses

This only coversthe static structure(runtime, infrastructure,

deployment, etc are also important)

Page 52: Software architecture for developers by Simon Brown

This isn’t aboutcreating a standard

It’s about providing you

some organisational ideas

Page 53: Software architecture for developers by Simon Brown

Context• What are we building?• Who is using it? (users, actors, roles, personas, etc)• How does it fit into the existing IT environment?

Page 54: Software architecture for developers by Simon Brown

• What are the high-level technology decisions?• How do containers communicate with one another?• As a developer, where do I need to write code?Containers

Page 55: Software architecture for developers by Simon Brown

Components• What components/services is the system made up of?• Is it clear how the system works at a high-level?• Do all components have a home (a container)?

Page 56: Software architecture for developers by Simon Brown

Some tips for

effective sketches

TitlesShort and meaningful, numbered if

diagram order is important

LinesMake line style and arrows explicit, add annotations to lines to provide

additional information

LayoutSticky notes and index cards make a

great substitute for drawn boxes, especially early on

LabelsBe wary of using acronyms

ColourEnsure that colour coding

is made explicit

OrientationUsers at the top and database at the bottom? Or perhaps “upside-down”?

ShapesDon’t assume that people will

understand what different shapesare being used for

BordersUse borders to provide emphasis

or group related items,but ensure people know why

KeysExplain shapes, lines, colours,

borders, acronyms, etc

ResponsibilitiesAdding responsibilities to boxes can provide a nice “at a glance” view

(Miller’s Law; 7±2)

Page 57: Software architecture for developers by Simon Brown

Effective sketchesare an excellent way to

communicatesoftware architecture

During the design process

and retrospectively

Page 58: Software architecture for developers by Simon Brown

Documenting software

Page 59: Software architecture for developers by Simon Brown

“ ”Working software

over

comprehensive documentation

This doesn’t mean“don’t do any

documentation”!

Manifesto for Agile Software Development, 2001

Page 60: Software architecture for developers by Simon Brown

The code doesn’t tell the *whole* story,

but it does *a* story

Page 61: Software architecture for developers by Simon Brown

Tribal knowledge

“just talk!”“diagrams and documents

are just propsfor conversations”

Page 62: Software architecture for developers by Simon Brown

The bus factor(it’s not just about buses though!)

Any idea how X works?

No idea whatyou’re on about...

#fail

Page 63: Software architecture for developers by Simon Brown

Your system

Current Development Team

Database Administrators

Business Sponsors

Operations/Support Staff

Compliance and AuditSecurity TeamOther Teams

Future Development Team

Software architecture

is a platform for

conversation ... be social!

Page 64: Software architecture for developers by Simon Brown

SoftwareArchitectureDocument

Guidebook

Maps

Sights and

itineraries

History and

culture

Practical Information

Page 65: Software architecture for developers by Simon Brown

Functional Overview

What does the system do?

Quality Attributes

Are there any significantnon-functional requirements?

ConstraintsAre there any significant

constraints?

PrinciplesWhat design and

development principles have been adopted?

Software Architecture

What does the big picturelook like and how is the

system structured?

Infrastructure ArchitectureWhat does the target

deploymentenvironment look like?

DeploymentWhat is the mapping

between software and infrastructure?

Operation& Support

How will people operateand support the system?

ContextWhat is this all about?

External Interfaces

What are the external system interfaces?

CodeAre there any

implementation detailsyou need to explain?

DataWhat does the data model look like and where is it

being stored?

Page 66: Software architecture for developers by Simon Brown

Documentation should

describe whatthe code doesn’t

Reduce waste,

add valueUse it to explain intent and act as a guide to navigate

the source code

Page 67: Software architecture for developers by Simon Brown

How much of the document is

up to date and relevant?

Page 68: Software architecture for developers by Simon Brown

Software architecture in the

development lifecycle

Page 69: Software architecture for developers by Simon Brown

AaaS ... architecture as a service

Software development is not a

relay sportSoftware

ArchitectureDocument

Page 70: Software architecture for developers by Simon Brown

The software architecture role should be engaged

throughout(not just analysis and design)

Page 71: Software architecture for developers by Simon Brown

How much up front design should you do?

Big design up front?

Emergent design?(or none, depending on

your viewpoint!)

Something in between?

Waterfall

Page 72: Software architecture for developers by Simon Brown

You should do

“just enough”

Page 73: Software architecture for developers by Simon Brown

Base your architecture on requirements, travel light

and prove your architecture with concrete experiments.

Base your architecture on requirements, travel light

and prove your architecture with concrete experiments.

Base your architecture on requirements, travel light

and prove your architecture with concrete experiments.

Scott Amblerhttp://www.agilemodeling.com/essays/agileArchitecture.htm

Page 74: Software architecture for developers by Simon Brown

What is architecturally

significant?

Costly to change(can you refactor it

in an afternoon?)

Complex

New

Page 75: Software architecture for developers by Simon Brown

You need to

identify and mitigate

your highest priority

risksThings that will cause

your project to fail

or you to be fired!

Page 76: Software architecture for developers by Simon Brown

ProbabilityIm

pact

Low (1) Medium (2) High (3)

Low

(1)

Med

ium (

2)High

(3)

1 2

2 4

3

3 6

6

9

Page 77: Software architecture for developers by Simon Brown

Who looks after the riskson most software projects?

A (usually) non-technical project manager!

Page 78: Software architecture for developers by Simon Brown

Risk-storming

A collaborative and visual technique for identifying risk

Page 79: Software architecture for developers by Simon Brown

You still need todeal with the risks

(mitigation strategies include hiring people,undertaking proof of concept

and changing your architecture)

Page 80: Software architecture for developers by Simon Brown

How much up front design should you do?

“Just enough”

Understand how the significant elements

fit together

Identify and mitigate

the key risks Provide firm foundations and a vision

to move forward

Page 81: Software architecture for developers by Simon Brown

The software architecture role and

the process of software architecting are

different

Page 82: Software architecture for developers by Simon Brown

From chaos to self-organising

Dedicatedsoftware architect

Single point of responsibility for the technical aspects of the

software project

Everybody is asoftware architect

Joint responsibility for the technical aspects of the

software project

The software architecture role

Elastic Leadership (Roy Osherove)

Survival (command and control),

learning (coaching),

self-organising (facilitation)

Page 83: Software architecture for developers by Simon Brown

SoftwareArchitecture

DocumentFrom big design up front to evolutionary

The process of software architecting

Big up front design

Requirements capture, analysis and design complete before

coding starts

Evolutionary architecture

The architecture evolves secondary to the value created

by early regular releases of working software

/// <summary>/// Represents the behaviour behind the .../// </summary>public class SomeWizard : AbstractWizard{ private DomainObject _object; private WizardPage _page; private WizardController _controller;

public SomeWizard() { }

...

}

Page 84: Software architecture for developers by Simon Brown

/// <summary>/// Represents the behaviour behind the .../// </summary>public class SomeWizard : AbstractWizard{ private DomainObject _object; private WizardPage _page; private WizardController _controller;

public SomeWizard() { }

...

}

21st century software architecture

“just enough”

The role

The process

Understand how the significant elements

fit togetherIdentify and mitigate

the key risks

Provide firm foundations and a visionto move forward

SoftwareArchitectureDocument

Page 85: Software architecture for developers by Simon Brown

youDo whatever works for

Page 86: Software architecture for developers by Simon Brown

Buy the book for $10

YI85bLbAXGks(expires 30th March 2013)