Simon brown archsummit2012 the-frustrated-architect

102

Click here to load reader

Transcript of Simon brown archsummit2012 the-frustrated-architect

Page 1: Simon brown archsummit2012 the-frustrated-architect

大会官方网站与资料下载地址:www.archsum m it.com

感谢您参加本次ArchSummit全球架构师峰会!

Page 2: Simon brown archsummit2012 the-frustrated-architect

郁闷的架构师The frustrated architect

Page 3: Simon brown archsummit2012 the-frustrated-architect

Simon BrownJersey, Channel Islands

Page 4: Simon brown archsummit2012 the-frustrated-architect

[email protected]

@simonbrown (Twitter)

写作培训与咨询

Page 5: Simon brown archsummit2012 the-frustrated-architect

leanpub.com

Page 6: Simon brown archsummit2012 the-frustrated-architect

感知Perceptions

Page 7: Simon brown archsummit2012 the-frustrated-architect

我是一个软件架构师

I’m a software architect

Big up front designand analysis paralysis UML

Waterfall

Ivory TowerArchitecture AstronautPowerPoint Architect

Page 8: Simon brown archsummit2012 the-frustrated-architect

PPT架构

Enterprise Service Bus

Single Sign-On

Corporate Data Model

Buzzword Bingo

Page 9: Simon brown archsummit2012 the-frustrated-architect

“ ”架构师是

“业务技术战略家” Architects are “business technology strategists”

Page 10: Simon brown archsummit2012 the-frustrated-architect

“ ”微软的SharePoint

有很明确的ROI和TCOMicrosoft SharePoint has a solid ROI & TCO

Page 11: Simon brown archsummit2012 the-frustrated-architect

“ ”MongoDB的价值主张是什么给我看看你的商业分析!

What’s the value proposition of MongoDB? Show me your business case!

Page 12: Simon brown archsummit2012 the-frustrated-architect

热門词汇Buzzwords!

热門词汇让人们离软件架构的学问越来越远Buzzwords push people away from learning aboutthe software architecture discipline

Page 13: Simon brown archsummit2012 the-frustrated-architect

我是团队的另一名成员我喜欢编写代码

I’m another member of the team ... I like writing code

Page 14: Simon brown archsummit2012 the-frustrated-architect

Coding

“Architecture”

Time

Page 15: Simon brown archsummit2012 the-frustrated-architect

UML

Page 16: Simon brown archsummit2012 the-frustrated-architect

管理咨询Management Consulting

Page 17: Simon brown archsummit2012 the-frustrated-architect

我们的导师升职了

救命!Our mentor has been promoted ... help!

企业职场发展阶梯Corporate career ladder

Technical

Non-technical

Page 18: Simon brown archsummit2012 the-frustrated-architect

http://www.codingthearchitecture.com

Page 19: Simon brown archsummit2012 the-frustrated-architect

软件架构师不是组织中的职级 “Software Architect” is not an organisational rank

软件架构师是你慢慢演化成的角色

Software architecture is a role that you evolve into

Page 20: Simon brown archsummit2012 the-frustrated-architect
Page 21: Simon brown archsummit2012 the-frustrated-architect

我们希望变得敏捷

We aspire to be agile

敏捷很酷,但是我们是不是忘了什么东西?Agile is cool, but are we forgetting something?

Page 22: Simon brown archsummit2012 the-frustrated-architect

敏捷Agile

Page 23: Simon brown archsummit2012 the-frustrated-architect

Agile

Emergent design

Retrospectives

Moving fast, embracing

change

Automated acceptance

testing

Continuous delivery

Self-organising team

Test-driven development

Lean

Kanban

Technical guidance

Non-functional requirements

Vision

Structure

Performance

Scalability

Availability

Security

Technical quality

Page 24: Simon brown archsummit2012 the-frustrated-architect

敏捷 + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Page 25: Simon brown archsummit2012 the-frustrated-architect

