architecture in an agile world

55
Architecture in an Agile World [email protected] Don McGreal @donmcgreal linkedin.com/in/donmcgreal

Upload: don-mcgreal

Post on 20-Jun-2015

198 views

Category:

Technology


2 download

DESCRIPTION

We now acknowledge that complete upfront requirements is an impossible mission. Agile approaches have emerged as a way to manage the creation of systems that can never be completely defined and are certain to change. But what about architecture and design for these systems? How much is the right amount? How do you plan for emergent design? What is the architect's role on an agile project? Topics include: - Role of the agile architect - Agile design - Keeping change easy - Reducing technical risks - Capturing non-functional and technical requirements and constraints - Dealing with technical debt - Addressing architectural concerns within the Scrum framework - Tests – They're not just for finding bugs - Architecture anti-patterns

TRANSCRIPT

Page 1: Architecture in an Agile World

Architecture)in)an))Agile)World)

[email protected]

Don McGreal

@donmcgreal

linkedin.com/in/donmcgreal!

Page 2: Architecture in an Agile World

Agenda'

!  Agile and Architecture

!  Reducing Technical Risks

!  Team Makeup & Roles

!  Architecture Anti-Patterns

Page 3: Architecture in an Agile World

What'is'So/ware'Architecture?'

Page 4: Architecture in an Agile World

Business'Goals'

•  What business goals could affect our Architectural decisions?

Page 5: Architecture in an Agile World

Non9Func;onal'Requirements'

"   Usability'"   Scalability'"   Portability'"   Maintainability'"   Availability'"   Accessibility'"   Supportability

"   Security

"   Performance

"   Cost

"   Legal

"   Cultural

"   ...

Page 6: Architecture in an Agile World

Does'it'compare'to'building'this?'

'

•  Standard'House'

'

Page 7: Architecture in an Agile World

…'or'this?'

'

•  House???''

Page 8: Architecture in an Agile World

…'or'this?'

'

•  ???''

Page 9: Architecture in an Agile World

Level'of'Complexity'

Simple'Everything'is'known'

Complicated'More'is'known'than'unknown'

Complex'More'is'unknown'than'known'

Chao;c'Very'liNle'is'know'

Source:'Ralph'Stacey,'University'of'HerRordshire'

Page 10: Architecture in an Agile World

Empirical'vs'Defined'Processes'

Defined) Empirical)

Predict'the'Future'

Ini;al'informa;on'and'assump;ons'are'

valid'throughout'the'planning'horizon.'

'

Adapt'to'the'Future'

Frequent'inspec;on/adapta;on'rather'

than'predic;ve'planning'

'

Examples:''assembly'line,'construc;on,'accoun;ng,'

orchestra'

Examples:''sales,'marke;ng,'crea;ve'wri;ng,'band'

Plan' Do' P' D' P' D' P' D' P' D'

Page 11: Architecture in an Agile World

Team)(BA,)QA,)Dev,)etc.))creates)and)es@mates)Sprint)Backlog)(tasks)'

• Business)Case)• Financing)• Scope)&)Approach)• Contracts)• Ini@al)Release)Plan)• Assemble)Team)

Sprint)Planning) 1)day)

• Acceptance))Defined)

• Team)commits)• Tasks)created)

Product)Owner) establishes)vision)and)

priori@zes)Product)Backlog)

Sprint 1)to)4)weeks)

Releasable)Increment)

Daily)Scrum <)15)minutes)

Burn)down)

Sprint)Review 1/2)day)

Sprint)Retrospec@ve 1/2)day)

Burn)up)

velocity)

Scrum'

Page 12: Architecture in an Agile World

BigDUF'or'LiNleDUF?'Monday) Tuesday) Wednesday) Thursday) Friday)

Sprint))1)

Sprint))2)

Sprint)Planning)

Sprint)Planning)

LDUF)

PB)Grooming)

PB)Crea@on)PB)Sizing)

Release)Planning)

PB)Grooming)

Retrospec@ve)Sprint)Review)

Retrospec@ve)Sprint)Review)

Page 13: Architecture in an Agile World

