Why so SAD?
Tags: software, design, architecture
Published: 2018-02-28 23:18:08

---
title: "Why so SAD?"
published: true
description: A quick introduction to what software architecture design is and what it entails.
tags: software, design, architecture, 
---

**SAD** (Software Architecture Design), is the decision-making process of figuring out the what, how, and why of a piece of software. It contends the technical, business and operational requirements and presents them in a useful and easy to comprehend manner <sup>[1][1]</sup>. 

### Why bother with SAD

Before delving into more detail regarding what software architecture design entails, I would first like to point out a few reasons why it is important and useful:

First, one of the biggest reasons to design the software's architecture before jumping straight in and coding is that it robs you of the chance to fully consider some aspects of the software's foundation.  It will also give you a chance to evaluate the issues the choices might lead to, and does not give you the chance to plan for contingencies for when things go horribly wrong.

Additionally, having software architecture design in place (whether it was created at the inception of the project or later) will help give your team a clear idea of what they are building, and how new pieces that they are adding fit, and how certain aspects connect to each other when making changes to an existing code base. Also, having reasons laid out for why certain decisions were made early on should help make changes to that aspect of the foundation easier and less disastrous.

Furthermore, the team having a better idea of the product leads to them spending less time untangling code and wondering why certain decisions were made. Giving your developer an accurate birds-eye view of the software gives bosts their confidence in their understanding of the software and enables them to design better code and come up with more robust bug fixes. That will all lead to an increase in morale, productivity, and development time.

Finally, it will also help with the onboarding process for new developers to your team, instead of letting them learn the software's architecture as they go.


------

### What SAD is

Software Architecture design includes making decisions regarding <sup>[4][4]</sup>:

1. Application Type
2. Deployment Strategy
3. Appropriate Technologies
3. Quality Attributes
4. Crosscutting Concerns: this covers such things as logging, authentication, and caching

Going through each one of the items and making the choices appropriate for your software that falls within the business and real-life constraints, is the first and perhaps the most crucial step of the process but it does not end there. The process of SAD is rarely a one and done thing (teams who attempt to plan it all at the start almost always fail or get bogged down in too many minute details), it is an ongoing process that guides the software production. 

The steps for core architecture design activities include <sup>[5][5]</sup>:

1. Identify Architecture objectives
1. Have a list of key scenarios (use cases)
1. Application overview 
1. List known and possible key issues of decisions made
1. Candidate solutions: prototype the architecture and run it through the list of key scenarios to ensure that all requirements are being met 
1. Repeat the above steps until both requirements and stakeholders have been satisfied 
   

#### SAD and Design

  Software architecture design and software design sound extremely similar but they are not and due to the similar names often get mixed up. The major difference between the two is that software architecture looks at the big picture and how the big pieces connect and interact with each other, while software design handles the smaller pieces and how they are implemented <sup>[2][2]</sup>. One similarity between the two is that depending on your software you might end up using one style or a combination of two or more styles, i.e. your software might be a website that has both aspects of a client/server and component-based architectural styles (more specifics on styles below) <sup>[3][3]</sup>. 

#### Tools

Making decisions on architecture are all well and good, but without proper documentation, it is about as useful as herding cats.