“敏捷软件架构师”

是什么?What is an agile software architect?

Page 26: Simon brown archsummit2012 the-frustrated-architect

我是一个

“敏捷软件架构师”I’m an agile software architect!

Evolutionary Architectureand Emergent Design

YAGNIDefer until the

last responsible moment

Refactoring Spikes, stripes and tracers

System Metaphor

Page 27: Simon brown archsummit2012 the-frustrated-architect

这是敏捷的软件架构吗?Is this agile architecture?

即时贴Sticky notes!

Page 28: Simon brown archsummit2012 the-frustrated-architect

敏捷Skills

Business Modelling

Requirements

Analysis & Design

Implementation

Test

Deployment

Configuration Management

Project Management

Environment

Sprint 1 Sprint 2 Sprint 3

Page 29: Simon brown archsummit2012 the-frustrated-architect

演化的架构

愚蠢地期待最好结果?Evolutionary architecture ... foolishly hoping for the best?

Page 30: Simon brown archsummit2012 the-frustrated-architect

Agile software team

我们不需要软件架构,我们实施测试驱动开发

We don’t need software architecture; we do TDD

Page 31: Simon brown archsummit2012 the-frustrated-architect

测试驱动开发玩的是代码

软件架构玩的是“全景”TDD is about code ... software architecture is about the “big picture”

Page 32: Simon brown archsummit2012 the-frustrated-architect

最后负责时刻Last responsible moment

Page 33: Simon brown archsummit2012 the-frustrated-architect

自组织团队不一定总在工作Self-organising teams don’t always work

Page 34: Simon brown archsummit2012 the-frustrated-architect

为什么你们要抨击敏捷?Why are you bashing agile?

Page 35: Simon brown archsummit2012 the-frustrated-architect

让我们重新发明轮子Let’s reinvent the wheel

Page 36: Simon brown archsummit2012 the-frustrated-architect

回顾Retrospective

Page 37: Simon brown archsummit2012 the-frustrated-architect

我们是不是忘的比学的还多?Have we forgotten more than we’ve learnt?

Page 38: Simon brown archsummit2012 the-frustrated-architect

UML

Page 39: Simon brown archsummit2012 the-frustrated-architect
Page 40: Simon brown archsummit2012 the-frustrated-architect

Class

Responsibilities Collaborators

Class

Responsibilities Collaborators

类-责任-协作 Class-Responsibility-Collaboration

Class

Responsibilities Collaborato

rs

Page 41: Simon brown archsummit2012 the-frustrated-architect

边界、控制器和实体Boundaries, controllers and entities

Page 42: Simon brown archsummit2012 the-frustrated-architect

基于组件的开发Component-based development

Component A

Component B

Component C

High cohesion, low coupling

design by contract,

Liskov substitution principle

Page 43: Simon brown archsummit2012 the-frustrated-architect

Pattern-OrientedSoftware Architecture

Page 44: Simon brown archsummit2012 the-frustrated-architect

Rational 统一过程Rational Unified Process (RUP)

TransitionConstructionElaborationSkills

Business Modelling

Requirements

Analysis & Design

Implementation

Test

Deployment

Configuration Management

Project Management

Environment

Inception

Page 45: Simon brown archsummit2012 the-frustrated-architect

要讲求实效很多人不知道比较老的软件开发实践

Be pragmatic ... many people aren’t aware of older software development practices

Page 46: Simon brown archsummit2012 the-frustrated-architect

谁在讲授前敏捷时代的经典?Who is teaching the classics of the pre-agile era?

UML

基于组件的开发Pattern

-Orie

nted Softw

are Arch

itectu

re

Rational 统

一过程

Test

-Driv

en D

evelop

men

t

Kanb

anCo

ntinu

ous

Deliv

ery

Syst

ems

Think

ing

Extr

eme

Prog

ramming

Page 47: Simon brown archsummit2012 the-frustrated-architect

