107
Agile Architecture XP Days 2012 Johannes Brodwall, Chief scientist Exilesoft Global

Agile Architecture

  • Upload
    jalen

  • View
    38

  • Download
    0

Embed Size (px)

DESCRIPTION

Agile Architecture. XP Days 2012 Johannes Brodwall, Chief scientist Exilesoft Global. What is an architect? From greek Arkhi-Tecton Tecton : Builder Arkhi : Chief. Like “Arch angel” Or “Arch villain”. What is an architect? “Chief builder”. What is an architect? - PowerPoint PPT Presentation

Citation preview

Page 1: Agile Architecture

Agile Architecture

XP Days 2012Johannes Brodwall, Chief scientist

Exilesoft Global

Page 2: Agile Architecture

What is an architect?From greek Arkhi-Tecton

Tecton: BuilderArkhi: Chief.

Like “Arch angel”Or “Arch villain”

Page 3: Agile Architecture

What is an architect?“Chief builder”

Page 4: Agile Architecture

What is an architect?(Exilesoft definition)

Page 5: Agile Architecture

A solution architect is someone who understands the problem of

the customerand uncovers and communicates

a feasible solution

Page 6: Agile Architecture

A solution architect is someone who understands the customer’s problem

(including contraints, context, domain knowledge) and uncovers (though a

team effort) and communicates (with credibility) a feasible solution

(primarily, but not exclusively technical)

Page 7: Agile Architecture

Uncover problemvision, stakeholders, usage flow

Describe problemcontext and domain model

Describe solutiondeployment, implementation

model

Page 8: Agile Architecture

• Describing architecture• Simplifying architecture• Delivering architecture

• Delivering software

• Delivering architecture

Page 9: Agile Architecture

Part I:

Page 10: Agile Architecture

Describing architecture

Page 11: Agile Architecture

• Understanding problem• Uncovering solution

• Communicating architecture

Page 12: Agile Architecture

Understanding the problem

Page 13: Agile Architecture

(Tool time)

Page 14: Agile Architecture

For some stakeholderWho has a responsibility

The Bare-bones architecture workshopIs a type of activity

Which gives a capability.

Unlike most relevant alternativeThis has a distinguishing attribute.

Page 15: Agile Architecture

For __________________Who ________________The _________________Is a _________________

Which ________________.

Unlike ______________________This _______________________.

Page 16: Agile Architecture

Participant?

Who are they?

What do they do?

Why do they care?

???

Description

Duties

Values

???Description

Duties

Values

Page 17: Agile Architecture

Example«Smidig» conference application

Page 18: Agile Architecture
Page 19: Agile Architecture

Example vision statement

Page 20: Agile Architecture

For Agile practitionersWho need to expand on their experience and

networkThe Smidig conference

Is a networking eventWhich connects you with other Agile practitioners.

Unlike traditional conferencesThis presents the experience of many people

through lightning talks.

Page 21: Agile Architecture

For Conference organizersWho want to organize a good conference

The Smidig conference appIs a web application

Which eliminates unnecessary work.

Unlike commercial conference appsThis is optimized for the large number of talks we have and allows us to make changes fast.

Page 22: Agile Architecture
Page 23: Agile Architecture

Example stakeholders

Page 24: Agile Architecture

Speaker

Description• Experienced• New speaker• PassionateDuties• Register talk• Upload slide• Give talkValues• Constructive feedback

on talk• Easy CfP• Fast answer

AttendeeDescription• Knows about agile• Works in project• NorwegianDuties• Pay for conference• Get approval to go

Values• Easy registration

OrganizerDescription• Volunteer• Works in evenings• Has networkDuties• Select talks• Follow up

paymentsValues• Easy selection process• Good information overview• Never lose a participant• Financial transparency

Page 25: Agile Architecture

Sponsor

Description• Busy• Manager• Not very interested

Duties• Provide logo• Pay sponsorship

