Software Architecture For Developers Sample PDF
Software Architecture For Developers Sample PDF
This is a Leanpub book, for sale at: http://leanpub.com/software-architecture-for-developers Leanpub helps authors to self-publish in-progress ebooks. We call this idea Lean Publishing. To learn more about Lean Publishing, go to: http://leanpub.com/manifesto To learn more about Leanpub, go to: http://leanpub.com
Contents
Preface About the author Speaking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Want to get in touch? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Training i iii iii iii iii iv
1
2 2 2 3 3
4
5 6 7 8 8 8 9 10
11
12
CONTENTS
13
14 14 14 15 16 16 16 16 17 17 17
18
19 19 19
21
22 22 23
24
25 25 25 25
CONTENTS
4. SharePoint solutions still need to be documented . . . . . . . . . . . . . . . . . . . . . . . . . . Strong leadership and discipline arent just for software development projects . . . . . . . . . . . . Version history
26 26 27
Preface
The agile and software craftsmanship movements are helping to push up the quality of the software systems that we build, which is excellent. Together they are helping us to write better software that better meets the needs of the business while carefully managing time and budgetary constraints. But theres still more we can do because even a small amount of software architecture can help prevent many of the problems that projects face. Successful software projects arent just about good code and sometimes you need to step away from the IDE for a few moments to see the bigger picture. This book is about that bigger picture and its role in delivering better software. Its a collection of essays that together form a practical and pragmatic guide to software architecture, with the overall goal being to demystify what it means to be a software architect and provide guidance on how to do software architecture effectively. The book is aimed at software developers that want to learn more about software architecture as well as those that are new to the role. It fills the gap between software development and high-level architecture that probably seems a little enterprisey for most developers.
Youll find this book useful if any of the following scenarios sound familiar. Im not sure what software architecture is about and how its any different from design. I dont understand why we need software architecture. My manager has told me that Im the software architect on our new project, but Im not sure what that actually means. I want to get involved in designing software but Im not sure what I should learn. i
Preface
ii
Ive been given some requirements and asked to design some software, but Im not sure where to start. I need to make some major enhancements to my system, but Im not sure where to start. Ive been asked to write a software architecture document but Im not sure what to include in it. Im not sure who to talk to in my organisation about how best to integrate what were building. I understand what software architecture is all about, but Im not sure how to tackle it on my project. My project seems like a chaotic mess; everybody is doing their own thing and theres no shared vision. Help!
Speaking
Simon regularly speaks about software development, at events ranging from international software development conferences through to small user groups and specialist events. Videos and slides from many of these events are available view online/download from Coding the Architecture.
Writing
Simon has also written/co-written a number of books and articles in the past, including several books about Java EE technologies.
iii
Training
Designing software given a vague set of requirements and a blank sheet of paper is a good skill to have, although not many people get to do this on a daily basis. However, with agile methods encouraging collective ownership of the code, its really important that everybody on the team understands the big picture. And in order to do this, you need to understand why youve arrived at the design that you have. In a nutshell, everybody on the team needs to be a software architect. Software Architecture for Developers is also available as a two-day training course about pragmatic software architecture, designed by software architects that code. It will show you what just enough up front design is, how it can be applied to your software projects and how to communicate the big picture through a collection of simple effective sketches. Its aimed at software developers and architects regardless of whether youre building software in Java, .NET or something else. The course is interactive; with a combination of presentation, group discussion and group working. Throughout the course youll solidify everything you learn through a case study where youll be given a set of requirements, asked to design a small software system and communicate that design.
See http://www.softwarearchitecturefordevelopers.com for more details or if youd like to join us for a mixture of presentation, discussion and deliberate practice.
http://www.softwarearchitecturefordevelopers.com
iv
Agile aspirations
Agile might be over ten years old, but its still the shiny new kid in town and many software teams have aspirations of becoming agile. Agile undoubtedly has a number of benefits but it isnt necessarily the silver bullet that everybody wants you to believe it is. As with everything in the IT industry, theres a large degree of evangelism and hype surrounding it. Start a new software project today and its all about self-organising teams, automated acceptance testing, continuous delivery, retrospectives, Kanban boards, emergent design and a whole host of other buzzwords that youve probably heard of. This is fantastic but often teams tend to throw the baby out with the bath water in their haste to adopt all of these cool practices. Non-functional requirements not sounding cool isnt a reason to neglect them.
Whats all this old-fashioned software architecture stuff anyway? Many software teams seem to think that they dont need software architects, throwing around terms like self-organising team, YAGNI, evolutionary architecture and last responsible moment instead. If they do need an architect, theyll probably be on the lookout for an agile architect. Im not entirely sure what this term actually means, but I assume that it has something to do with using post-it notes instead of UML or doing TDD instead of drawing pictures. That is, assuming they get past the notion of only using a very high level system metaphor and dont use emergent design as an excuse for foolishly hoping for the best.
What is architecture?
The word architecture means many different things to many different people and there are many different definitions floating around the Internet. Ive asked hundreds of people over the past few years what architecture means to them and a summary of their answers is as follows. These are in no particular order Modules, connections, dependencies and interfaces The big picture The things that are expensive to change The things that are difficult to change Design with the bigger picture in mind Interfaces rather than implementation Aesthetics (e.g. as an art form, clean code) A conceptual model Satisfying non-functional requirements/quality attributes Everything has an architecture Ability to communicate (abstractions, language, vocabulary) A plan A degree of rigidity and solidity A blueprint Systems, subsystems, interactions and interfaces Governance The outcome of strategic decisions Necessary constraints Structure (components and interactions) Technical direction Strategy and vision Building blocks The process to achieve a goal Standards and guidelines 5
What is architecture?
The system as a whole Tools and methods A path from requirements to the end-product Guiding principles Technical leadership The relationship between the elements that make up the product Awareness of environmental constraints and restrictions Foundations An abstract view The decomposition of the problem into smaller implementable elements The skeleton/backbone of the product No wonder its hard to find a single definition! Thankfully there are two common themes here architecture as a noun and architecture as a verb, with both being applicable regardless of whether were talking about constructing a physical building or a software system.
What is architecture?
As a noun
As a noun then, architecture can be summarised as being about structure and is about the decomposition of a product into a collection of components and interactions. This needs to take into account the whole
What is architecture?
of the product, including the foundations and infrastructure services that deal with cross-cutting concerns such as power/water/air conditioning (for a building) or security/configuration/error handling (for a piece of software).
As a verb
As a verb, architecture (i.e. the process, architecting) is about understanding what you need to build, creating a vision for building it and making design decisions. Crucially, its also about communicating that vision so that everybody involved with the construction of the product understands the vision and is able to contribute in a positive way to its success. Put simply, the process of architecting is about introducing technical leadership.
Technical leadership and better coordination. A stimulus to talk to people in order to answer questions relating to significant decisions, non-functional requirements, constraints and other cross-cutting concerns. A framework for identifying and mitigating risk. Consistency of approach and standards, leading to a well structured codebase. A set of firm foundations for the rest of the project. A structure with which to communicate the solution at different levels of abstraction to different audiences.
Questions
1. Do you know what architecture is all about? Does the rest of your team? What about the rest of your organisation? 2. There are a number of different types of architecture within the IT domain. What do they all have in common? 3. Do you and your team have a standard definition of what software architecture means? Could you easily explain it to new members of the team? Is this definition common across your organisation? 4. Can you make a list of the architectural decisions on your current software project? Is it obvious why they were deemed as significant? 5. If you step back from your IDE, what sort of things are included in your big picture? 6. What does the technical career path look like in your organisation? Is enterprise architecture the right path for you? 7. Is software architecture important? Why and what are the benefits? Is there enough software architecture on your software project? Is there too much?
10
11
Questions
1. Whats the difference between the software architecture and software developer roles? 2. Why is it important for anybody undertaking the software architecture role to understand the technologies that they are using? Would you hire a software architect who didnt understand technology? 3. If youre the software architect on your project, how much coding are you doing? Is this too much or too little? 4. If, as a software architect, youre unable to code, how else can you stay engaged in the low-level aspects of the project. And how else can you keep your skills up to date? 5. Why is having a breadth and depth of technical knowledge as important? 6. Do you think you have all of the required soft skills to undertake the software architecture role? If not, which would you improve, why and how? 7. What does the software architecture role entail? Is this definition based upon your current or ideal team? If its the latter, what can be done to change your team? 8. Does your current software project have enough guidance and control from a software architecture perspective? Does it have too much? 9. Why is collaboration an important part of the software architecture role? Does your team do enough? If not, why? 10. Is there enough coaching and mentoring happening on your team? Are you providing or receiving it? 11. What pitfalls have you fallen into as somebody new to the software architecture role? 12. How does the software architecture role fit into agile projects and self-organising teams?
12
13
15
Agile methods have been using this low-tech approach for capturing user stories, story walls and Kanban boards for a while now. In many cases, its the simplest thing that could possibly work but nothing beats the pure visibility of having lots of stuff stuck to a whiteboard in the middle of your office. Unlike a Microsoft Project plan, nobody can resist walking past and having a look at all those post-it notes still in the To do column. From a software design perspective, this low-tech approach frees you from worrying about the complexities of using the tooling and bending formal notation, instead letting you focus on the creative task of designing software. Simply start by sketching out the big picture and work down to the lower levels of detail where necessary. Just remember that you need to explicitly think about things like traceability between levels of abstraction, conventions and consistency if you dont use a tool. For example, UML arrows have meaning and without a key it might not be obvious whether your freehand arrows are pointing towards dependencies or showing the direction that data flows. You can always record your designs in a more formal way using a UML tool later if you need to do so.
16
17
18
20
together; this can work really well for small systems where the containers and components diagrams can be merged. Just try to keep the diagrams as simple as possible. If you do this, illustrating your software can be a quick and easy task that requires little ongoing effort to keep those diagrams up to date. You never know, people might even understand them too.
21
Quantifying risk
Identifying risks is a crucial part of doing just enough up front design and, put simply, a risk is something bad that may happen in the future, such as a chosen technology not being able to fulfil the promises that the vendor makes. Not all risks are created equal though, with some being more important than others. For example, a risk that may make your software project fail should be treated as a higher priority than something that may cause the team some general discomfort. Assuming that you have a list of risks (and risk-storming is a great technique for doing this), how do you quantify each of those risks and assess their relative priorities? There are a number of well established approaches to quantifying risk; including assigning a value of low, medium or high or even a simple numeric value between 1 and 10, with higher numbers representing higher levels of risk.
Probability vs impact
A good way to think about risk is to separate out the probability of that risk happening from the negative impact of it happening. Probability: How likely is it that the risk will happen? Do you think that the chance is remote or would you be willing to bet cash on it? Impact: What is the negative impact if the risk does occur? Is there general discomfort for the team or is it back to the drawing board? Or will it cause your software project to fail? Both probability and impact can be quantified as low, medium, high or simply as a numeric value. If you think about probability and impact separately, you can then plot the overall score on a matrix by multiplying the scores together as illustrated in the following diagram.
22
Quantifying risk
23
Prioritising risk
Prioritising risks is then as simple as ranking them according to their score. A risk with a low probability and a low impact can be treated as a low priority risk. Conversely, a risk with a high probability and a high impact needs to be given a high priority. As indicated by the colour coding Green; a score of 1 or 2: the risk is low priority. Amber; a score of 3 or 4: the risk is medium priority. Red; a score of 6 or 9: the risk is high priority. Its often difficult to prioritise which risks you should take care of and if you get it wrong, youll put the risk mitigation effort into the wrong place. Quantifying risks provides you with a way to focus on those risks that are most likely to cause your software project to fail or you to be fired.
24
25
26
Strong leadership and discipline arent just for software development projects
If youre delivering software solutions then you need to make sure that you have at least one person undertaking the technical leadership role, looking after the things that Ive highlighted above. If not, youre doing it wrong. As an aside, all of this applies to other platform products such as Microsoft Dynamics CRM projects, especially if youre just tacking on an Internet-facing ASP.NET website to expose the data via the Internet. Ive mentioned this to SharePoint teams in the past and some have replied but SharePoint isnt software development. Regardless of whether it is or isnt software development, successful SharePoint projects need strong technical leadership and discipline. SharePoint projects need software architecture.
Version history
This book is a work in progress; heres a list of the essays that have been added at each version. 17th July 2012: Containers, Components, SharePoint projects need software architecture too 22nd June 2012: Moving fast requires good communication, Context, Effective sketches, Diagram review checklist 10th May 2012: Quantifying risk, Risk-storming 9th April 2012: The frustrated architect, Everybody is an architect, except when theyre not, Crossing the mythical line or bridging the gaping chasm? 13th March 2012: The software architecture role, Software architecture introduces control, Software development is not a relay sport, Where are the software architects of tomorrow?, Contextualising just enough up front design, Financial Risk System (Appendix A) 11th March 2012: Software architecture is a platform for conversation, C4: context, containers, components and classes, The code doesnt tell the whole story, Mind the gap, Just enough up front design 3rd March 2012: You dont need a UML tool, Architectural constructs, Start with the big picture, Collaborative design, Its easier to ask forgiveness than it is to get permission 21st February 2012: What is architecture?, Types of architecture?, What is software architecture?, Architecture vs design, What is the big picture?, Strategy rather than code, Is software architecture important?
27