Non9Func;onal'Requirements'

"   Usability'"   Scalability'"   Portability'"   Maintainability'"   Availability'"   Accessibility'"   Supportability

"   Security

"   Performance

"   Cost

"   Legal

"   Cultural

"   ...

Page 14: Architecture in an Agile World

Non9Func;onal'Requirements'

"   Usability'"   Scalability'"   Portability'"   Maintainability'"   Availability'"   Accessibility'"   Supportability

"   Security

"   Performance

"   Cost

"   Legal

"   Cultural

"   ...

Captured'as:'

'

"  Acceptance'Criteria'

"  Defini;on'of'Done'

"  User'Stories'

Page 15: Architecture in an Agile World

Sprint'Capacity'over'Time'

0'

10'

20'

30'

40'

50'

60'

70'

80'

90'

100'

Infrastructure'/'

Architecture'

Func;onality'

Page 16: Architecture in an Agile World

…'but'one'is'different'

"   Usability "   Scalability "   Portability "   Maintainability "   Availability "   Accessibility "   Supportability

"   Security

"   Performance

"   Cost

"   Legal

"   Cultural

"   ...

Page 17: Architecture in an Agile World

Most'Important'Architecture'Goal?'

•  Maintainability

Page 18: Architecture in an Agile World

Agenda'

!  Agile and Architecture

!  Reducing Technical Risks

!  Team Makeup & Roles

!  Architecture Anti-Patterns

Page 19: Architecture in an Agile World

Technical'Debt'in'an'Unhealthy'Team'

Time'available'for'

new'feature'

development'

Time'struggling'with''

complexity'and'debt'

*From'Scrum.org’s'

Professional'Scrum'Master'

cer;fica;on'course'

Page 20: Architecture in an Agile World

Yuck.'

*From'Scrum.org’s'

Professional'Scrum'Master'

cer;fica;on'course'

Page 21: Architecture in an Agile World

Stabiliza;on:'Plan'vs.'Reality'

Plan"

RC P P P D D D RC P P P D D D RC P P P D D D Release

Actual""

RC P P P D D D RC P P P D D D RC P P P D D D Release Stabilization"

*From'Scrum.org’s'

Professional'Scrum'Master'

cer;fica;on'course'

Page 22: Architecture in an Agile World

How'do'you'get'out'of'debt?'

*From'Scrum.org’s'

Professional'Scrum'Master'

cer;fica;on'course'

1. Stop'crea;ng'debt'

2. Make'a'small'payment'each'Sprint'

3. Repeat'from'2'

Page 23: Architecture in an Agile World

• Business)Case)• Financing)• Scope)&)Approach)• Contracts)• Ini@al)Release)Plan)• Assemble)Team)

Sprint)Planning) 1)day)

• Acceptance))Defined)

• Team)commits)• Tasks)created)

Product)Owner) establishes)vision)and)

priori@zes)Product)Backlog)

Sprint 1)to)4)weeks)

Releasable)Increment)

Daily)Scrum <)15)minutes)

Burn)down)

Sprint)Review 1/2)day)

Sprint)Retrospec@ve 1/2)day)

Burn)up)

velocity)

Sprint)Planning) 1)day)

• Acceptance))Defined)

• Team)commits)• Tasks)created)

Product)Owner) establishes)vision)and)

priori@zes)Product)Backlog)

Sprint 1)to)4)weeks)

Team)(BA,)QA,)Dev,)etc.))creates)and)es@mates)Sprint)Backlog)(tasks)'

Releasable)Increment)

Daily)Scrum <)15)minutes)

Sprint)Retrospec@ve 1/2)day)

Sprint)Review 1/2)day)

Done)Task?)Unit'Tested'

Code'Reviewed'

Checked9in'

others?'

'

Done)Feature?)Acceptance'Tested'

On'Test'Server'

Performance'Tested'

others?'

'

' Sprint)Review 1/2)day)

Done)Sprint?)Versioned'

In'UAT'

Integrated'

others?'

'

'

Releasable)Increment)

Done)Release?)Compliance'

Labeled'

Training'

others?'

'

'

Defini;on'of'