Values• Informal

communication• Easy evaluation

Page 26: Agile Architecture

Example usage flow

Page 27: Agile Architecture

Attendance

1. Agile project practitioner wants to learn2. Attendee goes to Smidig website3. Attendee registers4. Attendee pays using Paypal5. Attendee receives confirmation mail6. Organizer can see the registration7. Organizer sends reminder email to attendee to come8. Organizer prints badges for attendees with Print

Company9. Attendee shows up at Smidig and has an excellent

time

Page 28: Agile Architecture
Page 29: Agile Architecture

Speaker

1. Agile experts wants to share knowledge2. Potential speaker goes to Smidig website3. Potential speaker registers personal info4. Potential speaker registers talk5. Potential speaker receives registration confirmation email6. Organizer sees registered talk and can market speaking

opportunities7. Organizer accepts talk for confence8. Speaker receives acceptance email

– Alternative: Speaker withdraws talk – organizer updates the talk and selects another

9. Organizer prints badges for speakers10. Speaker shows up at Smidig and gives talk

Page 30: Agile Architecture

/Understanding the problem

Page 31: Agile Architecture

Uncovering a solution

Page 32: Agile Architecture

Example context model

Page 33: Agile Architecture

Smidig2011.no

Participant Speaker

Organizer

Printing company

Paypal

Page 34: Agile Architecture

Example domain model

Page 35: Agile Architecture

User• Name• Email• Company• Phone• Password• Accepts email?

Registration• Ticket type• Price• Paid amount• Paypal ref• Payment date• Invoice address [optional]

Talk• Title• Description• Tags[]• Slide file• Status : {pending, accept,

reject}• Email_sent• Position

Speaker*

*

Comment• Title• Text• Created date

*

*

Period• Stage• Title• Time of day• Day

*

Page 36: Agile Architecture

Example deployment model

Page 37: Agile Architecture

HerokuSmtp.dreamhost.com

Paypal

PostgreSQL

Smidig-conference

(Rails)

Web user

Developer

smidigdb

git.herokugithub

git pushgit pushgit pull

html/http

http

smtp

Page 38: Agile Architecture

Example implementation

diagram

Page 39: Agile Architecture

Router

Controller

1. Find controller

2. Dispatch action

Model class3. Find model

Model4. Manipulate model

5.? Save model

Database

View template View template

6. Render model with view template

Page 40: Agile Architecture

Router

/app/controllersUsersController

1. Find UserController

2. update(id)

/app/modelsUser class

3. find(id)

app/modelsUser

5. update_attr(params)

6. save

Database

8. Redirect /users/<id>

POST /users/<id>

4. SELECT … FROM users

7. UPDATE users SET …

Page 41: Agile Architecture

Router

/app/controllersUsersController

1. Find UsersController

2. show(id)

/app/modelsUser class

3. find(id)

UserDatabase

/app/views/usersshow.html.erb

5. Render

GET /users/<id>

4. SELECT … FROM users

6. Get attributes

Page 42: Agile Architecture

Alternative

Page 43: Agile Architecture

Browser Smidig2012.no Paypal.com

1. POST /users

2. Redirect to paypalwith return_url and notify_url

3. Perform payment

4. POST /payment_notifications

5. Redirect to return_url

5. GET /user/<id>

Update user info

Show user info

Save user info

Page 44: Agile Architecture

/Uncovering a solution

Page 45: Agile Architecture

Communicating a solution

Page 46: Agile Architecture
Page 47: Agile Architecture

VisionStakeholders

Usage flowContext

Domain modelDeployment

Implementation

Page 48: Agile Architecture

Does the architect have to do this

herself?

Page 49: Agile Architecture

Team effort

Page 50: Agile Architecture
Page 51: Agile Architecture

/Communicating a solution

Page 52: Agile Architecture

/Describing architecture

Page 53: Agile Architecture

Part II:

Page 54: Agile Architecture

Finding the requirements

Page 55: Agile Architecture

I need a volunteer

Page 56: Agile Architecture

For some stakeholderWho has a responsibilty

The system nameIs a type of system

Which gives a capability.

Unlike most relevant alternativeThis has a distinguishing attribute.

Page 57: Agile Architecture

Participant?

Who are they?

What do they do?

What do they care about?

???

Description

Duties

Values

???Description

Duties

Values

Page 58: Agile Architecture

….

1. Something happens in the real world2. The event is communicated to the system3. The system does something4. Someone does something with the system5. …6. …7. …8. …9. …10. Some goal is achieved

Page 59: Agile Architecture

/Finding requirements

Page 60: Agile Architecture

Part III:

Page 61: Agile Architecture

Describe architecture

Page 62: Agile Architecture

Frugalflights.com1. A customer wants cheap vacations2. The customer signs up for daily or weekly notifications of special flight

offers3. Periodically the System checks which customers should get notifications4. The System checks for offers that matches the customer’s travel

preference by looking up flights with the travel provider system5. The System notifies customer of any matching offers via SMS

• Variation: The System notifies customer of any matching offers via email6. The customer accepts the offer via SMS

1. Variation: The customer accepts the offer on the system website7. The System books the tickets on behalf of the customer8. The system confirms the booking by sending an SMS to the customer9. The customer can at any point see their active offers and accepted

offers on the system website10. The customer enjoys a cheap vacation!

Page 63: Agile Architecture

UserWho are they• …What do they do?• …What do they value?• …

UserWho are they• …What do they do?• …What do they value?• …

UserWho are they• …What do they do?• …What do they value?• …

UserWho are they• …What do they do?• …What do they value?• …

Page 64: Agile Architecture

Example context model

Page 65: Agile Architecture

What actors did you mention in scenario?

Page 66: Agile Architecture

Context: Frugalflights.com1. A customer wants cheap vacations2. The customer signs up for daily or weekly notifications of special flight

offers (where?)3. Periodically the System checks which customers should get

notifications4. The System checks for offers that matches the customer’s travel

preference by looking up flights with the travel provider system5. The System notifies customer of any matching offers via SMS

• Variation: The System notifies customer of any matching offers via email6. The customer accepts the offer via SMS

1. Variation: The customer accepts the offer on the system website7. The System books the tickets on behalf of the customer (where?)8. The system confirms the booking by sending an SMS to the customer9. The customer can at any point see their active offers and accepted

offers on the system website10. The customer enjoys a cheap vacation!

Page 67: Agile Architecture

Domain: Frugalflights.com1. A customer wants cheap vacations2. The customer signs up (?) for daily or weekly notifications of special

flight offers (=> “create a subscription”?)3. Periodically the System checks which customers should get notifications4. The System checks for offers that matches the customer’s travel

preference by looking up flights with the travel provider system5. The System notifies customer of any matching offers via SMS (=>

“sends notification”?)• Variation: The System notifies customer of any matching offers via email

6. The customer accepts the offer via SMS (=> “send acceptance”)1. Variation: The customer accepts the offer on the system website

7. The System books the tickets on behalf of the customer8. The system confirms the booking by sending an SMS to the customer

(=> “sends confirmation”?)9. The customer can at any point see their active offers and accepted

offers on the system website10. The customer enjoys a cheap vacation!

Page 68: Agile Architecture

Example domain model

Page 69: Agile Architecture

What concepts did you mention in

scenario?

Page 70: Agile Architecture

Example deployment model

Page 71: Agile Architecture

Which servers are involved in

production?

Page 72: Agile Architecture

Example implementation

diagram

Page 73: Agile Architecture

How does the code work?

Page 74: Agile Architecture

Statnett electricity reserves1. Grid operator want to maintain balance of electric production and consumption2. Power producer sends unused capacity (reserves) per hour for each power plant to