* UML (Unified Modeling Language)
  * This pictorial language is perhaps the most well know out of this list and is used not only in SAD but also in software design, and database design.
  * If you are looking for a detailed tutorial I recommend [Tutorial's Point UML](https://www.tutorialspoint.com/uml)
  * For making UML diagrams the tool I usually go with is [draw.io](draw.io) created by Google, Microsoft's OneNote can be utilized as well. Another tool I have seen listed numerous time is [MagicDraw](https://www.nomagic.com/products/magicdraw#)

* ADL (Architecture Description Language): this seems to be a special kind of beast, it appears to be a hybrid language somewhere between a programming and a modeling language. There is [a list](http://www.di.univaq.it/malavolta/al/) of different ADLs out there and the option to create your own that follow a set of requirements <sup>[8][8]</sup>.

* 4 + 1 model <sup>[7][7]</sup>: this method of representing SAD seems to be the most widespread model, it was created by [Philippe Krutchen](https://en.wikipedia.org/wiki/Philippe_Kruchten). As you can see in the image below it consists of 4 main views: logical, development, process, and physical; each view is targeted at a different stakeholder. The '+ 1' view or rather the fifth view is the scenarios, the stakeholders for this view is everyone and it proves that all the other views work together through validation and testing.

![alt text](https://thepracticaldev.s3.amazonaws.com/i/bv81vsyvuvr39gye3f2u.PNG "4 + 1 picture")



Ultimately, when it comes to documenting your SAD which language, tool, or model you use depends on you and the software.

------

### Some SAD Styles

Listed below are some of the architectural styles out there that I found interesting <sup>[3][3]</sup>:

* Client/Server:
  * Category: Deployment Architectural Style
  * A distributed system that can have one or more client and one or more servers connected through a network. 
  * Advantages <sup>[9][9]</sup>: improved data sharing, clients can integrate *n* number of services, maintenance is easier since it is a distributed system, and more secure because almost all servers come with authorization
  * Disadvantages: there is a higher chance of data loss in these types of systems, and it could become costly to setup proper server backups and georeplication for better worldwide reach.
  * Examples include: Websites, FTP clients, and data tools
* Component-Based Style:
  * Category: Structure Architectural Style
  * This style focuses on breaking the design of the system into smaller and reusable chunks
  * Advantages: Ease of deployment and development (components can be switched out without affecting the rest of the system), reduced costs (less money spent developing existing software), reusable, and reduces technical complexity.
  * Example: [bootstrap](https://getbootstrap.com/)
* Service-Oriented Architectural (SOA) Style
  * Category: Communication Architectural Style
  * This style provides services and functions, it is somewhat like component-based architecture in that it is modular but it tends to over more complex functionality.
  * Similar advantages as the Component-based style 
  * Example: [Amazon's Lambda](https://aws.amazon.com/lambda/)


-----------

*Now for the final question: who is responsible for the architecture of the software?* Some companies hire software architects that specifically manage that part of the product, an issue with that might occur is that they produce unrealistic designs causing the rest of the developer to ignore the design. I believe the best approach is an Agile one, one team member well versed in everything SAD and the rest of team actively contributing to the architecture design. With the whole team involved not only will the final architecture design be more robust, everyone will feel responsible, more informed, and a much higher chance of the design being followed.

-----------

*References*
[1]: https://msdn.microsoft.com/en-us/library/ee658098.aspx
[2]: https://www.tutorialspoint.com/software_architecture_design/index.htm
[3]: https://msdn.microsoft.com/en-us/library/ee658117.aspx
[4]: https://msdn.microsoft.com/en-us/library/ee658124.aspx
[5]: https://msdn.microsoft.com/en-us/library/ee658084.aspx
[6]: http://www.codingthearchitecture.com/2014/05/29/software_architecture_vs_code.html
[7]: https://www.cs.ubc.ca/~gregor/teaching/papers/4+1view-architecture.pdf
[8]: https://www.tutorialspoint.com/software_architecture_design/architecture_models.htm
[9]: https://clientserverarch.blogspot.ca/2013/03/advantages-and-disadvantages-of-client.html

* [Tutorials Point Software Architecture & Design Tutorial](https://www.tutorialspoint.com/software_architecture_design/index.htm)
* [Microsoft Application Architecture Guide](https://msdn.microsoft.com/en-us/library/ff650706.aspx)
* [Software architecture vs code](http://www.codingthearchitecture.com/2014/05/29/software_architecture_vs_code.html)
* [Advantages and Disadvantages of the Client Server Methodology](https://clientserverarch.blogspot.ca/2013/03/advantages-and-disadvantages-of-client.html)

-------------------------------

*I hope you found this post helpful (it's my first ever), I am open to any and all comments and feedback*