Head First Architecture

 I have found out that there is a new book that is under early release version on the O'reilly website  called Head First Architecture that is to follow on the great Head First series , as I have read the Head First Design patterns book and really liked it several years ago and the fact that Neal Ford  (One of the authors of Software Architecture An Engineering Approach) is one of the authors, I take a look on it and found that it really is adding a lot of value at least for me, so I am doing a brief summary of it in the next couple of posts hopefully.

At first it draws an analogy between building houses and building software systems, in this analogy the building plan or the blueprint of houses is the equivalent of the software architecture, what might be the similar point between both:
1- Both specify the structure of the system, in the house case it defines the rooms, walls, stairs and floors, in the case of the software system it defines the databases, services, user-interfaces communication protocols.
2- both provides guidelines and constraints and a vision to the final system.

Dimensions of Software Architecture:

Continuing with the analogy of the house , as much as when yu describe a room of your house you can say that it has 5 meters long and 3 meters wide with a ceiling height of 2.5 meters , you can do the same with the software architecture , the main point is that it is 4 dimensions


so here are some points about each dimension:

1- Architectural characteristics:
This dimension specifies what aspects of the system the architecture needs to support like scalability , availability,  security , performance, reliability...etc.
This helps in setting the priorities that the system needs to support , back to the house analogy , if you are to choose a house between two where the first one is big but in a noise neighbourhood with high traffic, while the other is in a nice and quite neighbourhood but is much smaller , so you have to choose which is more important to you the size of the house or the level of the noise and traffic?
Same goes in software architecture as well , for instance when you have to choose a database should it be a relational database or simple key value store or a graph database ?
The answer would depend on what architectureal characterestics are more important/critical to you you can choose the sql relational database if you need to perserve the relationships between the entities while you may use a graph database if you need to have high speed search.  

2- Architectural decisions:
This has to do with decisions that has long term effects and implications on the system like what database to use, what is the number of the services exist in the system and how do these services communicate with each other.
back to the analogy of the house : should the house have 3 floors or two only , should the roof be flat or peaked ? these are choices that affect the structure of your house.
Same goes for the software architecture : for example you might decide that the frontend does not communicate directly with your database, instead it needs to go through the data access layer to retrieve data from database. This decision places a constraint or a guide for the development team that would do the implementation about how components should access/update the data in the database. 

3- Logical Components:
This dimension defines the building blocks of the system and how they interact with each other for instance an e-commerce system would need would need a payment-processing component and an inventory management component.
Same as rooms are the building blocks of a house , logical components are the building blocks of the system which handles a certain function like order tracking , order shipping...etc.

4- Architectural style:
this dimension defines the overall shape and structure of the system the same as a building's blue print /plan defines the shape and structure of a house.
an example for this in software is micro-services, event driven ,...etc. 
in the house analogy the style of the house says a lot about its overall structure for example colonial/tudor houses typically have chimneys , contemporary houses have flat roofs, ranch house have usually only one floor.Same is also with different architecture styles in software: micro-services are highly scalable and provides high level of agility , while event drive is very responsive and fast.


A general and important point is that all of these dimensions are interconnected , you can not choose an architectural style without knowing what is important to you.


Architecture vs design :

Architecture is less about appearance and more about structure while Design is the other way around.
To continue with the House analogy:

The design aspects are the choices you make to personalize the space – the color of your walls, the furniture arrangement, and the type of flooring (carpet or wood). These decisions bring your unique style to the living area. On the other hand, the architectural elements are the foundational aspects that define the basic structure of the house – the physical size of the room, the height of the ceilings, and the number and placement of windows and doors. These features establish the overall layout and functionality of the space itself. Same is with websites: The architecture is about how the web pages communicate with the backend services and the database to retrieve and modify the save the date , while the design is all about the appearance of each web page how the fields are placed and their color and shapes. ,...etc, Along the spectrum between Design and Architecture: the main purpose of this distinction between design and architecture is to decide who should do what .

Some elements to help decide: a- Is is Strategic or Tactical: The strategic decisions have more long term effects and great influence on future decisions. while tactical decisions are more short term and independent on other actions or decisions . for example the size of a new house decides the number of rooms and their sizes , while the decision about a specific fixture of light will not affect the size of the kitchen The more strategic the decision is the more it is about architecture

b- How much will it take to construct or change? The more it will needs time to construct or change , the more it is an architectural decision. Martin Fowler actually once wrote that “software architecture is the stuff that’s hard to change.” 

c-Does it have significant Tradeoffs ? Examples the were given is decision to choose a city to live on , vs the color of the rug in the living room. The more significant the tradeoffs the more it is about architecture.

Comments

Popular posts from this blog

Head First Architecture Chapter-3

The Culture Map -Some notes