给敏捷团队中的架构师的10个建议

微软澳大利亚的解决方案架构师Tom Hollander,在TechEd Australia大会上举行了一场题为“敏捷团队中的架构师角色”的演讲。在演讲中,他讨论了他作为领导敏捷团队的架构师所做的工作。
from:http://www.infoq.com/cn/news/2010/09/Tips-Architect-Agile-Team

在谈到架构师的角色时,Hollander指的是“解决方案架构师”或者应用架构师。他不是指企业架构师或者其他的专业人士(专精于特定的领域,例如消息或基础设施)。

Hollander的团队采纳了由4周迭代以及最后的稳定阶段(几天代码冻结的时间)组成的流程,实施了每日站立会议、每日构建与自动化测试的持续集成等实践,并采用了许多角色:

  • PjM——项目经理,类似于Scrum Master,确保团队遵循了流程
  • PdM——产品经理,也被称为客户或Product Owner,决定产品应该是什么样子
  • 架构师——解决方案/应用架构师
  • 开发人员——开发团队
  • 测试人员——测试团队
  • 用户体验设计人员UX)——用户体验团队
  • 发布人员——承担构建和发布的职责,负责维护构建的流程

Hollander针对解决方案架构师如何在敏捷团队中取得成功,提出了最重要的十件事情:

  1. “正好足够”的预先设计——除了非常简单的项目,一定时间的预先设计(例如,1到2周)是绝对必要的,其时间长短会取决于应用的类型——网络应用程序、智能客户端(smart client)、移动或批处理,基本的功能需求是什么,是长期的解决方案抑或是折衷的、暂时的方案,都要弄清楚。预先设计的目的是要决定:使用什么技术——例如,ASP.NET或MVC,应用程序是什么类型——2层、3层抑或是面向服务的应用,如何访问数据库——存储过程、实体框架、LINQ、依赖注入(DI)。一篇简短的文档就可以包含所有这些信息以供大家参考。
  2. 从垂直分片开始——是指从一小块功能开始(例如登录页面),尽可能地在垂直方向把它切分为很多层,从而把前一阶段所决定的所有技术结合在一起。这将验证设计决策的正确性,而且所有的技术可以一起工作,并且将向开发者展示在开发新代码时可以遵循的模式。如果发现最初的设计决策不当,此时是一个合适的修改时间。
  3. 在每次迭代中的Just-in-time设计——在每个4周迭代的中段,项目经理、产品经理和架构师应该聚在一起讨论在下一个迭代中要完成的需求,确保他们每一位都同意这些需求,重要性更高的事情放在了前面处理,而且每个人对一切事情都非常清楚。这些讨论在当前迭代中会以不太明显的方式延续一个星期。接下来的一周,也即当前迭代的最后一周,架构师复审下一次迭代的需求,作出必要的设计决策,以便团队可以在下一个星期基于这些决策开展工作。如果需求与以往相当不同,那么,架构师会开发一些原型,编写一些代码来证明概念,绘制一些图表,然后把所有这些东西集编为5页的文件以供参考。这不是为了制定出有利于开发人员的详细设计方案,而是要确保新的需求满足全局的要求。
  4. 信任你的团队...但要跟他们在一起——这关乎架构师与开发人员的关系。架构师需要确保他没有逾越自己的角色,没有独占所有“做决定”的乐趣,使得开发人员的工作变得无聊。与此同时,架构师需要给团队提供指导,解决那些可能会导致开发人员停顿的困难问题。架构师每天都应该与每位开发人员接触,获悉他们在做什么,并且在他们遇上编程问题的时候给予帮助。特别是当开发人员不喜欢寻求帮助,试图花上整整一个礼拜的时间来自行解决问题的时候,这种帮助尤为需要。这种关系也适用于PjM和测试/构建/发布团队。
  5. 编写代码!——架构师应该知道代码的质量如何,这样才会对他做出的决定所产生的影响有更好的理解。他也可以整明白何时重构是必须的。 编写代码的架构师在开发团队中有更好的声誉。也就是说,Hollander并不认同(设计和开发)职责的泾渭分明。他还认为,架构师仍然是架构师,他不一定要像普通的开发人员一样擅长于编写代码。
  6. 参与一切——架构师参与所有与项目有关的会议:设计、开发、代码评审、需求规划等,这是有好处的,因为他能够以更广阔、更清晰的视角看待正在发生的事情,而且他能够通过告知产品经理其决定的潜在后果,从而帮助他/她避免在早期阶段做出错误的决定。
  7. 推动质量文化——一个成功的团队,一个人人都想成为其中一分子的团队,是建立在质量文化之上的:没有人偷工减料;没有人提交拙劣代码;如果设计中有一个重大的缺陷,它绝不会不知不觉地混过关;所有人都是诚实和开放的,寻求整个团队达到最佳的结果。Hollander承认,建立这样一个团队很难,但并非不可能。首先,架构师应该在一开始就创建一些规则,这些规则不会因为开发人员不喜欢就随着时间而改变。比如决定编写单元测试,再比如在每次提交以前都要进行代码评审,包括由架构师提交的代码。如果评审人员(可以是团队中的任意一位)不认可代码,代码就不能提交。
  8. 知道何时需要改变——架构师应该非常灵活,随时准备好在设计需要改变的时候去改变设计。早期的解决方案也许不再适合,抑或是新的需求需要不同的方法。
  9. 屏蔽来自外部的随机请求——虽然这通常是项目经理/Scrum master的职责,但架构师可以保护团队不受外部请求的影响,这些影响往往会分散团队的精力和浪费真正工作的时间。举个例子:业务团队可能想要以某种特定的方式完成某些特定的事情,而他们的请求并不全然合理,也并不是必须实现。 
  10. 撰写文档...但只有当有人需要阅读它们的时候——Hollander并不提倡记录一切,也不提倡根本不撰写任何文档。他认为有必要取得一个平衡——只编写一定数目真正有帮助的、有人会去阅读的文档。文档在记录详细设计的决定(比如数据模型)方面是很好的载体。迭代的设计决定,虽然它们由整个团队在迭代开始之初讨论得出,但我们仍然建议将它们记录在5页的文档之中,以备开发人员日后不记得架构师言论的时候进行查阅。而当最开始的开发人员和架构师离开项目、加入其他项目之后,新加入项目工作的人也能借助于这些文档理解某些决定的来龙去脉。 