所以你认为你是一个软件架构师么?So you think you're a software architect?

Page 48: Simon brown archsummit2012 the-frustrated-architect

Curriculum Vitae / Resume

Enterprise ArchitectA Big Company (2006-date)

I have been responsible for the design and implementation of an

enterprise customer solution. I drew some UML diagrams and I

wrote some Java code.

I would like a job writing more code please. :-)

大企业中的企业架构与软件架构不同

Enterprise architecture isn’t the same as software architecture in a large enterprise!

Page 49: Simon brown archsummit2012 the-frustrated-architect

AaaS ... architecture as a service

软件开发不是接力赛Software development is not a relay sport

SoftwareArchitecture

Document

Page 50: Simon brown archsummit2012 the-frustrated-architect

成功的软件交付不仅仅是实现细节Successful software delivery is not an implementation detail!

Page 51: Simon brown archsummit2012 the-frustrated-architect

愚蠢地期待最好结果?

Page 52: Simon brown archsummit2012 the-frustrated-architect

不负责任的软件架构师The irresponsible software 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; ...

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

load testing); ...

No documentation; ...这是一个战略软件平台!

This is a strategic software platform!

Page 53: Simon brown archsummit2012 the-frustrated-architect

我们是作者还是软件架构师?Are we authors or software architects?

Page 54: Simon brown archsummit2012 the-frustrated-architect

你知道你在构建什么吗?Do you know what you’re building?

Page 55: Simon brown archsummit2012 the-frustrated-architect

混乱Chaos ... does the team understand what they are building and how they are building it?

团队是否理解他们要构建什么?

应该如何构建?

Page 56: Simon brown archsummit2012 the-frustrated-architect

混乱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, ...

停!Slow, insecure, unstable, unmaintainable,

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

Page 57: Simon brown archsummit2012 the-frustrated-architect

对“太长,没看”的共同理解Shared vision of TL; DR

SoftwareArchitecture

Document

Page 58: Simon brown archsummit2012 the-frustrated-architect

对“什么?!”的共同理解Shared vision of what!?

Page 59: Simon brown archsummit2012 the-frustrated-architect

WCF Communications (SOAP, REST, TCP, MQ)

Service Proxy Service Proxy Service ProxyService Proxy

Presentation Layer(Service A Pages)

Presentation Layer(Service B Pages)

Presentation Layer(Service C Pages)

Service A Service B Service C

3rd Party Interface

Services Implementation

Service Proxy

Presentation Layer (Master Pages)

Services Implementation Services Implementation

Services Implementation

Services Implementation

Presentation Layer

Transport

WCF Service

Contracts Contracts

Service AServices

Service BServices

Service Interface

Business Layer

Contracts

Service CServices

Data Contracts Data Contracts Data Interface

Service AData Layer

Data Layer

Service CData Layer Data Layer

More Common ServicesCommon Services

Contracts Contracts

Data Contracts Data Contracts

Services ServicesServices

Data Layer

Data Layer

Data Layer

Services ServicesServices

Data Layer

Data Layer

Data Layer

3rd Party Interface3rd Party Interface3rd Party Interface

Common

Foundation

Data Layer

Data Contract

Data Contract

Authentication

Data Management

Logging

EmailCRM WorkflowData Access

Page 60: Simon brown archsummit2012 the-frustrated-architect

我们可以把我们软件开发的过程可视化We can visualise our software development process

我们已经忘记了如何可视化我们构建的软件We’ve forgotten how to visualise the software that we’re building

Page 61: Simon brown archsummit2012 the-frustrated-architect

你如何设计软件?How do you design software?

Page 62: Simon brown archsummit2012 the-frustrated-architect

解决方案?Solutions?

Page 63: Simon brown archsummit2012 the-frustrated-architect

软件程序猿

软件架构师软件架构师坐在象牙塔之中

Software architect sitsin an ivory tower

软件程序猿专注于底层细节

Software developers focus on the low-level detail