Done'

Page 24: Architecture in an Agile World

Paying'off'Debt'

Feature))Name) Scheduled) Ac@ve) Blocked) Closed)

'

Feature''1'

Task1.4' Task1.2'

'

Task1.3' Task1.1'

Feature''2'

'

Task2.3' Task2.1'

Task2.2'

Feature''3' Task3.3' Task3.1'

Task3.2'

Task3.4'

Page 25: Architecture in an Agile World

Paying'off'Debt'

Feature))Name) Scheduled) Ac@ve) Blocked) Closed)

'

Feature''1'

Task1.4' Task1.2'

'

Task1.3' Task1.1'

Design)Task)'

Feature''2'

'

Task2.3'

Upgrade)Task)Task2.1'

Task2.2'

ENGINEERING)&)MAINTENANCE)

Eng.)Task)1)Bug)

Eng.)Task)2) Upgrade)Task)'

Page 26: Architecture in an Agile World

Design Patterns !=

Good Design

Page 27: Architecture in an Agile World

What'is'a'PaNern?'

Page 28: Architecture in an Agile World

Design'PaNern'Structure'

Pattern Name: A descriptive and unique name that helps in identifying and referring to the pattern.""

Intent: A description of the goal behind the pattern and the reason for using it.""

Motivation (Forces): A scenario consisting of a problem and a context in which this pattern can be used.""

Structure: A graphical representation of the pattern, such as Class diagrams and Interaction diagrams.""

Consequences: A description of the results, side effects, and trade offs caused by using the pattern.""

Implementation: A description of an implementation of the pattern; the solution part of the pattern.""

Sample Code: An illustration of how the pattern can be used in a programming language""

Known Uses: Examples of real usages of the pattern.""

Related Patterns: Other patterns that have some relationship with the pattern."

Page 29: Architecture in an Agile World

Core'Aspects'of'Good'Design'

✓Good Design

✓  Low Coupling

✓  High Cohesion

Page 30: Architecture in an Agile World

Coupling'vs.'Cohesion'

Page 31: Architecture in an Agile World

Core'Aspects'of'Bad'Design'

X Bad Design

•  Duplication

•  Ambiguity

•  Complexity

Page 32: Architecture in an Agile World

Bad'Smells'

The Bloaters

The OO Abusers

The Change Preventers

The Dispensables

The Couplers

Long Method, Large Class, Data Clumps

Type Attribute, State Attribute, Indecent Exposure

Lazy Class, Dead Code, Data Class

Feature Envy, Message Chains, Middleman

Divergent Change, Shotgun Surgery, Non-localized Logic

Page 33: Architecture in an Agile World

How'do'we'get'there?'

✓Good Design ➔ X Bad

Design

Page 34: Architecture in an Agile World

Refactoring'

✓ Good Design ➔ X Bad

Design

Refactoring to / towards / away from

Design Patterns

Bad Smells

Page 35: Architecture in an Agile World

Refactoring'

✓ Good Design ➔ X

Refactoring to / towards / away from

Design Patterns

Bad Smells

Encapsulate Field!Extract Method !Generalize Type!Pull Up!Push Down!Rename Method !...!

Bad Design

Page 36: Architecture in an Agile World

Agenda'

!  Agile and Architecture

!  Reducing Technical Risks

!  Team Makeup & Roles

!  Architecture Anti-Patterns

Page 37: Architecture in an Agile World

Ver;cal'Teams'

Business

Presentation

DB Persistence

TEAM)1) TEAM)2) TEAM)3) TEAM)4)

Page 38: Architecture in an Agile World

Ver;cal'Features'

Business

Presentation

DB Persistence

TEAM)1) TEAM)2) TEAM)3) TEAM)4)

Features' Features' Features' Features'

Page 39: Architecture in an Agile World

Ideal'Team'Composi;on'VP'

QA''Manager'

QA'

QA'

QA'

Product'Manager'

Dev'

Dev'

Dev'

Dev'

Architecture'Manager'

Architect'

Architect'

Architect'

DBA''Manager'

DBA'

DBA'

Team)A)

Team)B)

