Table of Contents
I Software architecture
1. What is “software architecture”?
- Architecture as a noun
- Architecture as a verb
- Types of architecture
- Application architecture
- System architecture
- Software architecture
- Enterprise architecture - strategy rather than code
- Architecture vs design
- Architectural significance
- Is software architecture important?
- The benefits of software architecture
- Does every software project need software architecture?
- 1. What is “software architecture”?
II The software architecture role
- 2. The software architecture role
- 3. Should software architects code?
- 4. Software architects should be master builders
- 5. From developer to architect
- 6. Broadening the T
- 7. Soft skills
- 8. Software development is not a relay sport
- 9. Software architecture introduces control?
- 10. Mind the gap
- 11. Where are the software architects of tomorrow?
- 12. Everybody is an architect, except when they’re not
- 13. Software architecture as a consultant
- 14. Questions
III Designing software
- 15. Architectural drivers
- 16. Quality Attributes (non-functional requirements)
- 17. Working with non-functional requirements
- 18. Constraints
- 19. Principles
- 20. Technology is not an implementation detail
- 21. More layers = more complexity
- 22. Collaborative design can help and hinder
- 23. Software architecture is a platform for conversation
- 24. Questions
IV Agility and the essence of software architecture
- 25. The conflict between agile and architecture - myth or reality?
- 26. Quantifying risk
- 27. Risk-storming
- 28. Just enough up front design
- 29. Agility
- 30. Introducing software architecture
- 31. Questions
- 32. Appendix A: Financial Risk System
About the book
This book is a practical, pragmatic and lightweight guide to software architecture, specifically aimed at developers, and focussed around the software architecture role and process.
Why did I write the book?
Like many people, I started my career as a software developer, taking instruction from my seniors and working with teams to deliver software systems. Over time, I started designing smaller pieces of software systems and eventually evolved into a position where I was performing what I now consider to be the software architecture role.
I’ve worked for IT consulting organisations for the majority of my career, and this means that most of the projects that I’ve been involved with have resulted in software systems being built either for or with our customers. In order to scale an IT consulting organisation, you need more people and more teams. And to create more teams, you need more software architects. And this leads me to why I wrote this book:
- Software architecture needs to be more accessible: Despite having some fantastic mentors, I didn’t find it easy to understand what was expected of me when I was moving into my first software architecture roles. Sure, there are lots of software architecture books out there, but they seem to be written from a different perspective. I found most of them very research oriented or academic in nature, yet I was a software developer looking for real-world advice. I wanted to write the type of book that I would have found useful at that stage in my career - a book about software architecture aimed at software developers.
- All software projects need software architecture: I like agile approaches, I really do, but the lack of explicit regard for software architecture in many of the approaches doesn’t sit well with me. Agile approaches don’t say that you shouldn’t do any up front design, but they often don’t explicitly talk about it either. I’ve found that this causes people to jump to the wrong conclusion and I’ve seen the consequences that a lack of any up front thinking can have. I also fully appreciate that big design up front isn’t the answer either. I’ve always felt that there’s a happy medium to be found where some up front thinking is done, particularly when working with a team that has a mix of experiences and backgrounds. I favour a lightweight approach to software architecture that allows me to put some building blocks in place as early as possible, to stack the odds of success in my favour.
- Lightweight software architecture practices: I’ve learnt and evolved a number of practices over the years, which I’ve always felt have helped me to perform the software architecture role. These relate to the software design process and identifying technical risks through to communicating and documenting software architecture. I’ve always assumed that these practices are just common sense, but I’ve discovered that this isn’t the case. I’ve taught these practices to thousands of people over the past few years and I’ve seen the difference they can make. A book helps me to spread these ideas further, with the hope that other people will find them useful too.
A new approach to software development?
This book isn’t about creating a new approach to software development, but it does seek to find a happy mid-point between the excessive up front thinking typical of traditional methods and the lack of any architecture thinking that often happens in software teams who are new to agile approaches. There is room for up front design and evolutionary architecture to coexist.
About the author
I’m an independent software development consultant specialising in software architecture; specifically technical leadership, communication and lightweight, pragmatic approaches to software architecture. In addition to being the author of Software Architecture for Developers, I’m the creator of the C4 software architecture model and I built Structurizr, which is a web-based tool to create software architecture diagrams based upon the C4 model.
I regularly speak at software development conferences, meetups and organisations around the world; delivering keynotes, presentations and workshops about software architecture. In 2013, I won the IEEE Software sponsored SATURN 2013 “Architecture in Practice” Presentation Award for my presentation about the conflict between agile and architecture. I’ve spoken at events and/or have clients in over twenty countries around the world.
Although this book has my name on the front, writing a book is never a solo activity. It’s really the product of a culmination of ideas that have evolved and discussions that have taken place over a number of years. For this reason, there are a number of people to thank.
First up are Kevin Seal, Robert Annett and Sam Dalton for lots of stuff; ranging from blog posts on Coding the Architecture and joint conference talks through to the software architecture user group that we used to run at Skills Matter (London) and for the many tech chats over a beer. Kevin also helped put together the first version of the training course that, I think, we initially ran at the QCon Conference in London, which then morphed into a 2-day training course that we have today. His classic “sound-bite” icon in the slide deck still gets people talking today. :-)
I’ve had discussions about software architecture with many great friends and colleagues over the years, both at the consulting companies where I’ve worked (Synamic, Concise, Evolution and Detica) and the customers that we’ve built software for. There are too many people to name, but you know who you are.
I’d also like to thank everybody who has attended one of my talks or workshops over the past few years, as those discussions also helped shape what you find in the book. You’ve all helped; from evolving ideas to simply helping me to explain them better.
Thanks also to Junilu Lacar and Pablo Guardiola for providing feedback, spotting typos, etc.
And I should finally thank my family for allowing me to do all of this, especially when a hectic travel schedule sometimes sees me jumping from one international consulting gig, workshop or conference to the next. Thank you.
I Software architecture
In this part of the book we’ll look at what software architecture is about, the difference between architecture and design and why thinking about software architecture is important.
1. What is “software architecture”?
Let’s start with the basics. The word “architecture” means many different things to many different people, and there are many different definitions floating around the Internet. I’ve asked thousands of software developers what “architecture” means to them and, in no particular order, a summary of their responses is as follows.
- 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
- 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
- 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
- An abstract view
- The decomposition of the problem into smaller implementable elements
- The skeleton/backbone of the product
No wonder it’s hard to find a single definition! Thankfully there are two common themes here: architecture as a noun and architecture as a verb.
Architecture as a noun
As a noun, architecture can be summarised as being about structure. It’s about the decomposition of a product into a collection of smaller building blocks and interactions/relationships between them. This needs to take into account the whole of the product, including the foundations and the infrastructure services that deal with cross-cutting concerns such as security, configuration, error handling, etc.
Architecture as a verb
As a verb, architecture (i.e. the process of creating architecture or “architecting”) is about understanding what you need to build, creating a vision for building it and making the appropriate design decisions. All of this needs to be based upon requirements because requirements drive architecture. Crucially, it’s also about communicating that vision and introducing technical leadership 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.
Types of architecture
What we have so far is a very generic definition of the word “architecture” but, of course, there are many different types of architecture and architects within the IT industry alone. Here, in no particular order, is a list of those that people most commonly identify when asked.
The unfortunate thing about this list is that some of the terms are easier to define than others, particularly those that refer to or depend upon each other for their definition. For example, what does “solution architecture” actually mean? For some organisations “solution architect” is simply a synonym for “software architect”, whereas others have a specific role that focusses on designing an overall “solution” to a problem, but stopping before the level at which implementation details are discussed. Similarly, “technical architecture” is vague enough to refer to software, hardware or a combination of the two. Interestingly, “software architecture” typically appears near the bottom of the list when I ask people to list the types of IT architecture they’ve come across. Perhaps this reflects the confusion that surrounds the term.
What do all of these terms have in common then? Well, aside from suffixing each of the terms with “architecture” or “architect”, all of these types of architecture have structure and vision in common.
Let’s take “infrastructure architecture” as an example. Imagine that you need to create a network between two offices at different ends of the country. One option is to find the largest reel of network cable that you can and start heading from one office to the other in a straight line. Assuming that you had enough cable, this could potentially work, but in reality there are a number of environmental constraints (real-world obstacles such as rivers, lakes, roads, cities, etc) and service-level agreements (performance, bandwidth, security, etc) that you need to consider in order to actually deliver something that satisfies the original goal. This is where the process of architecting and having a vision to achieve the goal is important. One single long piece of cable is an approach, but it’s not a very good one because of real-world constraints. For this reason, networks are typically much more complex and require a collection of components collaborating together in order to satisfy the goal. From an infrastructure perspective then, we can talk about structure in terms of the common components that you’d expect to see within this domain; things like routers, firewalls, packet shapers, switches, etc.
Regardless of whether you’re building a software system, a network or a database; a successful solution requires you to understand the problem and create a vision that can be communicated to everybody involved with the construction of the end-product. In order to move towards a definition of “software architecture”, let’s look at a couple of types of architecture in the IT domain that are relatively well defined.
I like to think of system architecture as one step up in scale from application architecture. If you look at most software systems, they’re actually composed of multiple applications using a number of different technologies. As an example, you might have a software system comprised of a mobile app communicating via JSON/HTTPS to a Java web application running on a server, which itself consumes data from a MySQL database. Since each of these three applications is built using a different technology, each of them will have their own internal application architecture.
However, for the overall software system to function as a whole, thought needs to be put into bringing all of those separate applications together. In other words, you also have to consider the overall structure of the end-to-end software system at a high-level. If I make a request from the mobile app, how is that request processed by the entire software system. Additionally, most software systems don’t live in isolation, so system architecture also includes the concerns around interoperability and integration with other systems within the environment.
Where application architecture tends to focus primarily on software, system architecture is about understand both software and hardware. This includes things like programming languages, libraries and frameworks through to servers and infrastructure. The reason that most definitions of system architecture include references to software and hardware is that you can’t have a successful software system without hardware, even if that hardware is virtualised somewhere out there on the cloud.
Unlike application and system architecture, which are relatively well understood, the term “software architecture” has many different meanings to many different people. Rather than getting tied up in the complexities and nuances of the many definitions of software architecture, I like to keep the definition as simple as possible. For me, software architecture is simply the combination of application and system architecture. In other words, it’s anything and everything related to the design of a software system; from the structure of the code and understanding how the whole software system works at a high level, through to how that software system is deployed onto infrastructure. But that’s not the whole story.
When we’re thinking about software development as software developers, most of our focus is placed on the code. Here, we’re thinking about things like object oriented principles, classes, interfaces, inversion of control, refactoring, automated unit testing, clean code and the countless other technical practices that help us build better software. If your team consists of people who are only thinking about this, then who is thinking about the other things such as:
- Cross-cutting concerns; including logging, exception handling, etc.
- Security; including authentication, authorisation and confidentiality of sensitive data.
- Performance, scalability, availability and other quality attributes.
- Audit and other regulatory requirements.
- Real-world constraints of the environment.
- Interoperability/integration with other software systems.
- Operational, support and maintenance requirements.
- Consistency of structure and approach to solving problems/implementing features across the codebase.
- Evaluating that the foundations you’re building will allow you to deliver what you set out to deliver.
Sometimes you need to step back, away from the code and away from your development tools. This doesn’t mean that the lower-level detail isn’t important because working software is ultimately about delivering working code. No, the detail is equally as important, but software architecture is about having a holistic view across your software system to ensure that your code is working toward your overall vision rather than against it.
Enterprise architecture - strategy rather than code
Although this book isn’t about enterprise architecture, it’s worth including a short definition so that we understand how it differs from software architecture.
Enterprise architecture generally refers to the sort of work that happens centrally and across an organisation. It looks at how to organise and utilise people, process and technology to make an organisation work effectively and efficiently. In other words, it’s about how an enterprise is broken up into groups/departments, how business processes are layered on top and how technology underpins everything. This is in very stark contrast to software architecture because it doesn’t necessarily look at technology in any detail. Instead, enterprise architecture might look at how best to use technology across the organisation without actually getting into detail about how that technology works.
While some developers and software architects do see enterprise architecture as the next logical step up the career ladder, most probably don’t. The mindset required to undertake enterprise architecture is very different to software architecture, taking a very different view of technology and its use across an organisation. Enterprise architecture requires a higher level of abstraction. It’s about breadth rather than depth and strategy rather than code.
Architecture vs design
One of the words that people use to describe architecture is “design”, and this raises the question of whether we should use these words interchangeably. Grady Booch has a well cited definition of the difference between architecture and design that really helps to answer this question. In On Design, he says that:
As a noun, design is the named (although sometimes unnameable) structure or behavior of a system whose presence resolves or contributes to the resolution of a force or forces on that system. A design thus represents one point in a potential decision space.
If you think about any problem that you’ve needed to solve, there are probably a hundred and one ways in which you could have solved it. Take your current software project for example. There are probably a number of different technologies, deployment platforms and design approaches that are also viable options for achieving the same goal. In designing your software system though, your team chose just one of the many points in the potential decision space.
Grady then goes on to say that:
All architecture is design but not all design is architecture.
This makes sense, because creating a solution is essentially a design exercise. However, for some reason, there’s a distinction being made about not all design being “architecture”, which he clarifies with the following statement:
Architecture represents the significant design decisions that shape a system, where significance is measured by cost of change.
Essentially, Grady is saying that the significant decisions are “architecture” and that everything else is “design”. In the real world, the distinction between architecture and design isn’t as clear-cut, but this definition does provide us with a basis to think about what might be significant (i.e. “architectural”) in our own software systems. For example, this could include:
- The overall shape of the software system (e.g. client-server, web-based, native mobile, distributed, microservices, asynchronous vs synchronous, etc).
- The structure of the code inside the various parts of the software system (e.g. whether the code is structured as components, layers, features, etc).
- The choice of technologies (i.e. programming language, deployment platform, etc)
- The choice of frameworks (e.g. web MVC framework, persistence/ORM framework, etc)
- The choice of design approach/patterns (e.g. the approach to performance, scalability, availability, etc)
The architectural decisions are those that you can’t reverse without some degree of effort. Or, put simply, they’re the things that you’d find hard to refactor in an afternoon.
It’s often worth taking a step back and considering what’s architecturally significant with your own software system. Imagine that you’re building a simple server-side web application that delivers information to users that is stored in a relational database. For the sake of this discussion, let’s say there are no complex requirements related to security, performance or scalability, and that the database is simply being used for data storage.
When building the web application, many teams will choose to use some sort of database abstraction layer, like an object-relational mapping framework; such as Hibernate, JPA, Entity Framework, etc. One common reason to use a database abstraction layer is to make accessing the database easier. Another common reason to use a database abstraction layer is to decouple application code from the choice of database. The use of an abstraction layer is a classic technique for decoupling distinct parts of a software system; promoting looser coupling, higher cohesion and a better separation of concerns. If you’re simply using the database for data storage, the use of the database abstraction layer allows you to, in theory, change your database without changing any code. Since the database can be changed so easily, many teams would consider the choice of database to no longer be a significant decision.
However, while the database may no longer be considered a significant decision, the choice to decouple through the introduction of an additional layer should be. If you’re wondering why, have a think about how long it would take you to swap out your current database abstraction layer or web MVC framework and replace it with another. Of course, you could add another layer over the top of your chosen database abstraction layer to further isolate your business logic and provide the ability to easily swap out your database abstraction layer but, again, you’ve made another significant decision. You’ve introduced additional layering, complexity and cost.
Although you can’t necessarily make “significant decisions” disappear entirely, you can use a number of different tactics such as architectural layering to change what those significant decisions are. Part of the process of architecting a software system is about understanding what is significant and why.
Is software architecture important?
Software architecture then, is it important? 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 there’s 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 aren’t just about good code though and you do need to step away from the code for a few moments to see the bigger picture. Ask yourself the following questions:
- Does your software system have a well defined structure?
- Is everybody on the team implementing features in a consistent way?
- Is there a consistent level of quality across the codebase?
- Is there a shared vision for how the software will be built across the team?
- Does everybody on the team have the necessary amount of technical guidance?
- Is there an appropriate amount of technical leadership?
It is possible to successfully deliver a software project by answering “no” to some of these questions, but it does require a very good team and a lot of luck. If nobody thinks about software architecture, the end result is something that typically looks like a big ball of mud. Sure, it has a structure but it’s not one that you’d want to work with! Other side effects could include the software system being too slow, insecure, fragile, unstable, hard to deploy, hard to maintain, hard to change, hard to extend, etc. I hope you’ve never seen or worked on software projects like this, but they do exist.
The benefits of software architecture
What benefits can thinking about software architecture provide? In summary:
- A clear vision and roadmap for the team to follow, regardless of whether that vision is owned by a single person or collectively by the whole team.
- Technical leadership and better coordination.
- A stimulus to talk to people in order to answer questions relating to significant decisions, quality attributes, 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 product being built.
- A structure with which to communicate the solution at different levels of abstraction to different audiences.
Does every software project need software architecture?
Rather than use the typical consulting answer of “it depends”, I’m instead going to say that the answer is undoubtedly “yes”, with the caveat that every software project should look at a number of factors in order to assess how much software architecture thinking is necessary. These include the size of the project/product, the complexity of the project/product, the size of the team and the experience of the team. The answer to how much is “just enough” will be explored throughout the rest of this book.
II The software architecture role
This part of the book focusses on the software architecture role; including what it is, what sort of skills you need and why coding, coaching and collaboration are important.
2. The software architecture role
Becoming a software architect isn’t something that simply happens overnight or with a promotion. It’s a role, not a rank. It’s the result of an evolutionary process where you’ll gradually gain the experience and confidence that you need to undertake the role. While the term “software developer” is fairly well understood, “software architect” isn’t. Here are the things that I consider to make up the software architecture role. Notice that I said “role” here; it’s something that can be performed by a single person or shared amongst the team.
1. Architectural Drivers
The first part of the role is about understanding the business goals and managing the architectural drivers, which includes the requirements (both functional and non-functional) and the constraints of the environment. Software projects often get caught up on asking users what features they want, but rarely ask them what non-functional requirements (or quality attributes) that they need. Sometimes the stakeholders will tell us that “the system must be fast”, but that’s far too subjective. Non-functional requirements and constraints often have a huge influence on the software architecture, so explicitly including them as a part of the software architecture role helps to ensure that they are considered and taken into account.
2. Designing Software
It should come as no surprise that the process of designing software is a part of the software architecture role. This is about understanding how you’re going to solve the problems posed by the architectural drivers, creating the overall structure of the software system and a vision for the delivery. Despite how agile you to strive to be, you probably do need some time to explicitly think about how your architecture is going to solve the problems set out by the stakeholders because your software system isn’t going to do this itself.
A key part of designing software is technology selection, which is typically a fun exercise but it does have its fair set of challenges. For example, some organisations have a list of approved technologies that you are forced to choose from, while others have rules in place that don’t allow open source technology with a specific licence to be used. Then you have all of the other factors such as cost, licensing, vendor relationships, technology strategy, compatibility, interoperability, support, deployment, upgrade policies, end-user environments and so on. The sum of these factors can often make a simple decision of choosing something like a rich client technology into a complete nightmare. Somebody needs to take ownership of the technology selection process and this falls squarely within the remit of the software architecture role.
3. Technical Risks
What we’ve looked at so far will help you focus on building a good solution, but it doesn’t guarantee success. Simply throwing together the best designs and the best technologies doesn’t necessary mean that the overall architecture will be successful. There’s also the question of whether the technology choices you’ve made will actually work. Many teams have a “buy over build” strategy and use products (commercial or open source) because of the potential cost savings on offer. However, many teams also get burnt because they believe the hype from vendor websites or sales executives in expensive suits. Few people seem to ask whether the technology actually works the way it is supposed to, and fewer prove that this is the case.
Technology selection is all about managing risk; reducing risk where there is high complexity or uncertainty and introducing risk where there are benefits to be had. All technology decisions need to be made by taking all factors into account, and all technology decisions need to be reviewed and evaluated. This potentially includes all of the major building blocks for a software project right down to the libraries and frameworks being introduced during the development.
The question that you need to ask yourself is whether your architecture “works”. For me, an architecture works if it satisfies the non-functional requirements, works within the given environmental constraints, provides the necessary foundations for the rest of the code and works as the platform for solving the underlying business problem. One of the biggest problems with software is that it’s complex and abstract. The result being that it’s hard to visualise the runtime characteristics of a piece of software from diagrams or even the code itself. Furthermore, I don’t always trust myself to get it right first time. Your mileage may vary though!
Throughout the software development life cycle, we undertake a number of different types of testing in order to give us confidence that the system we are building will work when delivered. So why don’t we do the same for our architecture? If we can test our architecture, we can prove that it works. And if we can do this as early as possible, we can reduce the overall risk of project failure. Like good chefs, architects should taste what they are producing. In a nutshell, this is about proactively identifying, mitigating and owning the high priority technical risks so that your project doesn’t get cancelled and you don’t get fired.
4. Architecture Evolution
More often than not, software is designed and then the baton is passed over to a development team, effectively treating software development as a relay sport. This is counterproductive because the resulting software architecture needs to be taken care of. Somebody needs to look after it, evolving it throughout the delivery in the face of changing requirements and feedback from the team. If an architect has created an architecture, why shouldn’t they own and evolve that architecture throughout the rest of the delivery too? This is about continuous technical leadership rather than simply being involved at the start of the life cycle and hoping for the best.
Most of the best software architects I know have a software development background, but for some reason many organisations don’t see this as a part of the software architecture role. Being a “hands-on software architect” doesn’t necessarily mean that you need to get involved in the day-to-day coding tasks, but it does mean that you’re continuously engaged in the delivery, actively helping to lead and shape it. Having said that, why shouldn’t the day-to-day coding activities be a part of the software architecture role?
Many software architects are master builders, so it makes sense to keep those skills up to date. In addition, coding provides a way for the architect(s) to share the software development experience with the rest of the team, which in turn helps them better understand how the architecture is viewed from a development perspective. Many companies have policies that prevent software architects from engaging in coding activities because their architects are “too valuable to undertake commodity coding work”. Clearly this is the wrong attitude. Why let your software architects put all that effort into designing software if you’re not going to let them contribute to its successful delivery?
Of course, there are situations where it’s not practical to get involved at the code level. For example, a large project generally means a bigger “big picture” to take care of and there may be times when you just don’t have the time for coding. But, generally speaking, a software architect who codes is a more effective and happier architect. You shouldn’t necessarily rule out coding just because “you’re an architect”.
6. Quality Assurance
Even with the best architecture in the world, poor delivery can cause an otherwise successful software project to fail. Quality assurance should be a part of the software architecture role, but it’s more than just doing code reviews. You need a baseline to assure against, which could mean the introduction of standards and working practices such as coding standards, design principles and tools. Quality assurance also includes ensuring that the architecture is being implemented consistently across the team. Whether you call this architectural compliance or conformance is up to you, but the technical vision needs to be followed.
It’s safe to say that most projects don’t do enough quality assurance, and therefore you need to figure out what’s important and make sure that it’s sufficiently assured. For me, the important parts of a project are anything that is architecturally significant, business critical, complex or highly visible. You need to be pragmatic though and realise that you can’t necessarily assure everything.
Collaborate or fail
It’s unusual for a software system to reside in isolation and there are a number of people that probably need to contribute to the overall architecture process. This ranges from the immediate development team who need to understand and buy in to the architecture, right through to the extended team of those people who will have an interest in the architecture from a security, database, operations, maintenance or support point of view. If you’re undertaking the software architecture role, you’ll need to collaborate with such people to ensure that the resulting software system will successfully integrate with its environment. If you don’t collaborate, expect to fail.
Technical leadership is a role, not a rank
The software architecture role is basically about introducing technical leadership into a software team and it’s worth repeating that what I’m talking about here is a role rather than a rank. Often large organisations use the job title of “Architect” as a reward for long service or because somebody wants a salary increase. And that’s fine if the person on the receiving end of the title is capable of undertaking the role but this isn’t always the case. If you’ve ever subscribed to software architecture discussion groups on LinkedIn or Stack Overflow, you might have seen questions like this.
Hi, I’ve just been promoted to be a software architect but I’m not sure what I should be doing. Help! Which books should I read?
Although I can’t stop organisations promoting people to roles above their capability, I can describe what my view of the software architecture role is. Designing software might be the fun part of the role, but a successful software project is about much more.
Create your own definition of the role
In my experience, although many software teams do understand the need for the software architecture role, they often don’t have a defined terms of reference for it. Without this, you run the risk of the role not being performed in part or in whole.
Most of the roles that we associate with software development teams are relatively well understood - developers, testers, ScrumMasters, Product Owners, business analysts, project managers, etc. The software architecture role? Not so much. I regularly ask software teams whether they have a defined terms of reference for the software architecture role and the usual answer is along the lines of “no” or “yes, but we don’t use it”. Often people working for the same team will answer the question differently.
Although the need for thinking about software architecture is usually acknowledged, the responsibilities of the software architecture role often aren’t clear. In my experience, this can lead to a situation where there is nobody undertaking the role, or where somebody is assigned the role but doesn’t really understand how they should undertake it. If the role isn’t understood, it’s not going to get done and we have little hope of growing the software architects of tomorrow.
Regardless of what you call it (e.g. Architect, Tech Lead, Principal Designer, etc), my advice is simple. If you don’t have something that you can point at and say, “this is what we expect of our software architects”, take some time to create something. Start by agreeing what is expected of the software architecture role on your team and then move to standardise it across your organisation if you see benefit in doing so.
3. Should software architects code?
Since I created a website called Coding the Architecture, I guess the answer to this question shouldn’t really come as a surprise. In my ideal view of the world, software architects should code. Somebody once told me that the key characteristic of a good architect is the ability to think in an abstract way. You can also think of it as the ability to not get caught up in the details all of the time. That’s fine, but those boxes and lines that you’re drawing do need to be coded at some point.
My recommendation is to make coding a part of your role as a software architect. You can do this by simply being an integral part of the software development team. In other words, you have a software architecture hat and a coding hat. You don’t need to be the best coder on the team, but the benefits of being hands-on and engaged in the delivery process are huge. After all, there’s a difference between “knowing” and “doing”.
Appreciating that you’re going to be contributing to the coding activities often provides enough incentive to ensure that your designs are grounded in reality. If they aren’t, you’ll soon experience that pain once you understand the problems from a developer’s perspective.
In addition to the obvious benefits associated with creating a software architecture that can actually be implemented by real people, contributing to the coding activities helps you build rapport with the rest of the team, which in turn helps to reduce the gap between architects and developers that you see on many software teams. To quote Rachel Davies and Liz Sedley from their Agile Coaching book:
If you know how to program, it’s often tempting to make suggestions about how developers should write the code. Be careful, because you may be wasting your time - developers are likely to ignore your coding experience if you’re not programming on the project. They may also think that you’re overstepping your role and interfering in how they do their job, so give such advice sparingly.
Building prototypes, frameworks and foundations
Although the software architecture role is much easier to do if you’re seen to be one of the development team, sometimes this isn’t possible. One of the problems with being promoted to or assigned as a software architect is that you might find that you can’t code as much as you’d like to. This may be down to time pressures because you have a lot of “architecture” work to do, or it might simply be down to company politics not allowing you to code. I’ve seen this happen. If this is the case, building prototypes and proof of concepts related to the software system in question is a great way to be involved. Again, this allows you to build some rapport with the team and it’s a great way to evaluate that your architecture will work.
As an alternative, you could help to build the frameworks and foundations that the rest of the team will use. Try to resist the temptation to build these things and then hand them over to the team because this approach may backfire. Software development is driven by fads and fashions much more than it really should be, so beware of building something that the rest of the team might deem to be a worthless pile of old-fashioned crap!
Performing code reviews
There’s obviously no substitute for coding on a real project, and I wouldn’t recommend this as a long-term strategy, but getting involved with (or doing) the code reviews is one way to at least keep your mind fresh with technology and how it’s being used. Again, you could damage your reputation if you start nitpicking or getting involved in discussions about technologies that you have no experience with. I remember having to explain my Java code to an architect who had never written a single line of Java in his life. It wasn’t a fun experience.
Experimenting and keeping up to date
You need to retain a certain level of technical knowledge so that you can competently design a solution using it. But if you are unable to contribute to the delivery, how do you maintain your coding skills as an architect?
Often you’ll have more scope outside of work to maintain your coding skills; from contributing to an open source project through to continuously playing with the latest language/framework/API that takes your fancy. Books, blogs, podcasts, conferences and meetups will get you so far, but sometimes you just have to break out the code. I’ve certainly done this in the past and one of the upsides of a long commute on public transport is that it does give you time to play with technology. Assuming you can keep your eyes open after a hard day at work, of course!
The tension between software architects and employers
I’ve been fortunate in that I’ve retained a large hands-on element as a part of my software architecture roles and I’ve written code on most of the development projects that I’ve been involved in. I’m a firm believer that you’re in control of creating your own opportunities. The reason I’ve remained hands-on comes down to expressing that it’s a crucial part of the role. For me, it’s simple … coding is essential when designing software because I need to keep my skills up to date and understand that what I’m designing will work. Plus, I’m not ashamed to admit that coding is fun.
Unfortunately many organisations seem to think that coding is the easy part of the software development process, which is why they see an opportunity to save some money and let somebody else do it, often in another country. Such organisations view cutting code as “low value”. Tension therefore arises because there’s a disconnect between the seniority of the software architect in the organisation and the value associated with the coding activities.
In my experience, this doesn’t happen in small organisations because everybody usually has to get involved in whatever is needed. No, it’s those larger organisations where the tension is greatest. I spent some time working for a medium size consulting firm where my job grade put me as a peer of the management team, yet I still wrote code. In some ways it was quite an achievement to be graded as an “Executive Manager” and write code on a daily basis! Yet it often felt very uncomfortable, as other managers would regularly try to push my name into boxes on the corporate organisation chart.
Being in this situation is tricky and only you can get yourself out of it. Whether you’re in an organisation where this is happening or you’re looking to move on, be clear about how you view the role of a software architect and be prepared to stand your ground.
You don’t have to give up coding
With this in mind, it should come as no surprise that I’m regularly asked whether software architects can continue to code if they are to climb the corporate career ladder. This is a shame, particularly if these people really enjoy the technical side of what they do.
My take on this is yes, absolutely, you can continue to code. For me, it’s quite frustrating to hear people say, “well, I understand that I’ll have to give up coding to become an architect or to progress further up the career path”. There are lots of organisations where this is the expectation and it’s reassuring that I’m not the only person to have been told that coding doesn’t have a place in the senior ranks of an organisation.
As a software architect, you take on a great deal of responsibility for satisfying the non-functional requirements, performing technical quality assurance, making sure the software is fit for purpose, etc. It’s a leadership role and coding (leading by example) is one of the very best ways to make sure the project is successful. And besides, if software architects don’t remain technical, who is growing the software architects of tomorrow?
Don’t code all the time
To reiterate my advice, software architects don’t have to give up coding. However you do it, coding is a great way to keep your technology skills sharp in our ever-changing world. Many people believe that software architecture is a “post-technical” career choice but it requires deep technology skills alongside a breadth of experience and more general knowledge. It requires T-shaped people who are able to answer the question of whether their design will actually work. Leaving this as an “implementation detail” is not acceptable. Just don’t code all of the time. If you’re coding all of the time, who is performing the rest of the software architecture role?
4. Software architects should be master builders
Applying the building metaphor to software doesn’t necessarily work, although in medieval times the people that architected buildings were the select few that made it into the exclusive society of master builders. The clue here is in the name and a master builder really was a master of their craft. Once elevated to this status though, did the master builder continue to build or was that task left to those less noble? Fast-forward several hundred years and it seems we’re asking the same question about the software industry.
State of the union
Software architecture has fallen out of favour over the past decade because of the association with “big up front design” and “analysis paralysis”. Much of this stems from the desire to deliver software systems more efficiently, with agile approaches being a major catalyst in reducing the quantity of up front thinking that is performed by many teams. The net result is that the role of “an architect” is now often seen as redundant on software teams. Many teams are striving to be flat and self-organising, which on the face of it negates the need for a single dedicated point of technical leadership.
The other factor here is that many believe the role of an architect is all about high-level and abstract thinking. I’m sure you’ve seen the terms “ivory tower” or “PowerPoint” architect used to refer to people that design a solution without ever considering the detail. If we go back in time though, this isn’t what the architect role was all about.
Back in time
If you trace the word “architect” back to its roots in Latin (architectus) and Greek (arkhitekton), it basically translates to “chief builder” and, as indicated by the name, these people were masters of their craft. In medieval times, the term “architect” was used to signify those people who were “master masons”, where “mason” refers to stonemasons because that’s what the majority of the buildings were constructed from at the time. This quote summarises the role well:
A master mason, then, is a manipulator of stone, an artist in stone and a designer in stone.
This quote could equally be applied to us as software developers.
Did master builders actually build?
The key question in all of this is whether the master builders actually built anything. If you do some research into how people achieved the role of “master mason”, you’ll find something similar to this:
Although a master mason was a respected and usually wealthy individual, he first had to prove his worth by going through the ranks as a stonemason and then a supervisor, before being appointed to the highest position in his trade.
The Wikipedia page for architect says the same thing:
Throughout ancient and medieval history, most architectural design and construction was carried out by artisans—such as stone masons and carpenters, rising to the role of master builder.
Interestingly, there’s no single view on how much building these master masons actually did. For example:
How much contact he actually had with this substance is, however, debatable. The terminology may differ but, as I understand it, the basic organisation and role of the medieval master mason is similar to that of the chief architect today – perhaps a reflection of the immutable fundamentals of constructing buildings.
Only when you look at what the role entailed does this truly make sense. To use another quote:
A mason who was at the top of his trade was a master mason. However, a Master Mason, by title, was the man who had overall charge of a building site and master masons would work under this person. A Master Mason also had charge over carpenters, glaziers etc. In fact, everybody who worked on a building site was under the supervision of the Master Mason.
To add some additional detail:
The master mason, then, designed the structural, aesthetic and symbolic features of what was to be built; organised the logistics that supported the works; and, moreover, prioritised and decided the order of the work.
If this is starting to sound familiar, wait until you hear how the teams used to work:
Every lesser mason followed the directions set by the master and all decisions with regard to major structural, or aesthetic, problems were his domain.
It’s certainly easy to see the parallels here in the way that many software teams have been run traditionally, and it’s not surprising that many agile software development teams aspire to adopt a different approach. Instead of a single dedicated technical leader that stays away from the detail, many modern software development teams attempt to share the role between a number of people. Of course, one of the key reasons that many architects stay away from the detail is because they simply don’t have the time. This typically leads to a situation where the architect becomes removed from the real-world day-to-day reality of the team and slowly becomes detached from them. It turns out that the master masons suffered from this problem too:
If, as seems likely, this multiplicity of tasks was normal it is hardly surprising that master masons took little part in the physical work (even had their status permitted it). Testimony of this supposition is supplied by a sermon given in 1261 by Nicholas de Biard railing against the apparent sloth of the master mason “who ordains by word alone”.
This quote from Agile Coaching (by Rachel Davies and Liz Sedley) highlights a common consequence of this in the software industry:
If you know how to program, it’s often tempting to make suggestions about how developers should write the code. Be careful, because you may be wasting your time - developers are likely to ignore your coding experience if you’re not programming on the project. They may also think that you’re overstepping your role and interfering in how they do their job, so give such advice sparingly.
To cap this off, many people see the software architecture role as an elevated position/rank within their organisation, which further exaggerates the disconnect between developer and architect. It appears that the same is true of master masons too:
In order to avoid the sort of struggle late Renaissance artists had to be recognised as more than mere artisans it would seem that master masons perpetuated a myth (as I see it) of being the descendants of noblemen. Further to this, by shrouding their knowledge with secrecy they created a mystique that separated them from other less ‘arcane’ or ‘noble’ professions.
Divergence of the master builder role
Much of this points to the idea that master builders didn’t have much time for building, even though they possessed the skills to do so. To bring this back to the software industry; should software architects write code? My short answer is “ideally, yes” and the longer answer can be found here. Why? Because technology isn’t an implementation detail and you need to understand the trade-offs of the decisions you are making.
So why don’t modern building architects help with the actual process of hands-on building? To answer this, we need to look how the role has evolved over the years:
Throughout ancient and medieval history, most architectural design and construction was carried out by artisans—such as stone masons and carpenters, rising to the role of master builder. Until modern times there was no clear distinction between architect and engineer. In Europe, the titles architect and engineer were primarily geographical variations that referred to the same person, often used interchangeably.
The Wikipedia page for structural engineering provides further information:
Structural engineering has existed since humans first started to construct their own structures. It became a more defined and formalised profession with the emergence of the architecture profession as distinct from the engineering profession during the industrial revolution in the late 19th century. Until then, the architect and the structural engineer were usually one and the same - the master builder. Only with the development of specialised knowledge of structural theories that emerged during the 19th and early 20th centuries did the professional structural engineer come into existence.
In essence, the traditional architect role has diverged into two roles. One is the structural engineer, who ensures that the building doesn’t fall over. And the other is the architect, who interacts with the client to gather their requirements and design the building from an aesthetic perspective. Martin Fowler’s bliki has a page that talks about the purpose of and difference between the roles.
A software architect is seen as a chief designer, someone who pulls together everything on the project. But this is not what a building architect does. A building architect concentrates on the interaction with client who wants the building. He focuses his mind on issues that matter to the client, such as the building layout and appearance. But there’s more to a building than that.
Building is now seen as an engineering discipline because of the huge body of knowledge behind it, which includes the laws of physics and being able to model/predict how materials will behave when they are used to construct buildings. By comparison, the software development industry is still relatively young and moves at an alarmingly fast pace. Buildings today are mostly built using the same materials as they were hundreds of years ago, but it seems like we’re inventing a new technology every twenty minutes. We live in the era of “Internet time”. Until our industry reaches the point where software can be built in the same way as a predictive engineering project, it’s crucial that somebody on the team keeps up to date with technology and is able to make the right decisions about how to design software. In other words, software architects still need to play the role of structural engineer and architect.
Achieving the role
The final thing to briefly look at is how people achieved the role of master mason. From the Wikipedia page about stonemasonry:
Medieval stonemasons’ skills were in high demand, and members of the guild, gave rise to three classes of stonemasons: apprentices, journeymen, and master masons. Apprentices were indentured to their masters as the price for their training, journeymen had a higher level of skill and could go on journeys to assist their masters, and master masons were considered freemen who could travel as they wished to work on the projects of the patrons.
This mirrors my own personal experience of moving into a software architecture role. It was an evolutionary process. Like many people, I started my career writing code under the supervision of somebody else and gradually, as I gained more experience, started to take on larger and larger design tasks. Unlike the medieval building industry though, the software development industry lacks an explicit way for people to progress from being junior developers through to software architects. We don’t have a common apprenticeship model.
Architects need to work with the teams
Herein lies the big problem for many organisations though - there aren’t enough architects to go around. Although the master masons may not have had much time to work with stone themselves, they did work with the teams. I often get asked questions from software architects who, as a part of their role, are expected to provide assistance to a number of different teams. Clearly it’s unrealistic to contribute to the hands-on elements of the software delivery if you are working with a number of different teams. You’re just not going to have the time to write any code.
Performing a software architecture role across a number of teams is not an effective way to work though. Typically this situation occurs when there is a centralised group of architects (e.g. in an “Enterprise Architecture Group”) who are treated as shared resources. From what I’ve read, the master masons were dedicated to a single building site at any one point in time and this is exactly the approach that we should adopt within our software development teams. If you think that this isn’t possible, just take a look at how the medieval building industry solved the problem:
A mason would have an apprentice working for him. When the mason moved on to a new job, the apprentice would move with him. When a mason felt that his apprentice had learned enough about the trade, he would be examined at a Mason’s Lodge.
Again, it comes back to the strong apprenticeship model in place and this is exactly why coaching and mentoring should be a part of the modern software architecture role. We need to grow the software architects of tomorrow and every software development team needs their own master builder.
5. From developer to architect
The line between software development and software architecture is a tricky one. Some people will tell you that it doesn’t exist and that architecture is simply an extension of the design process undertaken by developers. Others will make out it’s a massive gaping chasm that can only be crossed by lofty developers who believe you must always abstract your abstractions and not get bogged down by those pesky implementation details. As always, there’s a pragmatic balance somewhere in the middle, but it does raise the interesting question of how you move from one to the other.
Some of the key factors that are often used to differentiate software architecture from software design include an increase in scale, an increase in the level of abstraction and an increase in the significance of making the right design decisions. Software architecture is all about having a holistic view and seeing the “big picture” to understand how the software system works as a whole.
While this may help to differentiate software design and architecture, it doesn’t necessarily help in understanding how a software developer moves into a software architecture role. Furthermore, it also doesn’t help in identifying who will make a good software architect and how you go about finding them if you’re hiring.
Experience is a good gauge but you need to look deeper
There are a number of different qualities that you need to look for in a software architect and their past experience is often a good gauge of their ability to undertake the role. Since the role of a software architect is varied though, you need to look deeper to understand the level of involvement, influence, leadership and responsibility that has been demonstrated across a number of different areas. In conjunction with my definition of the software architecture role, each of the parts can and should be evaluated independently. After all, the software design process seems fairly straightforward. All you have to do is figure out what the requirements are and design a system that satisfies them. But in reality it’s not that simple and the software architecture role undertaken by somebody can vary wildly. For example:
- Architectural drivers: capturing and challenging a set of complex non-functional requirements versus simply assuming their existence.
- Designing software: designing a software system from scratch versus extending an existing one.
- Technical risks: proving that your architecture will work versus hoping for the best.
- Architecture evolution: being continually engaged and evolving your architecture versus choosing to hand it off to an “implementation team”.
- Coding: being involved in the hands-on elements of the delivery versus watching from the sidelines.
- Quality assurance: assuring quality and selecting standards versus being reviewed against them or doing nothing.
Much of this comes down to the difference between taking responsibility for a solution versus assuming that it’s not your problem.
The line is blurred
Regardless of whether you view the line between software development and architecture as a mythical one or a gaping chasm, people’s level of experience across the software architecture role varies considerably. Furthermore, the line between software development and software architecture is blurred somewhat. Most developers don’t wake up on a Monday morning and declare themselves to be a software architect. I certainly didn’t and my route into software architecture was very much an evolutionary process. Having said that, there’s a high probability that many software developers are already undertaking parts of the software architecture role, irrespective of their job title.
Crossing the line is our responsibility
There’s a big difference between contributing to the architecture of a software system and being responsible for it; with a continuum of skills, knowledge and experience needed across the different areas that make up the software architecture role. Crossing the line between software developer and software architect is up to us. As individuals we need to understand the level of our own experience and where we need to focus our efforts to increase it.
6. Broadening the T
Despite what you may hear some people say, software architecture is not a “post-technical” or “non-technical” career. Drawing a handful of boxes, lines and clouds on a whiteboard and handing that off as a “software design” is not what the role is all about.
Deep technology skills
“T” is for technology, and this is exactly what good software architects need to know about. As software developers, we tend to have knowledge about things like programming language syntax, APIs, frameworks, design patterns, automated unit testing and all of the other low-level technical stuff that we use on a daily basis. And this is the same basic knowledge that software architects need too. Why? Because people in the software architecture role need to understand technology, basically so that they are able to honestly answer the following types of questions:
- Is this solution going to work?
- Is that how we are going to build it?
However, given the learning curve associated with being productive in different programming languages, it’s common for software professionals to only know one or two technologies really well. Eventually these people get known for being a “Java developer” or an “Oracle developer”, for example. I’ve been there and done that myself. I’ve also seen it happen in many other organisations. If you’ve ever wondered why there are so many religious battles related to programming languages, you need look no further for how many of these start.
Although we may strive to be open-minded, it’s easy to get siloed into a single technology stack. While there’s nothing particularly wrong with this, you have to be careful that you do keep an open mind. As the saying goes, “if all you have is a hammer, everything will look like a nail”. Gaining experience is an essential part of the learning journey, but that same experience shouldn’t constrain you. As an example, you don’t need a relational database for every software system, but often this is the first thing that gets drawn when a team is sketching out a candidate software architecture.
Breadth of knowledge
And that brings me onto why it’s important for software architects to have a breadth of technology knowledge too. Sure, they may be specialists in Java or Oracle, but the role demands more. For example, the people in the software architecture role should be able to answer the following types of questions too:
- Is the technology that we’ve chosen the most appropriate given the other options available?
- What are the other options for the design and build of this system?
- Is there a common architectural pattern that we should be using?
- Do we understand the trade-offs of the decisions that we’re making?
- Have we catered for the desired quality attributes?
- How can we prove that this architecture will work?
Software architects are generalising specialists
Most of the best software architects I know have come from a software development background. This doesn’t mean that they are the best coders on a team, but they are able to switch between the low-level details and the big picture. They also have a deep technical specialism backed-up with a breadth of knowledge that they’ve gained from years of experience in building software. But they can’t (and don’t) always know everything. Plus it’s rare to find a software system that only uses a single technology stack. Some examples of systems with heterogeneous technology stacks that I’ve seen during my career include:
- A Microsoft .NET desktop client running against a number of Oracle databases.
- A Microsoft ASP.NET website pulling data from an Oracle database via a collection of Java EE web services.
- iOS and Android mobile apps pulling data from RESTful services written in Java.
- A micro-service style architecture, where various services were built using Microsoft .NET or Ruby.
- A Microsoft ASP.NET website pulling data from a Microsoft Dynamics CRM system.
- A Microsoft SharePoint website pulling data from a collection of databases via Microsoft .NET/Windows Communication Foundation services.
- A Java EE web application integrating with SAP.
Although general design knowledge, techniques, patterns and approaches often apply to a number of different technologies, not understanding how to apply them successfully at a low-level of detail can cause issues. Does this mean that the software architect should be an expert in all of the technologies that are in use on any give software system? No. Instead collaboration is key. Find somebody that does understand the things you don’t and work with them closely. Nothing says that the software architecture role can’t be shared, and often appreciating the gaps in your own knowledge is the first step to creating a more collaborative working environment. Pair programming has benefits, so why not pair architecting?
Software architecture is a technical career
Technology knowledge underpins the software architecture role, requiring a combination of deep technology skills coupled with broader knowledge. If the people designing the software and drawing the architecture diagrams can’t answer the question of whether the architecture will work, they are probably the wrong people to be doing that job. Software architecture is most definitely a technical career but that’s not the end of the story. Good soft skills are vital too.
7. Soft skills
The majority of the discussion about the software architecture role in this book relates back to having technical depth and breadth. But this is really only half the story. Since we’re essentially talking about a leadership role, “soft skills” or “people skills” are vitally important too.
- Leadership: In it’s simplest form, leadership is the ability to create a shared vision and to then take people on a journey to satisfy the common goal.
- Communication: You can have the best ideas and vision in the world, but you’re dead in the water if you’re unable to effectively communicate this to others. This means people inside and outside of the software development team, using the language and level of detail that is appropriate to the audience.
- Influencing: This is a key leadership skill and can be done a number of ways, from overt persuasion through to Neuro-Linguistic Programming or Jedi mind tricks. Influencing people can also be done through compromise and negotiation. Individuals may have their own ideas and agendas, which you need to deal with while keeping everybody “on-side” and motivated to get the result that you need. Good influencing requires good listening and exploring skills too.
- Confidence: Confidence is important, underpinning effective leadership, influence and communication. Confidence doesn’t mean arrogance though.
- Collaboration: The software architecture role shouldn’t be done in isolation, and collaboration (working with others) to come up with a better solution is a skill that is worth practicing. This means listening, being open-minded and responsive to feedback.
- Coaching: Not everybody will have experience in what you’re trying to do and you’ll need to coach people on their role, technologies, etc.
- Mentoring: Mentoring is about facilitating somebody’s learning rather than telling them how to do something. As a leader you may be asked to mentor others on the team.
- Motivation: This is about keeping the team happy, up-beat and positive. The team also needs to feel motivated to follow any vision that you create as a software architect. You will face an uphill battle without the rest of the team’s buy-in.
- Facilitation: There will often be times where you need to step back and facilitate discussions, particularly where there is conflict within the team. This requires exploration, objectivity and helping the team come up with a solution to build consensus.
- Political: There are always politics at play in every organisation. My mantra is to steer clear of getting involved as far as possible, but you should at least understand what’s going on around you so that you can make more informed decisions.
- Responsibility: You can’t necessarily blame the rest of the software development team for failure and it’s important that you have a sense of responsibility. It’s your problem if your software architecture doesn’t satisfy the business goals, deliver the non-functional requirements or the technical quality is poor.
- Delegation: Delegation is an important part of any leadership role and there’s a fine line between delegating everything and doing everything yourself. You should learn to delegate where appropriate but remember that it’s not the responsibility you’re delegating.
As a software architect, which is a leadership role however you look at it, you’re likely to be an important role model for a number of people on the development team. The reason for this? Many of the team are probably aspiring software architects themselves. Although this is a flattering situation to be in, there are some major downsides if you take your eye off the ball.
Whether you’ve recognised it or not, you’re in a very influential position and the eyes of the development team are likely to be watching your every move. For this reason alone, you have the power to change the whole dynamic of the team, whether you like it or not. If you’re motivated, the development team is likely to be motivated. If you’re enthusiastic about the work, the rest of the team is likely to be enthusiastic about the work. If you’re optimistic that everything will pan out, the development team will be too.
You can almost think of this as a self-supporting loop of positive energy where your enthusiasm drives the team, and their enthusiasm drives you. This is all fantastic but it’s not hard to see the damage that can be caused by a slip-up on your behalf. Any degree of lethargy, apathy or pessimism will rub onto your team quicker than you can say “but we’ll be okay” and you’ll start spiralling towards a vicious circle of negativity.
We don’t often talk about the softer side of being a software architect but the soft skills are sometimes more important than being technically strong. A happy team is a team that delivers. As a leader, it’s your responsibility to keep the team positive and your role in the overall team dynamics shouldn’t be underplayed.
8. Software development is not a relay sport
Software teams that are smaller and/or agile tend to be staffed with people who are generalising specialists; people that have a core specialism along with more general knowledge and experience. In an ideal world, these cross-discipline team members would work together to run and deliver a software project, undertaking everything from requirements capture and architecture through to coding and deployment. Although many software teams strive to be self-organising, in the real world they tend to be larger, more chaotic and staffed only with specialists. Therefore, these teams typically need, and often do have, somebody in the technical leadership role.
There are a lot of people out there, particularly in larger organisations, calling themselves “solution architects” or “technical architects”, who design software and document their solutions before throwing them over the wall to a separate development team. With the solution “done”, the architect will then move on to do the same somewhere else, often not even taking a cursory glimpse at how the development team is progressing. When you throw “not invented here” syndrome into the mix, there’s often a tendency for that receiving team to not take ownership of the solution and the “architecture” initially created becomes detached from reality.
I’ve met a number of such architects in the past and one particular interview I held epitomises this approach to software development. After the usual “tell me about your role and recent projects” conversation, it became clear to me that this particular architect (who worked for one of the large “blue chip” consulting firms) would create and document a software architecture for a project before moving on elsewhere to repeat the process. After telling me that he had little or no involvement in the project after he handed over the “solution”, I asked him how he knew that his software architecture would work. Puzzled by this question, he eventually made the statement that this was “an implementation detail”. He confidently viewed his software architecture as correct and it was the development team’s problem if they couldn’t get it to work. In my view, this was an outrageous thing to say and it made him look like an ass during the interview. His approach was also AaaS … “Architecture as a Service”!
Somebody needs to own the big picture
The software architecture role is a generalising specialist role, and different to your typical software developer. It’s certainly about steering the ship at the start of a software project, which includes things like managing the non-functional requirements and putting together a software design that is sensitive to the context and environmental factors. But it’s also about continuously steering the ship because your chosen path might need some adjustment en-route. After all, agile approaches have shown us that we don’t necessarily have (and need) all of the information up front.
A successful software project requires the initial vision to be created, communicated and potentially evolved throughout the entirety of the software development life cycle. For this reason alone, it doesn’t make sense for one person to create that vision and for another team to (try to) deliver it. When this does happen, the set of initial design artefacts is essentially a baton that gets passed between the architect and the development team. This is inefficient, ineffective and exchange of a document means that much of the decision making context associated with creating the vision is also lost. Let’s hope that the development team never needs to ask any questions about the design or its intent!
This problem goes away with truly self-organising teams, but most teams haven’t yet reached this level of maturity. Somebody needs to take ownership of the big picture throughout the delivery and they also need to take responsibility for ensuring that the software is delivered successfully. Software development is not a relay sport and successful delivery is not an “implementation detail”.
9. Software architecture introduces control?
Software architecture introduces structure and vision into software projects but is it also about introducing control? And if so, is control a good thing or a bad thing?
Provide guidance, strive for consistency
Many of the practices associated with software architecture are about the introduction of guidance and consistency into software projects. If you’ve ever seen software systems where a common problem or cross-cutting concern has been implemented in a number of different ways, then you’ll appreciate why this is important. A couple of examples spring to mind; I’ve seen a software system with multiple object-relational mapping (ORM) frameworks in a single codebase and another where components across the stack were configured in a number of different ways, ranging from the use of XML files on disk through to tables in a database. Deployment and maintenance of both systems was challenging to say the least.
Guidance and consistency can only be realised by introducing a degree of control and restraint, for example, to stop team members going off on tangents. You can’t have people writing database access code in your web pages if you’ve specifically designed a distributed software system in order to satisfy some of your key non-functional requirements. Control can also be about simply ensuring a clear and consistent structure for your codebase; appropriately organising your code into packages, namespaces, components, layers, etc.
How much control do you need?
The real question to be answered here relates to the amount of control that needs to be introduced. At one end of the scale you have the dictatorial approach where nobody can make a decision for themselves versus the other end of the scale where nobody is getting any guidance whatsoever. I’ve seen both in software projects and I’ve taken over chaotic projects where everybody on the team was basically left to their own devices. The resulting codebase was, unsurprisingly, a mess. Introducing control on this sort of project is really hard work but it needs to be done if the team is to have any chance of delivering a coherent piece of software that satisfies the original drivers.
Control varies with culture
I’ve also noticed that different countries and cultures place different values on control. Some (e.g. the UK) value control and the restraint that it brings whereas others (e.g. Scandinavia) value empowerment and motivation. As an example of what this means in the real world, it’s the difference between having full control over all of the technologies used on a software project (from the programming language right down to the choice of logging library) through to being happy for anybody in the team make those decisions.
A lever, not a button
I like to think of control as being a control lever rather than something binary that is either on or off. At one extreme you have the full-throttle dictatorial approach and at the other you have something much more lightweight. You also have a range of control in between the extremes allowing you to introduce as much control as is necessary. So how much control do you introduce? It’s a consulting style answer admittedly, but without knowing your context, it depends on a number of things:
- Are the team experienced?
- Has the team worked together before?
- How large is the team?
- How large is the project?
- Are the project requirements complex?
- Are there complex non-functional requirements or constraints that need to be taken into account?
- What sort of discussions are happening on a daily basis?
- Does the team or the resulting codebase seem chaotic already?
My advice would be to start with some control and listen to the feedback in order to fine-tune it as you progress. If the team are asking lots of “why?” and “how?” questions, then perhaps more guidance is needed. If it feels like the team are fighting against you all of the time, perhaps you’ve pushed that lever too far. There’s no universally correct answer, but some control is a good thing and it’s therefore worth spending a few minutes looking at how much is right for your own team.
10. Mind the gap
Our industry has a love-hate relationship with the software architecture role, with many organisations dismissing it because of their negative experience of architects who dictate from “ivory towers” and aren’t engaged with the actual task of building working software. This reputation is damaging the IT industry and inhibiting project success. Things need to change.
Developers focus on the low-level detail
If you’re working on a software development project at the moment, take a moment to look around at the rest of the team. How is the team structured? Does everybody have a well defined role and responsibilities? Who’s looking after the big picture; things like performance, scalability, availability, security and so on?
We all dream about working on a team where everybody is equally highly experienced and is able to think about the software at all levels, from the code right through to the architectural issues. Unfortunately the real world just isn’t like that. Most of the teams that I’ve worked with are made up of people with different levels of experience, some of who are new to IT and others who have “been around the block a few times”. As software developers, the code is our main focus but what happens if you have a team that only focusses on this low-level detail? Imagine a codebase where all of the latest programming language features are used, the code is nicely decoupled and testing is completely automated. The codebase can be structured and formatted to perfection but that’s no use if the system has scalability issues when deployed into a live environment.
Architects dictate from their ivory towers
The software architecture role is different to a developer role. Some people view it as a step up from being a developer, and some view it as a step sideways. However you view it, the architecture role is about looking after “the big picture”. Many teams do understand the importance of software architecture but will bring in somebody with the prestigious title of “Architect” only to stick them on a pedestal above the rest of the team. If anything, this instantly isolates the architect by creating an exaggerated gap between them and the development team they are supposed to be working with.
Reducing the gap
Unfortunately, many software teams have this unnecessary gap between the development team and the architect, particularly if the architect is seen to be dictating and laying down commandments for the team to follow. This leads to several problems.
- The development team doesn’t respect the architect, regardless of whether the architect’s decisions are right or not.
- The development team becomes demotivated.
- Important decisions fall between the gap because responsibilities aren’t well defined.
- The project eventually suffers because nobody is looking after the big picture.
Fortunately, there are some simple ways to address this problem, from both sides. Software development is a team activity after all.
If you’re a software architect:
- Be inclusive and collaborate: Get the development team involved in the software architecture process to help them understand the big picture and buy-in to the decisions you are making. This can be helped by ensuring that everybody understands the rationale and intent behind the decisions.
- Get hands-on: If possible, get involved with some of the day-to-day development activities on the project to improve your understanding of how the architecture is being delivered. Depending on your role and team size, this might not be possible, so look at other ways of retaining some low-level understanding of what’s going on such as assisting with design and code reviews. Having an understanding of how the software works at a low-level will give you a better insight into how the development team are feeling about the architecture (e.g. whether they are ignoring it!) and it will provide you with valuable information that you can use to better shape/influence your architecture. If the developers are experiencing pain, you need to feel it too.
If you’re a software developer:
- Understand the big picture: Taking some time out to understand the big picture will help you understand the context in which the architectural decisions are being made and enhance your understanding of the system as a whole.
- Challenge architectural decisions: With an understanding of the big picture, you now have the opportunity to challenge the architectural decisions being made. Architecture should be a collaborative process and not dictated by people that aren’t engaged in the project day-to-day. If you see something that you don’t understand or don’t like, challenge it.
- Ask to be involved: Many projects have an architect who is responsible for the architecture and it’s this person who usually undertakes all of the “architecture work”. If you’re a developer and you want to get more involved, just ask. You might be doing the architect a favour!
A collaborative approach to software architecture
What I’ve talked about here is easily applicable to small/medium project teams, but things do start to get complicated with larger teams. By implication, a larger team means a bigger project, and a bigger project means a bigger “big picture”. Whatever the size of project though, ensuring that the big picture isn’t neglected is crucial for success and this typically falls squarely on the architect’s shoulders. However, most software teams can benefit from reducing the unnecessary gap between developers and architects, with the gap itself being reducible from both sides. Developers can increase their architectural awareness, while architects can improve their collaboration with the rest of the team. Make sure that you mind the gap and others may follow.
11. Where are the software architects of tomorrow?
Agile and software craftsmanship are two great examples of how we’re striving to improve and push the software industry forward. We spend a lot of time talking about writing code, automated testing, automated deployment, tools, technologies and all of the associated processes. And that makes a lot of sense because the end-goal here is delivering benefit to people through software, and working software is key. But we shouldn’t forget that there are some other aspects of the software development process that few people genuinely have experience with. Think about how you would answer the following questions.
- When did you last code?
- Earlier today, I’m a software developer so it’s part of the job.
- When did you last refactor?
- I’m always looking to make my code the best I can, and that includes refactoring if necessary. Extract method, rename, pull up, push down … I know all that stuff.
- When did you last test your code?
- We test continuously by writing automated tests either before, during or after we write any production code. We use a mix of unit, integration and acceptance testing.
- When did you last design something?
- I do it all the time, it’s a part of my job as a software developer. I need to think about how something will work before coding it, whether that’s by sketching out a diagram or using TDD.
- When did you last design a software system from scratch? I mean, take a set of vague requirements and genuinely create something from nothing?
- Well, there’s not much opportunity on my current project, but I have an open source project that I work on in my spare time. It’s only for my own use though.
- When did you last design a software system from scratch that would be implemented by a team of people.
- Umm, that’s not something I get to do.
Let’s face it, most software developers don’t get to take a blank sheet of paper and design software from scratch all that frequently, regardless of whether that design is up front or evolutionary and whether it’s a solo or collaborative exercise.
Coaching, mentoring and apprenticeships
Coaching and mentoring is an overlooked activity on most software development projects, with many team members not getting the support that they need. While technical leadership is about guiding the project as a whole, there are times when individuals need assistance. In addition to this, coaching and mentoring provides a way to enhance people’s skills and to help them improve their own careers. Sometimes this assistance is of a technical nature, and sometimes it’s more about the softer skills. From a technical perspective though, why shouldn’t the people undertaking the software architecture role help out with the coaching and mentoring? Most architects that I know have got to where they are because they have a great deal of experience in one or more technical areas. If this is the case, why shouldn’t those architects share some of their experience to help others out? An apprenticeship model is exactly how the master builders of times past kept their craft alive.
We’re losing our technical mentors
The sad thing about our industry is that many developers are being forced into non-technical management positions in order to progress their careers up the corporate ladder. Ironically, it’s often the best and most senior technical people who are forced away, robbing software teams of their most valued technical leads, architects and mentors. Filling this gap tomorrow are the developers of today.
Software teams need downtime
Many teams have already lost their most senior technical people, adding more work to the remainder of the team who are already struggling to balance all of the usual project constraints along with the pressures introduced by whatever is currently fashionable in the IT industry … agile, craftsmanship, cloud, rich Internet UIs, functional programming, etc. Many teams appreciate that they should be striving for improvement, but lack the time or the incentive to do it.
To improve, software teams need some time away from the daily grind to reflect, but they also need to retain a focus on all aspects of the software development process. It’s really easy to get caught up in the hype of the industry, but it’s worth asking whether this is more important than ensuring you have a good pragmatic grounding.
Experience of coding is easy to pick up and there are plenty of ways to practice this skill. Designing something from scratch that will be implemented by a team isn’t something that you find many teams teaching or practicing though. With many technical mentors disappearing thanks to the typical corporate career ladder, where do developers gain this experience? Where are the software architects of tomorrow going to come from?
12. Everybody is an architect, except when they’re not
Many software teams strive to be agile and self-organising yet it’s not immediately obvious how the software architecture role fits into this description of modern software development teams.
Everybody is an architect
In “Extreme Programming Annealed”, Glenn Vanderburg discusses the level at which the Extreme Programming practices work, where he highlights the link between architecture and collective ownership. When we talk about collective ownership, we’re usually referring to collectively owning the code so that anybody on the team is empowered to make changes. In order for this to work, there’s an implication that everybody on the team has at least some basic understanding of the “big picture”. Think about your current project; could you jump into any part of the codebase and understand what was going on?
Imagine if you did have a team of experienced software developers that were all able to switch in and out of the big picture. A team of genuinely hands-on architects. That team would be amazing and all of the elements you usually associate with software architecture (non-functional requirements, constraints, etc) would all get dealt with and nothing would slip through the gaps. From a technical perspective, this is a self-organising team.
Except when they’re not
My big problem with the self-organising team idea is that we talk about it a lot in industry, yet I rarely see it in practice. This could be a side-effect of working in a consulting environment because my team always changes from project to project plus I don’t tend to spend more than a few months with any particular customer. Or, as I suspect, true self-organising teams are very few and far between. Striving to be self-organising is admirable but, for many software teams, this is like running before you can walk.
In “Notes to a software team leader”, Roy Osherove describes his concept of “Elastic Leadership” where the leadership style needs to vary in relation to the maturity of the team. Roy categorises the maturity of teams using a simple model, with each level requiring a different style of leadership.
- Survival model (chaos): requires a more direct, command and control leadership style.
- Learning: requires a coaching leadership style.
- Self-organising: requires facilitation to ensure the balance remains intact.
As I said, a team where everybody is an experienced software developer and architect would be amazing but this isn’t something I’ve seen happen. Most projects don’t have anybody on the team with experience of the “big picture” stuff and this is evidenced by codebases that don’t make sense (big balls of mud), designs that are unclear, systems that are slow and so on. This type of situation is the one I see the most and, from a technical perspective, I recommend that one person on the team takes responsibility for the software architecture role.
Roy uses the ScrumMaster role as an example. Teams in the initial stages of their maturity will benefit from a single person undertaking the ScrumMaster role to help drive them in the right direction. Self-organising teams, on the other hand, don’t need to be told what to do. The clue is in the name; they are self-organising by definition and can take the role upon themselves. I would say that the same is true of the software architecture, and therefore technical leadership, role.
Does agile need architecture?
Unfortunately, many teams view the “big picture” technical skills as an unnecessary evil rather than an essential complement, probably because they’ve been burnt by big design up front in the past. Some are also so focussed on the desire to be “agile” that other aspects of the software development process get neglected. Chaos rather than self-organisation ensues yet such teams challenge the need for a more direct leadership approach. After all, they’re striving to be agile and having a single point of responsibility for the technical aspects of the project conflicts with their view of what an agile team should look like. This conflict tends to cause people to think that agile and architecture are opposing forces - you can have one or the other but not both. It’s not architecture that’s the opposing force though, it’s big design up front.
Agile software projects still need architecture because all those tricky concerns around complex non-functional requirements and constraints don’t go away. It’s just the execution of the architecture role that differs.
With collective code ownership, everybody needs to be able to work at the architecture level and so everybody is an architect to some degree. Teams that aren’t at the self-organising stage will struggle if they try to run too fast though. Despite people’s aspirations to be agile, collective code ownership and a distribution of the architecture role are likely to hinder chaotic teams rather than help them. Chaotic teams need a more direct leadership approach and they will benefit from a single point of responsibility for the technical aspects of the software project. In other words, they will benefit from a single person looking after the software architecture role. Ideally this person will coach others so that they too can help with this role.
One software architect or many? Single point of responsibility or shared amongst the team? Agile or not, the software architecture role exists. Only the context will tell you the right answer.
13. Software architecture as a consultant
Most of my career has been spent working for IT consulting companies, where I’ve either built software systems for our customers under an outsourcing arrangement or with our customers as a part of a mixed customer-supplier team (this is often called “body-shopping”). Although undertaking the software architecture role within a consulting context is fundamentally the same as undertaking the role in any other context, there are some potential gotchas to be aware of.
A good working knowledge of the business domain is essential. If you’re working within the finance industry, you should know something about how your particular part of the finance industry works (e.g. funds management, investment banking, retail banking, etc). Most business domains are more complex than they really should be and even seemingly simple domains can surprise you. I remember the first time that I saw the ferry and hotel domains, which surprisingly aren’t simply about booking seats on boats or rooms in hotels. Having an appreciation of the business domain helps you to better understand the goals and create successful software products.
And this raises an interesting question. A deep knowledge of the business domain only comes from working within that domain for an extended period of time but most consultants move between different customers, teams and business domains on a regular basis. Is it therefore fair to expect consultants to possess deep domain knowledge?
There are a couple of approaches that I’ve seen people take. The first is to restrict yourself to working within a single business domain as a consultant so that you do gain a deep working knowledge of the business domain. As an example, a number of the IT consulting organisations that I’ve worked for have specialised in the investment banking industry, with consultants moving from bank to bank within that industry. This is certainly an effective way to ensure that consultants do understand the business domain, but it’s not an approach that I particularly like. Some of the consultants who I’ve worked with in the past have actually taken offence when offered a consulting role outside of investment banking. These people usually saw their deep business domain knowledge as a key differentiator or unique selling point when compared to other consultants.
A look at my bookshelf will reveal that my interests lie far more with technology than any business domain. If I wanted to work for a bank, I’d work for a bank rather than a consulting organisation. As a result, I’m happy to regularly switch between business domains and this provides a degree of variety that you can’t necessarily get from working in a single domain. I also find it interesting to see how other industries solve similar problems, and this itself leads to a number of opportunities for the cross-pollination of ideas. The downside, of course, is that my domain knowledge of any particular domain isn’t as deep as somebody who works full-time in that business domain.
To prevent this being an issue, I believe that there’s a skill in being able to understand enough about a new business domain to become proficient quickly. And that’s really my approach. If you’re a undertaking the software architecture role on a consulting basis, you need razor sharp analysis skills to understand the key parts of the business domain without getting trapped in a cycle of analysis paralysis.
The degree of control that the software architecture role needs to introduce depends on the type of software development team that you work with. Often the team can present another set of challenges though, especially if you’re working as a consultant software architect with a team of your customer’s in-house developers.
If you’re responsible for the software architecture and technical delivery of a software system, you must have the authority to make decisions. If you have the responsibility but not the authority, and are therefore continually seeking permission to make decisions, you could be in for a bumpy ride.
The software architecture role is about technical leadership and part of this means that you need to get the whole team heading in the same direction. Dictating instructions to a team of software developers isn’t likely to be very effective if you’re not their immediate line manager, which is often the case if you’re supplementing a customer team. This is where the soft skills come into play, particularly those related to building relationships, creating trust and motivating the team. I’ve found that being a hands-on, coding architect goes a long way to getting a successful outcome too.
- What’s the difference between the software architecture and software developer roles?
- What does the software architecture role entail? Is this definition based upon your current or ideal team? If it’s the latter, what can be done to change your team?
- 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 didn’t understand technology?
- If you’re the software architect on your project, how much coding are you doing? Is this too much or too little?
- If, as a software architect, you’re 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?
- Why is having a breadth and depth of technical knowledge as important?
- 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?
- Does your current software project have enough guidance and control from a software architecture perspective? Does it have too much?
- Why is collaboration an important part of the software architecture role? Does your team do enough? If not, why?
- Is there enough coaching and mentoring happening on your team? Are you providing or receiving it?
- How does the software architecture role fit into agile projects and self-organising teams?
- What pitfalls have you fallen into as somebody new to the software architecture role?
- Is there a well-defined “terms of reference” for the software architecture in your team or organisation? If so, does everybody understand it? If not, is there value in creating one to make an architect’s role and responsibilities explicit?
III Designing software
This part of the book is about the overall process of designing software, specifically looking at the things that you should really think about before coding.
15. Architectural drivers
Regardless of the process that you follow (traditional and plan-driven vs lightweight and adaptive), there’s a set of common things that really drive, influence and shape the resulting software architecture.
1. Functional requirements
In order to design software, you need to know something about the goals that it needs to satisfy. If this sounds obvious, it’s because it is. Having said that, I have seen teams designing software (and even building it) without a high-level understanding of the features that the software should provide to the end-users. Some might call this being agile, but I call it foolish. Even a rough, short list of features or user stories (e.g. a Scrum product backlog) is essential. Requirements drive architecture.
2. Quality Attributes
Quality attributes are represented by the non-functional requirements and reflect levels of service such as performance, scalability, availability, security, etc. These are mostly technical in nature and can have a huge influence over the resulting architecture, particularly if you’re building “high performance” systems or you have desires to operate at “Google scale”. The technical solutions to implementing non-functional requirements are usually cross-cutting and therefore need to be baked into the foundations of the system you’re building. Retrofitting high performance, scalability, security, availability, etc into an existing codebase is usually incredibly difficult and time-consuming.
We live in the real world and the real world has constraints. For example, the organisation that you work for probably has a raft of constraints detailing what you can and can’t do with respect to technology choice, deployment platform, etc.
Where constraints are typically imposed upon you, principles are the things that you want to adopt in order to introduce consistency and clarity into the resulting codebase. These may be development principles (e.g. code conventions, use of automated testing, etc) or architecture principles (e.g. layering strategies, architecture patterns, etc).
Understand their influence
Understanding the requirements, constraints and principles at a high-level is essential whenever you start working on a new software system or extend one that exists already. Why? Put simply, this is the basic level of knowledge that you need in order to start making design choices.
First of all, understanding these things can help in reducing the number of options that are open to you, particularly if you find that the drivers include complex non-functional requirements or major constraints such as restrictions over the deployment platform. In the words of T.S.Eliot:
When forced to work within a strict framework the imagination is taxed to its utmost - and will produce its richest ideas. Given total freedom the work is likely to sprawl.
Secondly, and perhaps most importantly, it’s about making “informed” design decisions given your particular set of goals and context. If you started designing a solution to the financial risk system without understanding the requirements related to performance (e.g. calculation complexity), scalability (e.g. data volumes), security and audit, you could potentially design a solution that doesn’t meet the goals.
Software architecture is about the significant design decisions, where significance is measured by cost of change. A high-level understanding of the requirements, constraints and principles is a starting point for those significant decisions that will ultimately shape the resulting software architecture. Understanding them early will help to avoid costly rework in the future.
16. Quality Attributes (non-functional requirements)
When you’re gathering requirements, people will happily give you a wish-list of what they want a software system to do and there are well established ways of capturing this information as user stories, use cases, traditional requirements specifications, acceptance criteria and so on. What about those pesky “non-functional requirements” though?
Non-functional requirements are often thought of as the “-ilities” and are primarily about quality of service. Alternative, arguably better yet less commonly used names for non-functional requirements include “system characteristics” or “quality attributes”. A non-exhaustive list of the common quality attributes is as follows.
Performance is about how fast something is, usually in terms of response time or latency.
- Response time: the time it takes between a request being sent and a response being received, such as a user clicking a hyperlink on a web page or a button on a desktop application.
- Latency: the time it takes for a message to move through your system, from point A to point B.
Even if you’re not building “high performance” software systems, performance is applicable to pretty much every software system that you’ll ever build, regardless of whether they are web applications, desktop applications, service-oriented architectures, messaging systems, etc. If you’ve ever been told that your software is “too slow” by your users, you’ll appreciate why some notion of performance is important.
Scalability is basically about the ability for your software to deal with more users, requests, data, messages, etc. Scalability is inherently about concurrency and therefore dealing with more stuff in the same period of time (e.g. requests per second).
Availability is about the degree to which your software is operational and, for example, available to service requests. You’ll usually see availability measured or referred to in terms of “nines”, such as 99.99% (“four nines”) or 99.999% (“five nines”). These numbers refer to the uptime in terms of a percentage. The flip side of this coin is the amount of downtime that can be tolerated. An uptime of 99.9% (“three nines”) provides you with a downtime window of just over 1 minute per day for scheduled maintenance, upgrades and unexpected failure.
Security covers everything from authentication and authorisation through to the confidentiality of data in transit and storage. As with performance, there’s a high probability that security is important to you at some level. Security should be considered for even the most basic of web applications that are deployed onto the Internet. The Open Web Application Security Project (OWASP) is a great starting point for learning about security.
What would happen if you lost a hard disk, server or data centre that your software was running on? This is what disaster recovery is all about. If your software system is mission critical, you’ll often hear people talking about business continuity processes too, which state what should happen in the event of a disaster in order to retain continued operation.
Accessibility usually refers to things like the W3C accessibility standards, which talk about how your software is accessible to people with disabilities such as visual impairments.
Some organisations have specific requirements related to how software systems should be monitored to ensure that they are running and able to service requests. This could include integrating your software with platform specific monitoring capabilities (e.g. JMX on the Java platform) or sending alerts to a centralised monitoring dashboard (e.g. via SNMP) in the event of a failure.
Monitoring typically provides a read-only view of a software system and sometimes there will be runtime management requirements too. For example, it might be necessary to expose functionality that will allow operational staff to modify the runtime topology of a system, modify configuration elements, refresh read-only caches, etc.
There’s often a need to keep a log of events (i.e. an audit log) that led to a change in data or behaviour of a software system, particularly where money is involved. Typically such logs need to capture information related to who made the change, when the change was made and why the change was made. Often there is a need retain the change itself too (i.e. before and after values).
Flexibility is a somewhat overused and vague term referring to the “flexibility” of your software to perform more than a single task, or to do that single task in a number of different ways. A good example of a flexibility requirement would be the ability for non-technical people to modify the business rules used within the software.
Extensibility is also overused and vague, but it relates to the ability to extend the software to do something it doesn’t do now, perhaps using plugins and APIs. Some off-the-shelf products (e.g. Microsoft Dynamics CRM) allow non-technical end-users to extend the data stored and change how other users interact with that data.
Maintainability is often cited as a requirement but what does this actually mean? As software developers we usually strive to build “maintainable” software but it’s worth thinking about who will be maintaining the codebase in the future. Maintainability is hard to quantify, so I’d rather think about the architecture and development principles that we’ll be following instead because they are drivers for writing maintainable code.
Legal, Regulatory and Compliance
Some industries are strictly governed by local laws or regulatory bodies, and this can lead to additional requirements related to things like data retention or audit logs. As an example, most finance organisations (investment banks, retail banks, trust companies, etc) must adhere to a number of regulations (e.g. anti-money laundering) in order to retain their ability to operate in the market.
Many software systems, particularly those deployed on the Internet, are no longer delivered in a single language. Internationalisation refers to the ability to have user-facing elements of the software delivered in multiple languages. This is seemingly simple until you try to retrofit it to an existing piece of software and realise that some languages are written right-to-left.
Related to internationalisation is localisation, which is about presenting things like numbers, currencies, dates, etc in the conventions that make sense to the culture of the end-user. Sometimes internationalisation and localisation are bundled up together under the heading of “globalisation”.
Which are important to you?
There are many quality attributes that we could specify for our software systems but they don’t all have equal weighting. Some are more applicable than others, depending on the environment that you work in and the type of software systems that you build. A web-based system in the finance industry will likely have a different set of quality attributes to an internal system used within the telco industry. My advice is to learn about the quality attributes common within your domain and focus on those first when you start building a new system or modifying an existing system.
17. Working with non-functional requirements
Regardless of what you call them, you’ll often need to put some effort into getting the list of non-functional requirements applicable to the software system that you’re building.
I’ve spent most of my 15+ year career in software development working in a consulting environment where we’ve been asked to build software for our customers. In that time, I can probably count on one hand the number of times a customer has explicitly given us information about the non-functional requirements. I’ve certainly received a large number of requirements specifications or functional wish-lists, but rarely do these include any information about performance, scalability, security, etc. In this case, you need to be proactive and capture them yourself.
And herein lies the challenge. If you ask a business sponsor what level of system availability they want, you’ll probably get an answer similar to “100%”, “24 by 7 by 365” or “yes please, we want all of it”.
Once you’ve started asking those tricky questions related to non-functional requirements, or you’ve been fortunate enough to receive some information about them, you’ll probably need to refine them.
On the few occasions that I’ve received a functional requirements specification that did include some information about non-functional requirements, they’ve usually been unhelpfully vague. As an example, I once received a 125 page document from a potential customer that detailed the requirements of the software system. The majority of the pages covered the functional requirements in quite some detail and the last half page was reserved for the non-functional requirements. It said things like:
- Performance: The system must be fast.
- Security: The system must be secure.
- Availability: The system should be running 100% of the time.
Although this isn’t very useful, at least we have a starting point for some discussions. Rather than asking how much availability is needed and getting the inevitable “24 by 7” answer, you can vary the questions depending on who you are talking to. For example:
- “How much system downtime can you tolerate?”
- “What happens if the core of the system fails during our normal working hours of 9am until 6pm?”
- “What happens if the core of the system fails outside of normal working hours?”
What you’re trying to do is explore the requirements and get to the point where you understand what the driving forces are. Why does the system need to be available? When we talk about “high security”, what is it that we’re protecting? The goal here is to get to a specific set of non-functional requirements, ideally that we can explicitly quantify. For example:
- How many concurrent users should the system support on average? What about peak times?
- What response time is deemed as acceptable? Is this the same across all parts of the system or just specific features?
- How exactly do we need to secure the system? Do we really need to encrypt the data or is restricted access sufficient?
If you can associate some quantity to the non-functional requirements (e.g. number of users, data volumes, maximum response times, etc), you can can write some acceptance criteria and objectively test them.
With this in mind, we all know what response we’ll get if we ask people whether they need something. They’ll undoubtedly say, “yes”. This is why prioritising functional requirements, user stories, etc is hard. Regardless of the prioritisation scale that you use (MoSCoW, High/Medium/Low, etc), everything will end up as a “must have” on the first attempt at prioritisation. You could create a “super-must have” category, but we know that everything will just migrate there.
A different approach is needed and presenting the cost implications can help focus the mind. For example:
- Architect: “You need a system with 100% uptime. Building that requires lots of redundancy to remove single points of failure and we would need two of everything plus a lot of engineering work for all of the automatic failover. It will cost in the region of $1,000,000. Alternatively we can build you something simpler, with the caveat that some components would need to be monitored and restarted manually in the event of a failure. This could cost in the region of $100,000. Which one do you need now?”
- Sponsor: “Oh, if that’s the case, I need the cheaper solution.”
Anything is possible but everything has a trade-off. Explaining those trade-offs can help find the best solution for the given context.
Everything that we create as software developers lives in the real world, and the real world has constraints. Like quality attributes, constraints can drive, shape and influence the architecture of a software system. They’re typically imposed upon you too, either by the organisation that you work for or the environment that you work within. Constraints come in many different shapes and sizes.
Time and budget constraints
Time and budget are probably the constraints that most software developers are familiar with, often because there’s not enough of either.
There are a number of technology related constraints that we often come up against when building software, particularly in large organisations:
- Approved technology lists: Many large organisations have a list of the technologies they permit software systems to be built with. The purpose of this list is to restrict the number of different technologies that the organisation has to support, operate, maintain and buy licenses for. Often there is a lengthy exceptions process that you need to formally apply for if you want to use anything “off list”. I’ve still seen teams use Groovy or Scala on Java projects through the sneaky inclusion of an additional JAR file though!
- Existing systems and interoperability: Most organisations have existing systems that you need to integrate your software with and you’re often very limited in the number of ways that you can achieve this. At other times, it’s those other systems that need to integrate with whatever you’re building. If this is the case, you may find that there are organisation-wide constraints dictating the protocols and technologies you can use for the integration points. A number of the investment banks I’ve worked with have had their own internal XML schemas for the exchange of trading information between software systems. “Concise” and “easy to use” weren’t adjectives that we used to describe them!
- Target deployment platform: The target deployment platform is usually one of the major factors that influences the technology decisions you make when building a greenfield software system. This includes embedded devices, the availability of Microsoft Windows or Linux servers and the cloud. Yes, even this magical thing that we call the cloud has constraints. As an example, every “platform as a service” (PaaS) offering is different, and most have restrictions on what your software can and can’t do with things like local disk access. If you don’t understand these constraints, there’s a huge danger that you’ll be left with some anxious rework when it comes to deployment time.
- Technology maturity: Some organisations are happy to take risks with bleeding edge technology, embracing the risks that such advancements bring. Other organisations are much more conservative in nature.
- Open source: Likewise, some organisations still don’t like using open source unless it has a name such as IBM or Microsoft associated with it. I once worked on a project for a high-street bank who refused to use open source, yet they were happy to use a web server from a very well-known technology brand. The web server was the open source Apache web server in disguise. Such organisations simply like having somebody to shout at when things stop working. Confusion around open source licenses also prevents some organisations from fully adopting open source too. You may have witnessed this if you’re ever tried to explain the difference between GPL and LGPL.
- Vendor “relationships”: As with many things in life, it’s not what you know, it’s who you know. Many partnerships are still forged on the golf course by vendors who wine and dine Chief Technology Officers. If you’ve ever worked for a large organisation and wondered why your team was forced to use something that was obviously substandard, this might be the reason!
- Past failures: Somewhere around the year 2000, I walked into a bank with a proposal to build them a solution using Java RMI - a technology to allow remote method calls across Java virtual machines. This was met with great resistance because the bank had “tried it before and it doesn’t work”. That was the end of that design and no amount of discussion would change their mind. Java RMI was banned in this environment due to a past failure. We ended up building a framework that would send serialized Java objects over HTTP to a bunch of Java Servlets instead (a workaround to reinvent the same wheel).
- Internal intellectual property: When you need to find a library or framework to solve some problem that you’re facing, there’s a high probability that there’s an open source or commercial product out there that suits your needs. This isn’t good enough for some people though and it’s not uncommon to find organisations with their own internal logging libraries, persistence frameworks or messaging infrastructures that you must use, despite whether they actually work properly. I recently heard of one organisation that built their own CORBA implementation.
More often than not, the people around you will constrain the technologies and approaches that are viable to use when developing software. For example:
- How large is your development team?
- What skills do they have?
- How quickly can you scale your development team if needed?
- Are you able to procure training, consulting and specialists if needed?
- If you’re handing over your software after delivery, will the maintenance team have the same skills as your development team?
There will be an overhead if you ask a Java team to build a Microsoft .NET solution, so you do need to take people into account whenever you’re architecting a software system.
There are sometimes other constraints that you’ll need to be aware of, including:
- Is the software system part of a tactical or strategic implementation? The answer to this question can either add or remove constraints.
- Organisational politics can sometimes prevent you from implementing the solution that you really want to.
Are all constraints bad?
Constraints usually seem “bad” at the time that they’re being imposed, but they’re often imposed for a good reason. For example, large organisations don’t want to support and maintain every technology under the sun, so they try to restrict what ends up in production. On the one hand this can reduce creativity but, on the other, it takes away a large number of potential options that would have been open to you otherwise. Software architecture is about introducing constraints too. How many logging or persistence libraries do you really want in a single codebase?
Constraints can be prioritised
As a final note, it’s worth bearing in mind that constraints can be prioritised. Just like functional requirements, some constraints are more important than others and you can often use this to your advantage. The financial risk system that I use as a case study in my training is based upon a real project that I worked on for a consulting company in London. One of the investment banks approached us with their need for a financial risk system and the basic premise behind this requirement was that, for regulatory reasons, the bank needed to have a risk system in place so that they could enter a new market segment.
After a few pre-sales meetings and workshops, we had a relatively good idea of their requirements plus the constraints that we needed to work within. One of the major constraints was an approved list of technologies that included your typical heavyweight Java EE stack. The other was a strict timescale constraint.
When we prepared our financial proposal, we basically said something along the lines of, “yes, we’re confident that we can deliver this system to meet the deadline, but we’ll be using some technologies that aren’t on your approved technology list, to accelerate the project”. Our proposal was accepted. In this situation, the timescale constraint was seen as much more important than using only the technologies on the approved technology list and, in effect, we prioritised one constraint over the other. Constraints are usually obstacles that you need to work around, but sometimes you can trade the off against one another.
Listen to the constraints
Every software system will be subject to one or more constraints, and part of the software architecture role is to seek these out, understand why they are being imposed and let them help you shape the software architecture. Failing to do this may lead to some nasty surprises.
While constraints are imposed upon you, principles are the things that you want to adopt in order to introduce standard approaches, and therefore consistency, into the way that you build software. There are a number of common principles, some related to development and others related to architecture.
The principles that many software developers instantly think of relate to the way in which software should be developed. For example:
- Coding standards and conventions: “We will adopt our in-house coding conventions for [Java|C#|etc], which can be found on our corporate wiki.”
- Automated unit testing: “Our goal is to achieve 80% code coverage for automated unit tests across the core library, regardless of whether that code is developed using a test-first or test-last approach.”
- Static analysis tools: “All production and test code must pass the rules defined in [Checkstyle|FxCop|etc] before being committed to source code control.”
There are also some principles that relate to how the software should be structured. For example:
- Layering strategy: A layered architecture usually results in a software system that has a high degree of flexibility because each layer is isolated from those around it. For example, you may decompose your software system into a UI layer, a business layer and a data access layer. Making the business layer completely independent of the data access layer means that you can (typically) switch out the data access implementation without affecting the business or UI layers. You can do this because the data access layer presents an abstraction to the business layer rather than the business layer directly dealing with the data storage mechanism itself. If you want to structure your software this way, you should ensure that everybody on the development team understands the principle. “No data access logic in the UI components or domain objects” is a concrete example of this principle in action.
- Placement of business logic: Sometimes you want to ensure that business logic always resides in a single place for reasons related to performance or maintainability. In the case of Internet-connected mobile apps, you might want to ensure that as much processing as possible happens on the server. Or if you’re integrating with a legacy back-end system that already contains a large amount of business logic, you might want to ensure that nobody on the team attempts to duplicate it.
- High cohesion, low coupling, SOLID, etc: There are many principles related to the separation of concerns, focussing on building small highly cohesive building blocks that don’t require too many dependencies in order to do their job.
- Stateless components: If you’re building software that needs to be very scalable, then designing components to be as stateless as possible is one way to ensure that you can horizontally scale-out your system by replicating components to share the load. If this is your scalability strategy, everybody needs to understand that they must build components using the same pattern. This will help to avoid any nasty surprises and scalability bottlenecks in the future.
- Stored procedures: Stored procedures in relational databases are like Marmite - you either love them or you hate them. There are advantages and disadvantages to using or not using stored procedures, but I do prefer it when teams just pick one approach for data access and stick to it. There are exceptions to every principle though.
- Domain model - rich vs anaemic: Some teams like having a very rich domain model in their code, building systems that are very object-oriented in nature. Others prefer a more anaemic domain model where objects are simply data structures that are used by coarse-grained components and services. Again, consistency of approach goes a long way.
- Use of the HTTP session: If you’re building a website, you may or may not want to use the HTTP session for storing temporary information between requests. This can often depend on a number of things including what your scaling strategy is, where session-backed objects are actually stored, what happens in the event of a server failure, whether you’re using sticky sessions, the overhead of session replication, etc. Again, everybody on the development team should understand the desired approach and stick to it.
- Always consistent vs eventually consistent: Many teams have discovered that they often need to make trade-offs in order to meet complex non-functional requirements. For example, some teams trade-off data consistency for increased performance and/or scalability. Provided that we do see all Facebook status updates, does it really matter if we all don’t see them immediately? Your context will dictate whether immediate or delayed consistency is appropriate, but a consistent approach is important.
Beware of “best practices”
If you regularly build large enterprise software systems, you might consider most of the principles that I’ve just listed to be “best practices”. But beware. Even the most well-intentioned principles can sometimes have unintended negative side-effects. That complex layering strategy you want to adopt to ensure a complete separation of concerns can suck up a large percentage of your time if you’re only building a quick, tactical solution. Principles are usually introduced for a good reason, but that doesn’t make them good all of the time.
The size and complexity of the software you’re building, plus the constraints of your environment, will help you decide which principles to adopt. Context, as always, is key. Having an explicit list of principles can help to ensure that everybody on the team is working in the same way but you do need to make sure these principles are helping rather then hindering. Listening to the feedback from the team members will help you to decide whether your principles are working or not.
20. Technology is not an implementation detail
I regularly run training classes where I ask small groups of people to design a simple financial risk system. In most cases, the resulting software architecture diagrams don’t show any technology decisions. Here are some of the typical responses to the question of why this is the case:
- “the [risk system] solution is simple and can be built with any technology”.
- “we don’t want to force a solution on developers”.
- “it’s an implementation detail”.
- “we follow the ‘last responsible moment’ principle”.
I firmly believe that technology choices should be included on architecture diagrams but there’s a separate question here about why people don’t feel comfortable making technology decisions. Saying that “it can be built with any technology” doesn’t mean that it should. Here’s why.
1. Do you have complex non-functional requirements?
True, most software systems can be built with pretty much any technology; be it Java, .NET, Ruby, Python, PHP, etc. If you look at the data storage requirements for most software systems, again, pretty much any relational database is likely to be able to do the job. Most software systems are fairly undemanding in terms of the non-functional characteristics, so any mainstream technology is likely to suffice.
But what happens if you do have complex non-functional requirements such as high performance and/or scalability? Potentially things start to get a little trickier and you should really understand whether your technology (and architecture) choices are going to work. If you don’t consider your non-functional requirements, there’s a risk that your software system won’t satisfy its goals.
2. Do you have constraints?
Many organisations have constraints related to the technologies that can be used and the skills (people) that are available to build software. Some even dictate that software should be bought and/or customised rather than built. Constraints can (and will) influence the software architecture that you come up with. Challenge them by all means, but ignore them and you risk delivering a software system that doesn’t integrate with your organisation’s existing IT environment.
3 Do you want consistency?
Imagine you’re building a software system that stores data in a relational database. Does it matter how individual members of the development team retrieve data from and store data to the database when implementing features? I’ve seen a Java system where there were multiple data access techniques/frameworks adopted in the same codebase. And I’ve seen a SharePoint system where various components were configured in different ways. Sometimes this happens because codebases evolve over time and approaches change, but often it’s simply a side-effect of everybody on the development team having free rein to choose whatever technology/framework/approach they are most familiar with.
People often ask me questions like, “does it really matter which logging framework we choose?”. If you want everybody on the development team to use the same one, then yes, it does. Some people are happy to allow anybody on the development team to download and use any open source library that they want to. Others realise this can lead to problems if left unchecked. I’m not saying that you should stifle innovation, but you should really only have a single logging, dependency injection or object-relational mapping framework in a codebase.
A lack of a consistent approach can lead to a codebase that is hard to understand, maintain and enhance. Increasing the number of unique moving parts can complicate the deployment, operation and support too.
Deferral vs decoupling
It’s worth briefly talking about deferring technology decisions and waiting until “the last responsible moment” to make a decision. Let’s imagine that you’re designing a software system where there aren’t any particularly taxing non-functional requirements or constraints. Does it matter which technologies you choose? And shouldn’t a good architecture let you change your mind at a later date anyway?
Many people will say, for example, that it really doesn’t matter which relational database you use, especially if you decouple the code that you write from a specific database implementation using an object-relational mapping layer such as Hibernate, Entity Framework or ActiveRecord. If you don’t have any significant non-functional requirements or constraints, and you truly believe that all relational databases are equal, then it probably doesn’t matter which you use. So yes, you can decouple the database from your code and defer the technology decision. But don’t forget, while your choice of database is no longer a significant decision, your choice of ORM is. You can decouple your code from your ORM by introducing another abstraction layer, but again you’ve made a significant decision here in terms of the structure of your software system.
Decoupling is a great approach for a number of reasons plus it enables technology decisions to be deferred. Of course, this doesn’t mean that you should defer decisions though, especially for reasons related to the presence of non-functional requirements and constraints.
Every decision has trade-offs
Much of this comes back to the fact that every technology has it’s own set of advantages and disadvantages, with different options not necessarily being swappable commodities. Relational database and web application frameworks are two typical examples of a technology space that is often seen as commoditised. Likewise with many cloud providers, but even these have their trade-offs related to deployment, monitoring, management, cost, persistent access to disk and so on.
At the end of the day, every technology choice you make will have a trade-off whether that’s related to performance, scalability, maintainability, the ability to find people with the right experience, etc. Understanding the technology choices can also assist with high-level estimating and planning, which is useful if you need to understand whether you can achieve your goal given a limited budget.
If you don’t understand the trade-offs that you’re making by choosing technology X over Y, you shouldn’t be making those decisions. It’s crucial that the people designing software systems understand technology. This is why software architects should be master builders.
Technology isn’t just an “implementation detail” and the technology decisions that you make are as important as the way that you decompose, structure and design your software system. Defer technology decisions at your peril.
21. More layers = more complexity
One of the key functional requirements of the financial risk system case study that we run through on the training course is that the solution should be able to distribute data to a subset of users on a corporate LAN. Clearly there are 101 different ways to solve this problem, with one of the simplest being to allow the users to access the data via an internal web application. Since only a subset of the users within the organisation should be able to see the data, any solution would need some sort of authentication and authorisation on the data.
Given the buzz around Web 2.0 and Rich Internet Applications in recent times, one of the groups on a training course decided that it would be nice to allow the data to be accessed via a Microsoft Silverlight application. They’d already thought about building an ASP.NET application but liked the additional possibilities offered by Silverlight, such as the ability to slice and dice the data interactively. Another driving factor for their decision was that the Silverlight client could be delivered “for free” in that it would take “just as long to build as an ASP.NET application”. “For free” is a pretty bold claim, especially considering that they were effectively adding an extra architectural layer into their software system. I sketched up the following summary of their design to illustrate the added complexity.
While I don’t disagree that Silverlight applications aren’t hard to build, the vital question the group hadn’t addressed was where the data was going to come from. As always, there are options; from accessing the database directly through to exposing some data services in a middle-tier. The group had already considered deploying some Windows Communication Foundation (WCF) services into the IIS web server as the mechanism for exposing the data, but this led to yet further questions.
- What operations do you need to expose to the Silverlight client?
- Which technology binding and protocol would you use?
- How do you ensure that people can’t plug in their own bespoke WCF client and consume the services?
- How do you deploy and test it?
In the context of the case study, the third question is important. The data should only be accessible by a small number of people and we really don’t want to expose a web service that anybody with access to a development tool could consume.
Most security conscious organisations have their self-hosted public facing web servers firewalled away in a DMZ, yet I’ve seen some software systems where those same secured web servers subsequently access unsecured web services residing on servers within the regular corporate LAN. Assuming that I can connect a laptop to the corporate LAN, there’s usually nothing to stop me firing up a development tool such as Microsoft Visual Studio, locating the service definition (e.g. a WSDL file) and consuming the web service for my own misuse. In this case, thought needs to be given to authentication and authorisation of the data service as well as the Silverlight client. A holistic view of security needs to be taken.
Time and budget - nothing is free
Coming back to the claim that building a Silverlight client won’t take longer than building an ASP.NET application; this isn’t true because of the additional data services that need to be developed to support the Silverlight client. In this situation, the benefits introduced by the additional rich client layer need to be considered on the basis that additional complexity is also being introduced. All architecture decisions involve trade-offs. More moving parts means more work designing, developing, testing and deploying. Despite what vendor marketing hype might say, nothing is ever free and you need to evaluate the pros and cons of adding additional layers into a design, particularly if they result in additional inter-process communication.
22. Collaborative design can help and hinder
Let’s imagine that you’ve been tasked with building a 3-tier web application and you have a small team that includes people with specialisms in web technology, server-side programming and databases. From a resourcing point of view this is excellent because collectively you have experience across the entire stack. You shouldn’t have any problems then, right?
The effectiveness of the overall team comes down to a number of factors, one of them being people’s willingness to leave their egos at the door and focus on delivering the best solution given the context. Sometimes though, individual specialisms can work against a team; simply through a lack of experience in working as a team or because ego gets in the way of the common goal. If there’s a requirement to provide a way for a user to view and manipulate data on our 3-tier web application, you’ll probably get a different possible approach from each of your specialists.
- Web developer: Just give me the data as JSON and we can do anything we want with it on the web-tier. We can even throw in some JQuery to dynamically manipulate the dataset in the browser.
- Server-side developer: We should reuse and extend some of the existing business logic in the middle-tier service layer. This increases reuse, is more secure than sending all of the data to the web-tier and we can write automated unit tests around it all.
- Database developer: You’re both idiots. It’s way more efficient for me to write a stored procedure that will provide you with exactly the data that you need. :-)
Experience influences software design
Our own knowledge, experience and preferences tend to influence how we design software, particularly if it’s being done as a solo activity. In the absence of communication, we tend to make assumptions about where components will sit and how features will work based upon our own mental model of how the sofware should be designed. Getting these assumptions out into the open as early as possible can really help you avoid some nasty surprises before it’s too late. One of the key reasons I prefer using a whiteboard to design software is because it encourages a more collaborative approach than somebody sitting on their own in front of their favourite modelling tool on a laptop. If you’re collaborating, you’re also communicating and challenging each other.
Like pair programming, collaborating is an effective way to approach the software design process, particularly if it’s done in a lightweight way. Collaboration increases quality plus it allows us to discuss and challenge some of the common assumptions that we make based our own knowledge, experience and preferences. It also paves the way for collective ownership of the code, which again helps to break down the silos that often form within software development teams. Everybody on the team will have different ideas and those different ideas need to meet.
23. Software architecture is a platform for conversation
If you’re writing software as a part of your day-to-day job, then it’s likely that your software isn’t going to live in isolation. We tend to feel safe in our little project teams, particularly when everybody knows each other and team spirits are high. We’ve even built up development processes around helping us communicate better, prioritise better and ultimately deliver better software. However, many software projects are still developed in isolation by teams that are locked away from their users and their operational environments.
The success of agile methods has shown us that we need to have regular communication with the end-users or their representatives so we can be sure we’re building software that will meet their needs. But what about all of those other stakeholders? Project teams might have a clear vision about what the software should do but often you’ll hear phrases like this, often late in the delivery cycle.
- “Nobody told us you needed a production database created on this server.”
- “We can’t upgrade to [Java 7|.NET 4] on that server until system X is compatible.”
- “We don’t have spare production licenses.”
- “Sorry, that contravenes our security policy.”
- “Sorry, we’ll need to undertake some operational acceptance testing before we promote your application into the production environment.”
- “How exactly are we supposed to support this application?”
- “I don’t care if you have a completely automated release process … I’m not giving you the production database credentials for your configuration files.”
- “We need to run this past the risk and compliance team.”
- “There’s no way your system is going on the public cloud.”
Software development isn’t just about delivering features
The people who use your software are just one type of stakeholder. There are usually many others including:
- Current development team: The current team need to understand the architecture and be aware of the drivers so that they produce a solution that is architecturally consistent and “works”.
- Future development team: Any future development/maintenance teams need to have the same information to hand so that they understand how the solution works and are able to modify it in a consistent way.
- Other teams: Often your software needs to integrate with other systems within the environment, from bespoke software systems through to off-the-shelf vendor products, so it’s crucial that everybody agrees on how this will work.
- Database administrators: Some organisations have separate database teams that need to understand how your solution uses their database services (e.g. from design and optimisation through to capacity planning and archiving).
- Operations/support staff: Operational staff typically need to understand how to run and support your system (e.g. configuration and deployment through to monitoring and problem diagnostics).
- Compliance, risk and audit: Some organisations have strict regulations that they need to follow and people in your organisation may need to certify that you’re following them too.
- Security team: Likewise with security; some organisations have dedicated security teams that need to review systems before they are permitted into production environments.
These are just some of the stakeholders that may have an interest in your architecture, but there are probably others depending on your organisation and the way that it works. If you think you can put together a software architecture in an ivory tower on your own, you’re probably doing it wrong. Software architectures don’t live in isolation and the software design process is a platform for conversation. A five minute conversation now could help capture those often implied architectural drivers and improve your chance of a successful delivery.
- What are the major factors that influence the resulting architecture of a software system? Can you list those that are relevant to the software system that you are working on?
- What are non-functional requirements and why are they important? When should you think about non-functional requirements?
- Time and budget are the constraints that most people instantly relate to, but can you identify more?
- Is your software development team working with a well-known set of architectural principles? What are they? Are they clearly understood by everybody on the team?
- How do you approach the software design process? Does your team approach it in the same way? Can it be clearly articulated? Can you help others follow the same approach?
IV Agility and the essence of software architecture
This, the final part of the book, is about how everything else covered in the book fits into the day-to-day world of software development. We’ll also answer the question of how much software architecture (and therefore, up front design) you should do and how to create firm foundations.
25. The conflict between agile and architecture - myth or reality?
The words “agile” and “architecture” are often seen as mutually exclusive but the real world often tells a different story. Some software teams see architecture as an unnecessary evil whereas others have reached the conclusion that they do need to think about architecture once again.
Architecture can be summarised as being about structure and vision, with a key part of the process focussed on understanding the significant design decisions. Unless you’re running the leanest of startups and you genuinely don’t know which direction you’re heading in, even the most agile of software projects will have some architectural concerns and these things really should be thought about up front. Agile software projects therefore do need “architecture”, but this seems to contradict with how agile has been evangelised for the past 10+ years. Put simply, there is no conflict between agile and architecture because agile projects need architecture. So, where is the conflict then?
Conflict 1: Team structure
The first conflict between architecture and agile software development approaches is related to team structure. Traditional approaches to software architecture usually result in a dedicated software architect, triggering thoughts of ivory tower dictators who are a long way removed from the process of building software. This unfortunate stereotype of “solution architects” delivering large design documents to the development team before running away to cause havoc elsewhere has resulted in a backlash against having a dedicated architect on a software development team.
One of the things that agile software development teams strive towards is reducing the amount of overhead associated with communication via document hand-offs. It’s rightly about increasing collaboration and reducing waste, with organisations often preferring to create small teams of generalising specialists who can turn their hand to almost any task. Indeed, because of the way in which agile approaches have been evangelised, there is often a perception that agile teams must consist of cross-discipline team members and simply left to self-organise. The result? Many agile teams will tell you that they “don’t need no stinkin’ architects”!
Conflict 2: Process and outputs
The second conflict is between the process and the desired outputs of agile versus those of big up front design, which is what people usually refer to when they talk about architecture. One of the key goals of agile approaches is to deliver customer value, frequently and in small chunks. It’s about moving fast, getting feedback and embracing change. The goal of big design up front is to settle on an understanding of everything that needs to be delivered before putting a blueprint (and usually a plan) in place.
The agile manifesto values “responding to change” over “following a plan”, but of course this doesn’t mean you shouldn’t do any planning and it seems that some agile teams are afraid of doing any “analysis” at all. The result is that in trying to avoid big up front design, agile teams often do not design up front and instead use terms like “emergent design” or “evolutionary architecture” to justify their approach. I’ve even heard teams claim that their adoption of test-driven development (TDD) negates the need for “architecture”, but these are often the same teams that get trapped in a constant refactoring cycle at some point in the future.
Software architecture provides boundaries for TDD, BDD, DDD, RDD and clean code
One of the recurring questions I get asked whenever I talk to teams about software architecture is how it relates to techniques such as TDD, BDD, DDD, RDD, etc. The question really relates to whether xDD is a substitute for “software architecture”, particularly within “agile environments”. The short answer is no. The slightly longer answer is that the process of thinking about software architecture is really about putting some boundaries in place, inside which you can build your software using whatever xDD and agile practices you like.
For me, the “why?” is simple - you need to think about the architectural drivers (the things that play a huge part in influencing the resulting software architecture), including:
- Functional requirements: Requirements drive architecture. You need to know vaguely what you’re building, irrespective of how you capture and record those requirements (i.e. user stories, use cases, requirements specifications, acceptance tests, etc).
- Quality attributes: The non-functional requirements (e.g. performance, scalability, security, etc) are usually technical in nature and are hard to retrofit. They ideally need to be baked into the initial design and ignoring these qualities will lead you to a software system that is either over- or under-engineered.
- Constraints: The real-world usually has constraints; ranging from approved technology lists, prescribed integration standards, target deployment environment, size of team, etc. Again, not considering these could cause you to deliver a software system that doesn’t complement your environment, adding unnecessary friction.
- Principles: These are the things that you want to adopt in an attempt to provide consistency and clarity to the software. From a design perspective, this includes things like your decomposition strategy (e.g. layers vs components vs micro-services), separation of concerns, architectural patterns, etc. Explicitly outlining a starting set of principles is essential so that the team building the software starts out heading in the same direction.
Separating architecture from ivory towers and big up front design
These conflicts, in many cases, lead to chaotic teams that lack an appropriate amount of technical leadership. The result? Software systems that look like big balls of mud and/or don’t satisfy key architectural drivers such as non-functional requirements.
Architecture is about the stuff that’s hard or costly to change. It’s about the big or “significant” decisions, the sort of decisions that you can’t easily refactor in an afternoon. This includes, for example, the core technology choices, the overall high-level structure (the big picture) and an understanding of how you’re going to solve any complex/risky/significant problems. Software architecture is important.
Big up front design typically covers these architectural concerns but it also tends to go much further, often unnecessarily so. The trick here is to differentiate what’s important from what’s not. Defining a high-level structure to put a vision in place is important. Drawing a countless number of detailed class diagrams before writing the code most likely isn’t. Understanding how you’re going to solve a tricky performance requirement is important, understanding the length of every database column most likely isn’t.
Agile and architecture aren’t in conflict. Rather than blindly following what others say, software teams need to cut through the hype and understand the technical leadership style and quantity of up front design that they need given their own unique context.
Considering the architectural drivers needn’t take very long and can provide you with a starting point for the rest of the software design activities. Of course, this doesn’t mean that the architecture shouldn’t be changed, especially when you start writing code and getting feedback. The point is that you now have a framework and some boundaries to work within, which provide some often needed vision and guidance for the team. My experience suggests that a little direction can go a long way.
26. 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.
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.
It’s often difficult to prioritise which risks you should take care of and if you get it wrong, you’ll put the risk mitigation effort in 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.
Risk identification is a crucial part of doing “just enough up front design” but it’s something that many software teams shy away from because it’s often seen as a boring chore. Risk-storming is a quick, fun, collaborative and visual technique for identifying risk that the whole team can take part in. There are 4 steps.
Step 1. Draw some architecture diagrams
The first step is to draw some architecture diagrams on whiteboards or large sheets of flip chart paper. Ideally this should be a collection of diagrams at different levels of abstraction because each diagram will allow you to highlight different risks across your architecture. Large diagrams are better.
Step 2. Identify the risks individually
Risks can be subjective, so ask everybody on the team (architects, developers, project managers, operational staff, etc) to stand in front of the architecture diagrams and individually write down the risks that they can identify, one per sticky note. Additionally, ask people to quantify each risk based upon probability and impact. Ideally, use different colours of sticky note to represent the different risk priorities. You can timebox this part of the exercise to 5-10 minutes to ensure that it doesn’t drag on and this step should be done in silence, with everybody keeping their sticky notes hidden. Here are some examples of the risks to look for:
- Data formats from third-party systems change unexpectedly.
- External systems become unavailable.
- Components run too slowly.
- Components don’t scale.
- Key components crash.
- Single points of failure.
- Data becomes corrupted.
- Infrastructure fails.
- Disks fill up.
- New technology doesn’t work as expected.
- New technology is too complex to work with.
As with software development estimates, people’s perceptions of risk can be subjective based upon their experience. If you’re planning on using a new technology, hopefully somebody on the team will identify that there is a risk associated with doing this. Also, somebody might quantify the risk of using new technology relatively highly whereas others might not feel the same if they’ve used that same technology before. Identifying risks individually allows everybody to contribute to the risk identification process and you’ll gain a better view of the risks perceived by the team rather than only from those designing the software or leading the team.
Step 3. Converge the risks on the diagrams
Next, ask everybody to place their sticky notes onto the architecture diagrams, sticking them in close proximity to the area where the risk has been identified. For example, if you identify a risk that one of your components will run too slowly, put the sticky note over the top of that component on the architecture diagram.
This part of the technique is visual and, once complete, lets you see at a glance where the highest areas of risk are. If several people have identified similar risks you’ll get a clustering of sticky notes on top of the diagrams as people’s ideas converge.
Step 4. Prioritise the risks
Now you can take each sticky note (or cluster of sticky notes) and agree on how you will collectively quantify the risk that has been identified.
- Individual sticky notes: Ask the person who identified the risk what their reason was and collectively agree on the probability and impact. After discussion, if either the probability or impact turns out to be “none”, take the sticky note off of the architecture diagram but don’t throw it away just yet.
- Clusters of sticky notes: If the probability and impact are the same on each sticky note, you’re done. If they aren’t, you’ll need to collectively agree on how to quantify the risk in the same way that you agree upon estimates during a Planning Poker or Wideband Delphi session. Look at the outliers and understand the rationale behind people quantifying the risk accordingly.
Identifying the risks associated with your software architecture is an essential exercise but you also need to come up with mitigation strategies, either to prevent the risks from happening in the first place or to take corrective action if the risk does happen. Since the risks are now prioritised, you can focus on the highest priority ones first.
There are a number of mitigation strategies the are applicable depending upon the type of risk, including:
- Education: Training the team, restructuring it or hiring new team members in areas where you lack experience (e.g. with new technology).
- Prototypes: Creating prototypes where they are needed to mitigate technical risks by proving that something does or doesn’t work. Since risk-storming is a visual technique, it lets you easily see the stripes through your software system that you should perhaps look at in more detail with prototypes.
- Rework: Changing your software architecture to remove or reduce the probability/impact of identified risks (e.g. removing single points of failure, adding a cache to protect from third-party system outages, etc). If you do decide to change your architecture, you can re-run the risk-storming exercise to check whether the change has had the desired effect.
When to use risk-storming
Risk-storming is a quick, fun technique that provides a collaborative way to identify and visualise risks. As an aside, this technique can be used for anything that you can visualise; from enterprise architectures through to business processes and workflows. It can be used at the start of a software development project (when you’re coming up with the initial software architecture) or throughout, during iteration planning sessions or retrospectives.
Just make sure that you keep a log of the risks that are identified, including those that you later agree have a probability or impact of “none”. Additionally, why not keep the architecture diagrams with the sticky notes on the wall of your project room so that everybody can see this additional layer of information. Identifying risks is essential in preventing project failure and it doesn’t need to be a chore if you get the whole team involved.
As a final point related to risks, who owns the risks on most software projects anyway? From my experience, the “risk register” (if there is one) is usually owned by the lone non-technical project manager. Does this make sense? Do they understand the technical risks? Do they really care about the technical risks?
A better approach is to assign ownership of technical risks to the software architecture role. By all means keep a central risk register, but just ensure that somebody on the team is actively looking after the technical risks, particularly those that will cause your project to be cancelled or you to be fired. And, of course, sharing the software architecture role amongst the team paves the way for collective ownership of the risks too.
28. Just enough up front design
One of the major points of disagreement about software relates to how much up front design to do. People are very polarised as to when they should do design and how much they should do. From my experience of working with software teams, the views basically break down like this.
- “We need to do all of the software architecture up front, before we start coding.”
- “Software architecture doesn’t need to be done up front; we’ll evolve it as we progress.”
- “Meh, we don’t need to do software architecture, we have an excellent team.”
These different views do raise an interesting question, how much architecture do you need to do up front?
It comes back to methodology
One of the key reasons for the disagreement can be found in how teams work, and specifically what sort of development methodology they are following. If you compare the common software development approaches on account of how much up front design they advocate, you’d have something like the following diagram.
At one end of the scale you have waterfall that, in it’s typical form, suggests big design up front where everything must be decided, reviewed and signed-off before a line of code is written. And at the other end you have the agile approaches that, on the face of it, shy away from doing architecture.
At this point it’s worth saying that this isn’t actually true. Agile methods don’t say “don’t do architecture”, just as they don’t say “don’t produce any documentation”. Agile is about sufficiency, moving fast, embracing change, feedback and delivering value. But since agile approaches and their evangelists don’t put much emphasis on the architectural aspects of software development, many people have misinterpreted this to mean “agile says don’t do any architecture”. More commonly, agile teams choose to spread the design work out across the project rather than doing it all up front. There are several names for this, including “evolutionary architecture” and “emergent design”. Depending on the size and complexity of the software system along with the experience and maturity of the team, this could unfortunately end up as “foolishly hoping for the best”.
Sitting between the ends of the scale are methods like the Rational Unified Process (RUP), Disciplined Agile Delivery (DAD) and DSDM Atern. These are flexible process frameworks that can be implemented by taking all or part of them. Although many RUP implementations have typically been heavyweight monsters that have more in common with waterfall approaches, it can be scaled down to exhibit a combination of characteristics that lets it take the centre ground on the scale. DAD is basically a trimmed down version of RUP, and DSDM Atern is a similar iterative and incremental method that is also influenced by the agile movement. All three are risk-driven methodologies that basically say, “gather the majority of the key requirements at a high level, get the risky stuff out of the way, then iterate and increment”. DSDM Atern even uses the term “firm foundations” to describe this. Done right, these methods can lead to a nice balance of up front design and evolutionary architecture.
You need to do “just enough”
My approach to up front architecture and design is that you need to do “just enough”. If you say this to people they either think it’s an inspirational breath of fresh air that fits in with all of their existing beliefs or they think it’s a complete cop out! “Just enough” works as a guideline but it’s vague and doesn’t do much to help people assess how much is enough. Based upon my definition of architecture, you could say that you need to do just enough up front design to give you structure and vision. In other words, do enough so that you know what your goal is and how you’re going to achieve it. This is a better guideline, but it still doesn’t provide any concrete advice.
It turns out that while “just enough” up front design is hard to quantify, many people have strong opinions on “too little” or “too much” based upon their past experience. Here’s a summary of those thoughts from software developers I’ve met over the past few years.
How much up front design is too little?
- No understanding of what and where the system boundary is.
- No common understanding of “the big picture” within the team.
- Inability to communicate the overall vision.
- Team members aren’t clear or comfortable with what they need to do.
- No thought about non-functional requirements/quality attributes.
- No thought about how the constraints of the (real-world) environment affect the software (e.g. deployment environment).
- No thoughts on key areas of risk; such as non-functional requirements, external interfaces, etc.
- The significant problems and/or their answers haven’t been identified.
- No thought on separation of concerns, appropriate levels of abstraction, layering, modifiability, flex points, etc.
- No common understanding of the role that the architect(s) will play.
- Inconsistent approaches to solving problems.
- A lack of control and guidance for the team.
- Significant change to the architecture during the project lifecycle that could have been anticipated.
- Too many design alternatives and options, often with team members disagreeing on the solution or way forward.
- Uncertainty over whether the design will work (e.g. no prototyping was performed as a part of the design process).
- A lack of technology choices (i.e. unnecessary deferral).
How much up front design is too much?
- Too much information (i.e. long documents and/or information overload).
- A design that is too detailed at too many levels of abstraction.
- Too many diagrams.
- Writing code or pseudo-code in documentation.
- An architecture that is too rigid with no flexibility.
- All decisions at all levels of abstraction have been made.
- Class level design with numerous sequence diagrams showing all possible interactions.
- Detailed entity relationship models and database designs (e.g. tables, views, stored procedures and indexes).
- Analysis paralysis and a team that is stuck focussing on minor details.
- Coding becomes a simple transformation of design artefacts to code, which is boring and demotivating for the team.
- An unbounded “design phase” (i.e. time and/or budget).
- The deadline has been reached without any coding.
How much is “just enough”?
It’s easy to identify with many of the answers above but “just enough” sits in that grey area somewhere between the two extremes. The key is that architecture represents the significant decisions, where significance is measured by cost of change. In other words, it’s the stuff that’s really expensive to modify and the stuff that you really do need to get right as early as possible. For example, qualities such as high performance, high scalability, high security and high availability generally need to be baked into the foundations early on because they are hard to retrofit into an existing codebase. The significant decisions also include the stuff that you can’t easily refactor in an afternoon; such as the overall structure, core technology choices, “architectural” patterns, core frameworks and so on.
Back to RUP for a second, and it uses the term “architecturally significant”, advising that you should figure out what might be significant to your architecture. What might be significant? Well, it’s anything that’s costly to change, is complex (e.g. tricky non-functional requirements or constraints) or is new. In reality, these are the things with a higher than normal risk of consequences if you don’t get them right. It’s worth bearing in mind that the significant elements are often subjective too and can vary depending on the experience of the team.
What you have here then is an approach to software development that lets you focus on what’s risky in order to build sufficient foundations to move forward with. The identification of architecturally significant elements and their corresponding risks is something that should be applied to all software projects, regardless of methodology. Some agile projects already do this by introducing a “sprint zero”, although some agile evangelists will say that “you’re doing it wrong” if you need to introduce an architecture sprint. I say that you need to do whatever works for you based upon your own context.
Although all of this provides some guidance, the answer to “how much is just enough?” needs one of those “it depends” type answers because all software teams are different. Some teams will be more experienced, some teams will need more guidance, some teams will continually work together, some teams will rotate and change frequently, some software systems will have a large amount of essential complexity, etc. How much architecture do you need to do then? I say that you need to do “just enough” in order to do the following, which applies whether the software architecture role is being performed by a single person or shared amongst the team.
- What: Understand the significant structural elements and how they fit together, based upon the architectural drivers.
- How: Design and decomposition down to components.
- What: Create and communicate a vision for the team to work with.
- How: Visualise your software architecture using a collection of diagrams at varying levels of abstraction.
This minimal set of software architecture practices will provide you with firm foundations that underpin the rest of the software delivery, both in terms of the product being built and the team that is building it. Some architecture usually does need to be done up front, but some doesn’t and can naturally evolve. Deciding where the line sits between mandatory and evolutionary design is the key.
Contextualising just enough up front design
In reality, the “how much up front design is enough?” question must be answered by you and here’s my advice … go and practice architecting a software system. Find or create a small-medium size software project scenario and draft a very short set of high-level requirements (functional and non-functional) to describe it. This could be an existing system that you’ve worked on or something new and unrelated to your domain such as the financial risk system that I use on my training course. With this in place, ask two or more groups of 2-3 people to come up with a solution by choosing some technology, doing some design and drawing some diagrams to communicate the vision. Timebox the activity (e.g. 90 minutes) and then hold an open review session where the following types of questions are asked about each of the solutions:
- Will the architecture work? If not, why not?
- Have all of the key risks been identified?
- Is the architecture too simple? Is it too complex?
- Has the architecture been communicated effectively?
- What do people like about the diagrams? What can be improved?
- Is there too much detail? Is there enough detail?
- Could you give this to your team as a starting point?
- Is there too much control? Is there not enough guidance?
- Are you happy with the level of technology decisions that have been made or deferred?
Think of this exercise as an architectural kata except that you perform a review that focusses additionally on the process you went through and the outputs rather than just the architecture itself. Capture your findings and try to distill them into a set of guidelines for how to approach the software design process in the future. Agree upon and include examples of how much detail to go down into, agree on diagram notation and include examples of good diagrams, determine the common constraints within your own environment, etc. If possible, run the exercise again with the guidelines in mind to see how it changes things. One day is typically enough time to run through this exercise with a couple of design/communicate/review cycles.
No two software teams are the same. Setting aside a day to practice the software design process within your own environment will provide you with a consistent starting point for tackling the process in the future and help you contextualise exactly what “just enough” up front design means to you and your team. An additional benefit of practicing the software design process is that it’s a great way to coach and mentor others. Are you striving for a self-organising team where everybody is able to perform the software architecture role?
In my experience, people tend to use the word “agile” to refer to a couple of things. The first is when talking about agile approaches to software development; moving fast, embracing change, releasing often, getting feedback and so on. The second use of the word relates to the agile mindset and how people work together in agile environments. This is usually about team dynamics, systems thinking, psychology and other things you might associate with creating high performing teams.
Leaving the latter “fluffy stuff” aside, for me, labelling a software architecture as being “agile” means that it can react to change within its environment, adapting to the ever changing requirements that people throw at it. This isn’t necessarily the same as the software architecture that an agile team will create. Delivering software in an agile way doesn’t guarantee that the resulting software architecture will be agile. In fact, in my experience, the opposite typically happens because teams are more focussed on delivering functionality rather than looking after their architecture.
To understand how much agility you need from your software architecture, it’s worth looking at what agility means. John Boyd, a fighter pilot in the US Air Force, came up with a concept that he called the OODA loop - Observe, Orient, Decide and Act. In essence, this loop forms the basis for the decision making process. Imagine that you are a fighter pilot in a dogfight with an adversary. In order to outwit your opponent in this situation, you need to observe what’s happening, orient yourself (e.g. do some analysis), decide what to do and then act. In the heat of the battle, this loop needs to be executed as fast as possible to avoid being shot down by your opponent. Boyd then says that you can confuse and disorient your opponent if you can get inside their OODA loop, by which he means execute it faster than they can. If you’re more agile than your opponent, you’re the one that will come out on top.
In a paper titled “What Lessons Can the Agile Community Learn from A Maverick Fighter Pilot?”, Steve Adolph, from the University of British Columbia, takes Boyd’s concept and applies it to software development. The conclusion drawn is that agility is relative and time-based. If your software team can’t deliver software and keep pace with changes in the environment, your team is not agile. If you’re working in a large, slow moving organisation that rarely changes, you can probably take months to deliver software and still be considered “agile” by the organisation. In a lean startup, that’s likely to not be the case.
A good architecture enables agility
The driver for having this discussion is that a good software architecture enables agility. Although Service-Oriented Architecture (SOA) is seen as a dirty term within some organisations due to over-complex, bloated and bodged implementations, there’s a growing trend of software systems being made up of tiny microservices, where each service only does one thing but does that thing very well. A microservice may typically be less than one hundred lines of code. If change is needed, services can be rewritten from scratch, potentially in a different programming language. This style of architecture provides agility in a number of ways. Small, loosely coupled components/services can be built, modified and tested in isolation, or even ripped out and replaced depending on how requirements change. This style of architecture also lends itself well to a very flexible and adaptable deployment model, since new components/services can be added and scaled if needed.
However, nothing in life is ever free. Building a software system like this takes time, effort and discipline. Many people don’t need this level of adaptability and agility either, which is why you see so many teams building software systems that are much more monolithic in nature, where everything is bundled together and deployed as a single unit. Although simpler to build, this style of architecture usually takes more effort to adapt in the face of changing requirements because functionality is often interwoven across the codebase.
In my view, both architectural styles have their advantages and disadvantages, with the decision to build a monolithic system vs one composed of microservices coming back to the trade-offs that you are willing to make. As with all things in the IT industry, there’s a middle ground between these extremes. With pragmatism in mind, you can always opt to build a software system that consists of a number of small well-defined components, yet is still deployed as a single unit. The Wikipedia page for Component-based development has a good summary and a “component” might be something like a risk calculator, audit logger, report generator, data importer, etc. The simplest way to think about a component is that it’s a set of related behaviours behind an interface, which may be implemented using one or more collaborating classes (assuming an OO language). Good components share a number of characteristics with good classes and, of course, good microservices: high cohesion, low coupling, a well-defined public interface, good encapsulation, etc. Well-defined components provide a stepping stone to migrate to a microservice architecture more easily at a later date, if you need the benefits given the additional cost and complexity that such an architectural-style provides.
Agility as a quality attribute
Understanding the speed at which your organisation or business changes is important because it can help you decide upon the style of architecture to adopt; whether that’s a monolithic architecture, a microservices architecture or something in between. You need to understand the trade-offs and make your choices accordingly. Treat agility as a quality attribute. You don’t get agility for free.
30. Introducing software architecture
A little software architecture discipline has a huge potential to improve the success of software teams, essentially through the introduction of technical leadership. With this in mind, the final question that we need to address is how to get software teams to adopt a just enough approach to software architecture, to ensure they build well-structured software systems that satisfy the goals, particularly with respect to any complex non-functional requirements and constraints. Often, this question becomes how to we reintroduce software architecture back into the way that software teams work.
In my view, the big problem that software architecture has as a discipline is that it’s competing with all of the shiny new things created in the software industry on a seemingly daily basis. I’ve met thousands of software developers from around the world and, in my experience, there’s a large number of them that don’t think about software architecture as much as they should. Despite the volume of educational material out there, teams lack knowledge about what software architecture really is.
People have limited time and energy for learning but a lack of time isn’t often the reason that teams don’t understand what software architecture is all about. When I was moving into my early software architecture roles, I, like others I’ve spoken to, struggled to understand how much of what I read about in the software architecture books related to what I should doing on a daily basis. This lack of understanding is made worse because most software developers don’t get to practice architecting software on a regular basis. How many software systems have you architected during your own career?
Simply saying that all software teams need to think about software architecture isn’t enough to make it happen though. So, how do we get software teams to reintroduce software architecture?
Software architecture needs to be accessible
As experienced practitioners, we have a duty to educate others but we do need to take it one step at a time. We need to remember that many people are being introduced to software architecture with potentially no knowledge of the related research that has been conducted in the past. Think about the terminology that you see and hear in relation to software architecture. How would you explain to a typical software developer what a “logical view” is? When we refer to the “physical view”, is this about the code or the physical infrastructure? Everybody on the development team needs to understand the essence of software architecture and the consequences of not thinking about it before we start talking about things like architecture description languages and evaluation methods. Information about software architecture needs to be accessible and grounded in reality.
This may seem an odd thing to say, but the people who manage software teams also need to understand the essence of software architecture and why it’s a necessary discipline. Some of the teams I’ve worked with over the years have been told by their management to “stop doing software architecture and get on with the coding”. In many cases, the reason behind this is a misunderstanding that all up front design activities need to be dropped when adopting agile approaches. Such software development teams are usually put under immense pressure to deliver and some up front thinking usually helps rather than hinders.
Some practical suggestions
Here are some practical suggestions for introducing software architecture.
1. Educate people
Simply run some workshops where people can learn about and understand what software architecture is all about. This can be aimed at developers or non-developers, and it will help to make sure that everybody is talking the same language. At a minimum, you should look to cover:
- What software architecture is.
- Why software architecture is important.
- The practices you want to adopt.
2. Talk about architecture in retrospectives
If you have regular retrospectives to reflect on how your team is performing, why not simply include software architecture on the list of topics that you talk about? If you don’t think that enough consideration is being given to software architecture, perhaps because you’re constantly refactoring the architecture of your software or you’re having issues with some non-functional characteristics, then think about the software architecture practices that you can adopt to help. On the flip side, if you’re spending too much time thinking about software architecture or up front design, perhaps it’s time to look at the value of this work and whether any practices can be dropped or substituted.
3. Definition of done
If you have a “definition of done” for work items, add software architecture to the list. This will help ensure that you consider architectural implications of the work item and conformance of the implementation with any desired architectural patterns/rules or non-functional goals.
4. Allocate the software architecture role to somebody
If you have a software team that doesn’t think about software architecture, simply allocating the software architecture role to somebody appropriate on the team may kickstart this because you’re explicitly giving ownership and responsibility for the software architecture to somebody. Allocating the role to more than one person does work with some teams, but I find it better that one person takes ownership initially, with a view to sharing it with others as the team gains more experience. Some teams dislike the term “software architect” and use the term architecture owner instead. Whatever you call it, coaching and collaboration are key.
5. Architecture katas
Words alone are not enough and the skeptics need to see that architecture is not about big design up front. This is why I run short architecture katas where small teams collaboratively architect a software solution for a simple set of requirements, producing one or more diagrams to visualise and communicate their solutions to others. This allows people to experience that up front design doesn’t necessarily mean designing everything to a very low level of abstraction and it provides a way to practice communicating software architecture.
Making change happen
Here’s a relatively common question from people that understand why software architecture is good, but don’t know how to introduce it into their projects.
“I understand the need for software architecture but our team just doesn’t have the time to do it because we’re so busy coding our product. Having said that, we don’t have consistent approaches to solving problems, etc. Our managers won’t give us time to do architecture. If we’re doing architecture, we’re not coding. How do we introduce architecture?”
It’s worth asking a few questions to understand the need for actively thinking about software architecture:
- What problems is the lack of software architecture causing now?
- What problems is the lack of software architecture likely to cause in the future?
- Is there a risk that these problems will lead to more serious consequences (e.g. loss of reputation, business, customers, money, etc)?
- Has something already gone wrong?
One of the things that I tell people new to the architecture role is that they do need to dedicate some time to doing architecture work (the big picture stuff) but a balance needs to be struck between this and the regular day-to-day development activities. If you’re coding all of the time then that big picture stuff doesn’t get done. On the flip-side, spending too much time on “software architecture” means that you don’t ever get any coding done, and we all know that pretty diagrams are no use to end-users!
“How do we introduce software architecture?” is one of those questions that doesn’t have a straightforward answer because it requires changes to the way that a software team works, and these can only really be made when you understand the full context of the team. On a more general note though, there are two ways that teams tend to change the way that they work.
- Reactively: The majority of teams will only change the way that they work based upon bad things happening. In other words, they’ll change if and only if there’s a catalyst. This could be anything from a continuous string of failed system deployments or maybe something like a serious system failure. In these cases, the team knows something is wrong, probably because their management is giving them a hard time, and they know that something needs to be done to fix the situation. This approach unfortunately appears to be in the majority across the software industry.
- Proactively: Some teams proactively seek to improve the way that they work. Nothing bad might have happened yet, but they can see that there’s room for improvement to prevent the sort of situations mentioned previously. These teams are, ironically, usually the better ones that don’t need to change, but they do understand the benefits associated with striving for continouous improvement.
Back to the original question and in essence the team was asking permission to spend some time doing the architecture stuff but they weren’t getting buy-in from their management. Perhaps their management didn’t clearly understand the benefits of doing it or the consequences of not doing it. Either way, the team didn’t achieve the desired result. Whenever I’ve been in this situation myself, I’ve either taken one of two approaches.
- Present in a very clear and concise way what the current situation is and what the issues, risks and consequences are if behaviours aren’t changed. Typically this is something that you present to key decision makers, project sponsors or management. Once they understand the risks, they can decide whether mitigating those risks is worth the effort required to change behaviours. This requires influencing skills and it can be a hard sell sometimes, particularly if you’re new to a team that you think is dysfunctional!
- Lead by example by finding a problem and addressing it. This could include, for example, a lack of technical documentation, inconsistent approaches to solving problems, too many architectural layers, inconsistent component configuration, etc. Sometimes the initial seeds of change need to be put in place before everybody understands the benefits in return for the effort. A little like the reaction that occurs when most people see automated unit testing for the first time.
Each approach tends to favour different situations, and again it depends on a number of factors. Coming back to the original question, it’s possible that the first approach was used but either the message was weak or the management didn’t think that mitigating the risks of not having any dedicated “architecture time” was worth the financial outlay. In this particular case, I would introduce software architecture through being proactive and leading by example. Simply find a problem (e.g. multiple approaches to dealing with configuration, no high-level documentation, a confusing component structure, etc) and just start to fix it. I’m not talking about downing tools and taking a few weeks out because we all know that trying to sell a three month refactoring effort to your management is a tough proposition. I’m talking about baby steps where you evolve the situation by breaking the problem down and addressing it a piece at a time. Take a few minutes out from your day to focus on these sort of tasks and before you know it you’ve probably started to make a world of difference. “It’s easier to ask forgiveness than it is to get permission”.
The essence of software architecture
Many software teams are already using agile/lean approaches and more are following in their footsteps. For this reason, any software architecture practices adopted need to add real value otherwise the team is simply wasting time and effort. Only you can decide how much software architecture is just enough and only you can decide how best to lead the change that you want to see in your team. Good luck with your journey!
- Despite how agile approaches have been evangelised, are “agile” and “architecture” really in conflict with one another?
- If you’re currently working on an agile software team, have the architectural concerns been thought about?
- Do you feel that you have the right amount of technical leadership in your current software development team? If so, why? If not, why not?
- How much up front design is enough? How do you know when you stop? Is this view understood and shared by the whole team?
- Many software developers undertake coding katas to hone their skills. How can you do the same for your software architecture skills? (e.g. take some requirements plus a blank sheet of paper and come up with the design for a software solution)
- What is a risk? Are all risks equal?
- Who identifies the technical risks in your team?
- Who looks after the technical risks in your team? If it’s the (typically non-technical) project manager or ScrumMaster, is this a good idea?
- What happens if you ignore technical risks?
- How can you proactively deal with technical risks?
- Do you need to introduce software architecture into the way that your team works? If so, how might you do this?
32. Appendix A: Financial Risk System
A global investment bank based in London, New York and Singapore trades (buys and sells) financial products with other banks (counterparties). When share prices on the stock markets move up or down, the bank either makes money or loses it. At the end of the working day, the bank needs to gain a view of how much risk they are exposed to (e.g. of losing money) by running some calculations on the data held about their trades. The bank has an existing Trade Data System (TDS) and Reference Data System (RDS) but need a new Risk System.
Trade Data System
The Trade Data System maintains a store of all trades made by the bank. It is already configured to generate a file-based XML export of trade data at the close of business (5pm) in New York. The export includes the following information for every trade made by the bank:
- Trade ID
- Current trade value in US dollars
- Counterparty ID
Reference Data System
The Reference Data System maintains all of the reference data needed by the bank. This includes information about counterparties; each of which represents an individual, a bank, etc. A file-based XML export is also available and includes basic information about each counterparty. A new organisation-wide reference data system is due for completion in the next 3 months, with the current system eventually being decommissioned.
The high-level functional requirements for the new Risk System are as follows.
- Import trade data from the Trade Data System.
- Import counterparty data from the Reference Data System.
- Join the two sets of data together, enriching the trade data with information about the counterparty.
- For each counterparty, calculate the risk that the bank is exposed to.
- Generate a report that can be imported into Microsoft Excel containing the risk figures for all counterparties known by the bank.
- Distribute the report to the business users before the start of the next trading day (9am) in Singapore.
- Provide a way for a subset of the business users to configure and maintain the external parameters used by the risk calculations.
The non-functional requirements for the new Risk System are as follows.
- Risk reports must be generated before 9am the following business day in Singapore.
- The system must be able to cope with trade volumes for the next 5 years.
- The Trade Data System export includes approximately 5000 trades now and it is anticipated that there will be an additional 10 trades per day.
- The Reference Data System counterparty export includes approximately 20,000 counterparties and growth will be negligible.
- There are 40-50 business users around the world that need access to the report.
- Risk reports should be available to users 24x7, but a small amount of downtime (less than 30 minutes per day) can be tolerated.
- Manual failover is sufficient for all system components, provided that the availability targets can be met.
- This system must follow bank policy that states system access is restricted to authenticated and authorised users only.
- Reports must only be distributed to authorised users.
- Only a subset of the authorised users are permitted to modify the parameters used in the risk calculations.
- Although desirable, there are no single sign-on requirements (e.g. integration with Active Directory, LDAP, etc).
- All access to the system and reports will be within the confines of the bank’s global network.
- The following events must be recorded in the system audit logs:
- Report generation.
- Modification of risk calculation parameters.
- It must be possible to understand the input data that was used in calculating risk.
Fault Tolerance and Resilience
- The system should take appropriate steps to recover from an error if possible, but all errors should be logged.
- Errors preventing a counterparty risk calculation being completed should be logged and the process should continue.
Internationalization and Localization
- All user interfaces will be presented in English only.
- All reports will be presented in English only.
- All trading values and risk figures will be presented in US dollars only.
Monitoring and Management
- A Simple Network Management Protocol (SNMP) trap should be sent to the bank’s Central Monitoring Service in the following circumstances:
- When there is a fatal error with a system component.
- When reports have not been generated before 9am Singapore time.
Data Retention and Archiving
- Input files used in the risk calculation process must be retained for 1 year.
- Interfaces with existing data systems should conform to and use existing data formats.