LARM using EDIFACT via Sterling Integrator– Detail: The capacity “line” has a price– Detail: Each plant may have several capacities at different prices– Detail: Capacity may be to increase or to decrease production

3. A spike occurs in the consumption or production4. Grid operator sees list of available reserves per power plant

1. Alternative: Operator filters the list by grid market area5. Grid operator selects a reserve to regulate for spike6. Grid operator enters power usage on the regulation

1. Alternative: The system verifies that regulation is valid7. Grid operator communicates the regulation to producer’s operation center using phone

1. Future: The system sends the regulation to the producer as XML/http 8. Balance is restored9. At end of hour, system sends usage to pricing system (NOIS) (XML/http) via Sterling

Integrator10. Some time later, pricing system sends price for usage via SI11. System sends price capacity usage to accounting system via SI12. Accounting system pays producer for usage

Page 75: Agile Architecture

/Describe architecture

Page 76: Agile Architecture

What surprised you?

Your plan to change how you work?

What did you learn?

Page 77: Agile Architecture

Conclusion:

Page 78: Agile Architecture

Tomorrow: Make your system shine!

Page 79: Agile Architecture

Thank [email protected]

http://johannesbrodwall.comhttp://exilesoft.com

http://twitter.com/jhannes

• Vision• Stakeholders• Usage flows

Page 80: Agile Architecture

• Lasagna architecture• Feature oriented architecture

• Deployment constraints

Page 81: Agile Architecture

Lasagna architecture

Page 82: Agile Architecture

Person-Controller

Person-Controller-

Impl

Person-Service

Person-ServiceImpl

Person-Repository

Person-Repository

Impl

PersonDao

PersonDaoImpl

Session-Factory

Page 83: Agile Architecture

Controllers

Services

Managers

Workers

Repositories

Page 84: Agile Architecture

Controllers

Services

Managers

Workers

Repositories

DTO

Domain

Mapping

Page 85: Agile Architecture
Page 86: Agile Architecture

Customer

Invoice

Order

Product

Page 87: Agile Architecture

Tidying up art (Ursus Wehrli)

Page 88: Agile Architecture
Page 89: Agile Architecture

Feature oriented architecture

Page 90: Agile Architecture
Page 91: Agile Architecture

Coherence• What changes together

lives together

Page 92: Agile Architecture
Page 93: Agile Architecture

Tolerance• What should be different

can be different

Page 94: Agile Architecture
Page 95: Agile Architecture

Meaning• What is central in domain

is central in code

Page 96: Agile Architecture
Page 97: Agile Architecture

Your thinking is contrained by

technology fashion:

Page 98: Agile Architecture

Controllers

Services

Managers

Workers

Repositories

DTO

Domain

Mapping

Page 99: Agile Architecture

Your solution is constrained by

deployment

Page 100: Agile Architecture

Web Application

Web user

Database

Browser

JSON/http

Web Service

SOAP

Web ServiceService

Consumer

DTO?DTO

DTO

Controller

Page 101: Agile Architecture

Web Application

Web user

html/http

Database

Controller

DAO

Page 102: Agile Architecture

Web Application

Web user

html/http

Database

Reverse proxy

html/http

Controller

DAO

Page 103: Agile Architecture

Web Application

Web user

Database

Browser

JSON/http

DTO?Controller

DAO

Page 104: Agile Architecture

Web Application

Web user

Database

Rich client

Web service

DTO

DTO

Service

Consumer

Controller

Page 105: Agile Architecture

Web Application

Web user

Database

Rich client

Objects over http

DTO

DTOController

Page 106: Agile Architecture

Web Application

Web user

Database

Browser

JSON/http

Web Service

SOAP

Service

Consumer

DTO?DTO

DTO

External client

Controller

DAO

Page 107: Agile Architecture

Web Application

Web user

Database

Browser

JSON/http

Service

External client

DTOController

DAO