软件程序猿 软件程序猿 软件程序猿 软件程序猿

Page 64: Simon brown archsummit2012 the-frustrated-architect

协作、教练、指导 Collaborating, coaching and mentoring

提升软件架构的自我意识Increased awareness of software architecture

软件架构师

软件程序猿

缩小差距

Page 65: Simon brown archsummit2012 the-frustrated-architect

深度 ... 深厚的技术知识Depth ... deep technical knowledge

广度 ... 知道不同的方案和软件开发实践Breadth ... awareness of different options and software development practices

优秀的软件架构师是“建筑师”

Good software architects are master builders

通才化的专才

Page 66: Simon brown archsummit2012 the-frustrated-architect

你会雇一个不会编码的架构师么?Would you hire a software architect that wouldn’t code?

Page 67: Simon brown archsummit2012 the-frustrated-architect

软件架构师这个角色

需求和约束Requirements and constraints

软件设计的演化Evolution of software design

教练和指导Coaching and mentoring

质量保证Quality assurance

编码Coding

技术选型Technology selection

软件设计Software design

软件设计的评估Evaluation of software design

Page 68: Simon brown archsummit2012 the-frustrated-architect

Macro (classes)

Abstract Specific

作为软件程序猿,代码是我们的主要面向对象As developers, the code is our major focus

Telephoto (components)Standard (containers)

Wide angle (contex

t)

Page 69: Simon brown archsummit2012 the-frustrated-architect

Abstract Specific

有时你需要离代码远一点儿Sometimes you need to step back from the code

Macro (classes)Telephoto (components)Standard (containers)

Wide angle (contex

t)

Page 70: Simon brown archsummit2012 the-frustrated-architect

Macro (classes)

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

Telephoto (components)

Standard (containers)

Wide angle (contex

t)

任何问题都有多种解决方案There are a number of solutions to any problem

需求

原则

约束

Page 71: Simon brown archsummit2012 the-frustrated-architect

Macro (classes)

需求

原则

约束

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

Telephoto (components)

Standard (containers)

Wide angle (contex

t)

任何问题都有多种解决方案There are a number of solutions to any problem

Page 72: Simon brown archsummit2012 the-frustrated-architect

UML工具白板和挂图

Page 73: Simon brown archsummit2012 the-frustrated-architect

Post-it notesFlipchar

t & pens

Blu-Tack

Index cards Whiteboard & pensCollaborative de

sign协作式软件设计

Collaborative software design

Page 74: Simon brown archsummit2012 the-frustrated-architect

1. Context 2. Containers 3. Components

按常理出牌 (thinking inside the box)

4. ClassesC4ContextContainersComponentsClasses

有效的草图Effective sketches

Page 75: Simon brown archsummit2012 the-frustrated-architect

你会那样编码么?Would you code it that way?

这就是为什么软件架构

师必须是“建筑师”

This is why software architects must be

master builders

Page 76: Simon brown archsummit2012 the-frustrated-architect

SoftwareArchitectureDocument

旅行手册Travel Guidebook

地图Maps

景点Sights

历史和文化History and culture

实用信息Practical information

Page 77: Simon brown archsummit2012 the-frustrated-architect

文档应该说清楚代码没有说的东西Documentation should describe what the code doesn’t

减少浪费,增加价值

Reduce waste, add value

文档应该说明意图,并作为源代码的导引说明

Use it to explain intent and act as aguide to navigate the source code

Page 78: Simon brown archsummit2012 the-frustrated-architect

大型前期设计?Big design up front?

Page 79: Simon brown archsummit2012 the-frustrated-architect

你做多少前期设计?How much up front design should you do?

大型前期设计?

演化的架构?

没有?

还是二者之间?

Waterfall

Page 80: Simon brown archsummit2012 the-frustrated-architect

刚刚够用Just enough

Page 81: Simon brown archsummit2012 the-frustrated-architect

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 82: Simon brown archsummit2012 the-frustrated-architect

