About Software Architecture

I think I found the perfect analogy for the essence of Software Architecture.

  • Software architecture is the health of a software application.
  • A software architect is a physician which is concerned with the health of a software application.
  • Architectural characteristics are measurable dimensions of the health of a software application.

Software architecture is a misleading name, because it reminds us of structure, solidity, and immutability, but that’s far from the truth. 1That would be the skeleton, which is certainly an important subsystem, but only one of many that conform the whole.

Software applications are dynamic entities 2both in the sense that they live and work along time and that they change from time to time, so they have an intrinsic and comprehensive survival ability that changes over time. That ability is the health of the application.

A software architect can audit a software application, and find out if it has good health or it suffers an illness. Then she can suggest a therapy 3more or less invasive to improve its health.

About uniformity

Use uniform schemes, at least project wide, if not company wide.

When an engineer is a world apart, allowed to work alone on a big chunk of functionality, during a few weeks in a row, they produce lots of code which is seldom harmonized with the rest of existing functionalities.

Why does this happen? There are many reasons. Clearly there is little to no interest in improving code quality at a management level, because they think that technical debt can always be fixed later by adding more cheap laborers, when it’s probably the exact opposite of that, i.e. you can always add more cheap laborers to produce more code if the technical debt is kept at bay along time.

Another reason is that the size and number of code changes in a single merge request makes it nearly impossible to perform meaningful code reviews, and in fact seasoned reviewers skim through them very fast and accept true atrocities.

For example, in the same API

  • they allow the same properties to have different names, having to use one or the other depending on the state of the object, like
    • activeGroup.name
    • pendingGroup.groupName
  • they allow the same concepts to have different values, having to use one or the other depending on the endpoint you use, like
    • operations = ['CREATE', 'UPDATE', 'DELETE'];
    • operations = ['C', 'U', 'D']
  • they allow the same operations to have different results’ structures, like
    • `POST {name: ‘John’, age: 32}
      • success response: {name: ‘John’, age: 32, created: …}
      • error response: {error: ‘Age should be less than 30’}`
    • `POST {city: ‘Barcelona’, temperature: ’18 C’}
      • success response: ‘OK’
      • error response: {msg: ‘Italian cities only, please.’}`

Of course there are many more typologies of incoherences in some code bases.

It could seem that they are just little inconveniences but they contribute lots of lines of code to the app. For example, a thing so simple like comparing two instances of the same document in different states, becomes a mess (i.e. more intricacies and bugs) when the names of the properties change according to the state.