DEV Community

Miguel Teheran
Miguel Teheran

Posted on

Design applications like trees not buildings

Image description

With the evolution of technology and software development tools, we now have proven patterns, architectures and models that we can follow to build our applications. For example: layered architecture, development principles such as SOLID principles and design patterns.

However, from my experience, there are still many traditional aspects to building software that go against the very nature of development and the abstraction of reality that we try to do when programming.

In this article, I want to share a personal opinion about how to think differently about the way we build our applications and apply software architecture.

1. Uniformity in modules and components

A building retains a pattern within its external and internal parts. In an apartment building, there are 2 or 3 styles of apartments, and they retain a similarity in every detail to respect the interests of the buyers and owners. There are few areas where there is any significant difference and the rigidity of the walls, columns and bases makes it difficult to make significant changes in the future.
Image description

The modules and components in an application are very dynamic and, because of good user experience practices, applications adjust to the behaviors and fluidity in which the user interacts with the application like a tree.

The branches and roots of a tree are similar, but not the same. The intention that they are perfectly equal is not contemplated in nature. The appearance depends on the environment, the obstacles encountered, the weather and other variables that occur during its development, exactly as an application should behave within its analysis and implementation cycle.

2. Adaptability

Something wonderful about nature is that it does not stop in spite of obstacles, it can adapt, adjust, rethink and look for the best way to solve challenges.

Trees are a clear example of this. As they grow, they can change the location of their roots, branches, and even the way their leaves grow according to the climate in order to survive.

Even by investing time in analysis, requirements gathering and planning, on the way to building software, we can find very big challenges and sudden changes in technology that should make us rethink our path, This should be something natural and should flow within the development process, as well as in the architecture of our application.

We must be able to change components or connect to new services using abstract elements that allow us to transform the project without drastically affecting our architecture.

3. Fault and change tolerance

This section is related to applications that are already in production, even if they are still in the development phase.

If we analyze an adult tree of several years, we can see that its multiple roots and branches allow it to tolerate sudden changes in climate, or any phenomenon that disturbs one of its extremities. We can even cut branches from the tree, and it will continue to stand, absorbing nutrients and fulfilling its function using other branches.

Image description
There are many architectures and practices that allow us to achieve this behavior of trees in an application. For example, the microservices architecture. By implementing this architecture, we can divide our applications into small isolated components that do not depend on each other and that fulfill a specific function. Our application can survive a serious problem in which some modules no longer work and still remain available for users to perform other actions.

The high availability that our applications need must be inspired by the way trees are prepared for any eventuality of nature.

4. Evolution and continuous improvement

A building has design, planning and construction stages. After these stages, the changes that can be made at a general level are minimal.

We could not replace one floor or add another, nor could we move the building to another location. Although, there are new construction techniques that allow changes and where buildings are assembled into pieces instead of building them, at this point. I am referring to the traditional constructions that are still the most used today.

Trees, on the other hand, never stop growing! neither in their branches nor in their roots. Although at an advanced age, a tree grows very little, it never stops growing or adapting to its environment. A tree can also be transplanted (even if it is a difficult process because of its age) and it can adapt to its new environment. This is related to the migration of applications to the cloud, use of new services or when we move applications from one cloud to others. The process will be difficult but may not be impossible.

No modern application interrupts its growth, it will always need changes, updates and improvements, so we must contemplate in our architecture this phenomenon that will be part of the future phases of development.

Conclusion

There are many other aspects of trees that we can take advantage of to better think about the design of our applications, such as the way the roots allow them to cling to the ground when there are landslides or the way they generate new bark every year (which we can relate to update our libraries and frameworks and keep our project updated).

With this reflection, I just want us to think about the design and architecture of our applications in a more natural and organic way so that the harmony of the requirements and the technologies we use allow us to build the best solution.

Top comments (0)