Page 40: Architecture in an Agile World

Realis;c'Team'Composi;on'VP'

QA''Manager'

QA'

QA'

QA'

Product'Manager'

Dev'

Dev'

Dev'

Dev'

Architecture'Manager'

Architect'

Architect'

Architect'

DBA''Manager'

DBA'

DBA'

Team)A)

Team)B)What'

now?'

What'

now?'

Page 41: Architecture in an Agile World

Specialists ''

1.   IDEAL:'Specialists'are'dedicated'to'a'team'and'

par;cipate'throughout'the'sprint.'

'

2.   REALISTIC:'Specialists'service'mul;ple'teams'and'

par;cipate'as'needed.'

'

3.   WORST)CASE:'Specialists'do'not'par;cipate'in'a'sprint,'but'someone'on'the'team'takes'

responsibility'for'working'with'them.'

Page 42: Architecture in an Agile World

Architect'Roles'•  Enterprise'Architect''(policies'&'standards)'

•  Infrastructure'Architect''(systems'&'network'design)'

•  Solu;on'Architect''(advisory'&'governance)''

•  Applica;on'Architect''(on'teams)'

Page 43: Architecture in an Agile World

Where'to'Plug'In?'Monday) Tuesday) Wednesday) Thursday) Friday)

Sprint))1)

Sprint))2)

Sprint)Planning)

Sprint)Planning)

LDUF)

PB)Grooming)

PB)Crea@on)PB)Sizing)

Release)Planning)

PB)Grooming)

Retrospec@ve)Sprint)Review)

Retrospec@ve)Sprint)Review)

Page 44: Architecture in an Agile World

Agenda'

!  Agile and Architecture

!  Reducing Technical Risks

!  Team Makeup & Roles

!  Architecture Anti-Patterns

Page 45: Architecture in an Agile World

Logic'in'Wrong'Layer'

Think about what would need to change in other layers if one was swapped out or modified.

Business

Presentation

Persistence

Controller Façade

Integration

S h a r e d

Page 46: Architecture in an Agile World

No'Architectural'Vision'

! A single architecture vision should be well defined and communicated across the team and organization.

! The vision should map to business goals and objectives.

! All decisions should be made with this vision in mind.

Page 47: Architecture in an Agile World

Swiss'Army'Knife'

! Do not try to anticipate every possible use of the system and over-design the interfaces - this will lead to needless complexity.

! Do the simplest thing that works, within the Architectural Vision.

Page 48: Architecture in an Agile World

Threading'

Do your homework!

✓ Typically not necessary

✓ Adds massive complexity

✓ Hard to maintain, test, and debug

✓ Rely on the application frameworks threads

Page 49: Architecture in an Agile World

Caching'

Do your homework!

✓ Do you even need a cache? ✓ Can you keep everything in memory?

✓ Rely on persistence framework’s caching

Page 50: Architecture in an Agile World

Ivory'Tower'Architect'

! It is very hard to truly know the best solutions for design problems if you are not working (coding) on the project.

! It takes many iterations of a solution before it finally works - so you can’t suggest a solution then leave.

Page 51: Architecture in an Agile World

Custom'Frameworks'

! May seem like a good idea at first. But... –  Who will maintain it? –  Who will upgrade it when it’s depended upon libraries

are upgraded? Java version? –  How long will your new hires need to learn it? Who

will teach them?

! Look for an off-the-shelf solution first. –  You can hire/train people on it easier. –  It will be upgraded for you.

Page 52: Architecture in an Agile World

So, to sum up…

Page 53: Architecture in an Agile World

Emergent'Architecture'

Agile'architects'build'

plans'and'founda;ons'

that'embrace'change'

'

Today’s'technologies''

and'enterprise''

frameworks'give'us'

this'flexibility'We)just)need)to)take)advantage)of)

them.)

Page 54: Architecture in an Agile World

Thank You!

[email protected]

Don McGreal

@donmcgreal

linkedin.com/in/donmcgreal!

Page 55: Architecture in an Agile World

Questions?

[email protected]

Don McGreal

@donmcgreal

linkedin.com/in/donmcgreal!