综上所述,Hollander指出,架构师应该确保他从理论上和实践上都是团队的一分子。架构师不应该编写所有的代码,而只是其中一小部分,他不去测试或部署这些代码,但他要确保整个流程的顺利进行。
 

Tom Hollander, a Solutions Architect at Microsoft Australia, held a presentation entitled The Role of an Architect in an Agile Team at TechEd Australia where he discussed  what he does as an architect leading an agile team.

When talking about the role of an architect, Hollander means a “solution architect’ or an application architect. He does not refer to an enterprise architect or a specialist one (specialized on a specific field like messaging or infrastructure). 

Hollander’s team has a 4 week iteration process with a stabilization period – code freeze for a few days - at the end, practices daily stand-up meetings, continuous integrations with daily builds followed by automated tests, and is employing a number of roles:

  • PjM – is the Project Manager, similar to a Scrum Master, making sure the team is following the process.
  • PdM – is the Product Manager, also known as the Customer or the Product Owner, determining what the product is supposed to be
  • Architect – a solution/application architect
  • Dev – the development team
  • Test – the test team
  • UX – the User Experience team
  • Release – the Build and Release role taking care of the building process

Hollander has come up with a top 10 list of things for a solution architect to be successful in an agile team:

  1. “Just enough” upfront design – except for very simple projects, a certain amount of upfront design – 1-2 weeks - is absolutely needed based on what type of application is - web app, smart client, mobile or batch –, what are the basic functionality requirements, a long term solution or an intermediary, temporary one. The purpose of the upfront design is to decide: what technology to use – for example, ASP.NET or MVC –, what type of application - a 2-tier, a 3-tier or a service-oriented application –, accessing the DB – stored procedures, Entity Framework, LINQ, DI. All that can be contained in a short document for reference.
  2. Start with a vertical slice – means starting with a small piece of functionality – a logon page, for example – which cuts as many vertical layers as possible in order to tie together all the technology pieces decided during the previous phase. This will demonstrate that the design decisions are correct and all pieces are working together, and will represent a pattern for developers to follow when developing the additional code. If the initial design decisions turn out to be inappropriate, now it is a good time to change them.
  3. Just-in-time design each iteration – At the middle of a 4-week iteration, the project manager, the product manager and the architect should meet to discuss the requirements to be addressed during the following iteration, to make sure they all agree on them, what is more important is put up in front, and everything is understood. That discussion goes on for a week in the background of the current iteration. The following week, the last of the current iteration, the architect reviews the requirements for the next iteration, making the necessary design decisions so the team can start working on them the following week. If the requirements are quite different from previous ones, then the architect does some prototyping, writing some code as a proof of concept, writing some diagrams and putting it all together in a 5-page document for reference. This is not meant to do detailed design decisions made for the developer, but rather to make sure the new requirements fit into the big picture.
  4. Trust your team… but be there for them – this has to do with the relationship architect-developer. The architect needs to make sure he does not overstep his role, making the developer’s job boring by taking all the fun of decision making. In the same time, the architect needs to be a mentor for the team, solving difficult problems that might bog down the developers. The architect should be in contact with every developer each day, knowing what they are doing and helping them if there is a coding problem. This is especially needed when dealing with developers that don’t like to ask for help and try to solve problems on their own with the price of spending an entire week with that. This kind of relationship also applies to the PjM and test/build/release team.
  5. Write code! – The architect should know what’s in the code in order to have a better idea on the impact of his decisions. He can also figure out when a refactoring is needed. A code writing architect has better credibility with the development team. That being said, Hollander does not believe in role dissolution. He still thinks an architect remains an architect, and he’s not necessarily as good at writing code as a regular developer.
  6. Be involved in everything – It is good for the architect to be involved in all meetings related to his project: design, development, code reviews, requirements planning, etc., because he can have a larger and more clear perspective on what is going on, and he can help the product manager to avoid making wrong decisions in an early stage by informing him/her on their possible outcome.
  7. Drive a culture of quality – A successful team, one that anyone would like to be part of is one built on a culture of quality: nobody cuts corners, nobody checks-in sloppy code, if there is a major flaw in the design it won’t pass unnoticed, all are honest and open, looking for the best outcome of the entire team. Hollander admits that it is hard to build such a team, but it is possible. Firstly, the architect should establish some rules in the beginning, rules are are not going to change over time because a developer happens to not like them. One example is the decision to write unit tests. Another is having a code review before each check-in, including the code submitted by the architect. If the code is not accepted by the reviewer, which can be anybody in the team, the code is not checked-in.
  8. Know when changes are required – The architect should be very flexible and ready to make design changes when they are required. It may be that an early solution is no longer appropriate, or new requirements demand a different approach.
  9. Shield the team from external randomization – While this is usually the job of a project manager/Scrum master, the architect can get involved in protecting the team from external requests that tend to divert the team’s focus and take time from actual work. One example could be various requests coming from the operations team wanting certain things to be done in a certain way, and their requests are not always reasonable or something that has to be implemented.
  10. Write docs … but only if someone needs to read them – Hollander is not the adept of documenting everything, nor one of writing no documentation. He thinks there is necessary to have a balance, writing the amount of documentation that is actually helpful and is read by someone. Documents are good to remember detailed design decisions like a data model. Iteration design decisions, while they are discussed with the team at the beginning of the iteration, it is recommended to be saved in a 5-pages document for the developers to go to if one of them does not remember what the architect said. This also helps new people working on the project long after the initial developers and architect moved to another project to understand why some of the decisions were made. 

As a conclusion, Hollander said the architect should make sure he is part of the team in theory and in practice. The architect is not supposed to write all the code, only a small portion, he is not testing or deploying it, but he is rather making sure the entire process runs smoothly.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章