InfrastructureServices

Foundations

Features and Services

A software system

实验 Experiments

概念原型或证明

Prototype or proof of concept

Page 83: Simon brown archsummit2012 the-frustrated-architect

架构上的重要性Architecturally significant

Page 84: Simon brown archsummit2012 the-frustrated-architect

你需要识别并消除优先级最高的风险You need to identify and mitigate your highest priority risks

Page 85: Simon brown archsummit2012 the-frustrated-architect

概率 (Probability)

(Impa

ct)低 (1) 中 (2) 高 (3)

(1)

(2)

(3)

1 2

2 4

3

3 6

6

9

影响

Page 86: Simon brown archsummit2012 the-frustrated-architect

风险风暴

“Risk-storming”

识别风险的协作与可视化技巧A collaborative and visual technique for identifying risk

Page 87: Simon brown archsummit2012 the-frustrated-architect

风险识别出来后,你还是需要应对它们You still need to deal with the risks once they’ve been identified

Page 88: Simon brown archsummit2012 the-frustrated-architect

An example timeline from

“Beyond Retrospectives”by Linda Rising

#gotocon Aarhus 2011

新技术的问题Problems with new technology

Page 89: Simon brown archsummit2012 the-frustrated-architect

总结The summary

Page 90: Simon brown archsummit2012 the-frustrated-architect

软件架构师角色和软件设计流程是不同的东西

The software architecture role and the process of designing software are different

Page 91: Simon brown archsummit2012 the-frustrated-architect

混乱团队 ... 自组织团队

团队中的专职软件架构师Dedicated software architect

on a team

每个人都是软件架构师Everybody is a software architect

软件架构师这个角色The software architecture role

Page 92: Simon brown archsummit2012 the-frustrated-architect

SoftwareArchitecture

Document...

软件设计流程The software design process

大型前期设计Big up front design

Requirements capture, analysis anddesign 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 93: Simon brown archsummit2012 the-frustrated-architect

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

public SomeWizard() { }

...

}

刚刚够用软件架构师这个角色

The software architecture

role

软件设计流程The software design process

理解软件的重要结构元素Understand the significant structural elements

of the software

识别并消除关键风险

Identify and mitigate the key risks

为团队提供坚实基础和共同愿景Provide firm foundations anda shared vision for the team

SoftwareArchitecture

Document

Page 94: Simon brown archsummit2012 the-frustrated-architect

需要Yes

敏捷软件开发项目需要软件架构师么?Do agile software development projects need software architecture?

Page 95: Simon brown archsummit2012 the-frustrated-architect

是的,它可以制止大型前期设计和分析带来的瘫痪

Yes, it stops big design up front and analysis paralysis

敏捷软件开发对架构师来说是好东西吗?Is agile software development a good thing for software architecture?

Page 96: Simon brown archsummit2012 the-frustrated-architect

定义你的团队中的软件架构师角色Define the software architecture role on your teams

Page 97: Simon brown archsummit2012 the-frustrated-architect

向软件架构中应用一些工艺Apply some craftsmanship to software architecture

可工作的软件系统!

Software systems that work!

有效的草图和轻量级文档 Effective sketches and

lightweight documentation

Page 98: Simon brown archsummit2012 the-frustrated-architect

积极、主动,以身作则Be proactive, take ownership and lead by example

Page 99: Simon brown archsummit2012 the-frustrated-architect

我们需要为明天培养软件架构师We need to grow the software architects of tomorrow

Page 100: Simon brown archsummit2012 the-frustrated-architect

适合你的就去做!Do whatever works for you!

Page 101: Simon brown archsummit2012 the-frustrated-architect

[email protected]

@simonbrown on Twitter

codingthearchitecture.com

培训与咨询

Page 102: Simon brown archsummit2012 the-frustrated-architect

杭 州 站 ·2012年 10月 25日 ~27日大会官网:www.qconhangzhou.com