What is software architecture

Software architecture is the foundation for the software system.

It consists of different aspects:

  • structures and elements of a system
  • relationships between system’s elements or components
  • abstractions of a system

Benefits to having clean and explicit architecture:

  • enabling and inhibiting quality attributes
  • predicting system quality
  • easing communication between all members/consumers of a system (stakeholders, owners, developers, and so on)
  • allowing to more easily make changes
  • providing a reusable model for other products
  • imposing implementation constraints
  • allowing to do cost and effort estimation
  • simplifying training for new developers

Software architect main responsibilities are:

  • technical decisions
  • architecture of a system
  • documentation
  • following and improving software architecture approaches and principles within the organization

Software architects in an organization

Software architect means different in different companies. Some companies already have software development methodologies and it is required to follow them. So each software architect should be familiar with them. If it is allowed to select the software development methodology, software architect should be able to explain his choice.

Software architect has the following responsibilities within an organization:

  • tasks estimation
  • projects planning
  • controlling and monitoring
  • communication with stakeholders and management
  • risk management
  • coordination of builds, development, and production environments
  • supporting and introducing product lines (reusable architecture components)
  • business domain understanding
  • identifying and clarifying requirements to a software system

Domain

Understanding the domain is a key part of being software architect. It is required to have general business knowledge and a good understanding of the organization’s business. So it will be possible to design software architecture that solves business problems effectively.

DDD is a proven approach to modeling the domain:

  • creating ubiquitous language to simplify and improve communication between everyone
  • identify entities, value objects, aggregates, and root entities
  • separating domain into subdomains and creating bounded contexts

Moreover, proper requirements engineering is an important part of creating a software architecture. Usually, it is not easy to get and elicit all requirements from stakeholders, but knowing requirements is crucial to designing a good solution.

Quality attributes

The software must match the designed quality attributes, so software architect should properly identify and specify them so they can be tested and measured.

There are two main types of quality attributes: functional and non-functional.

Some important non-functional attributes:

  • maintainability
  • usability
  • availability
  • portability
  • interoperability
  • testability
  • security
  • performance

Design

Software architecture design is an important part of the creation of software architectures. A good design can be validated, formally documented, and used by a development team.

There are two (three) main approaches:

  • top-down
  • bottom-up
  • mix of the first two approaches

Architectural drivers guide the software architecture design and are inputs for the process of designing:

  • design objectives (why the software is being designed?)
  • primary functional requirements
  • quality attributes scenarios (measurable properties of a software system)
  • constraints (properties that must be satisfied)
  • architectural concerns (interests of the software architect)

The following instruments can be used to design software architecture:

  • patterns
  • reference architectures (a template for an architecture)
  • tactics (proven techniques to achieve required quality attribute)
  • externally developed software

Documentation is another important phase of designing software architecture.

Architecture design is an iterative process:

  • architectural analysis
  • architectural synthesis
  • architectural evaluation (and go back to the first step if required)

There are a set of architecture design processes that can be used:

  • attribute-driven design (ADD)
  • microsoft’s technique for architecture and design
  • architecture-centric design method (ACDM)
  • architecture development method (ADM)

Tracking the progress of the designing process is important and can be combined with the creation of the documentation.

Principles and practices

There are some principles and practices that will help to design orthogonal system which is extendable without breaking the existing functionality:

  • loose coupling
  • high cohesion

To reduce complexity of the system the following principles can be used and followed:

  • KISS
  • DRY
  • information hiding
  • YAGNI
  • SoC (Separation of Concerns)
  • SOLID (SRP, OCP, LSP, ISP, DIP)

To improve quality of the system the following practices can be used:

  • unit testing
  • pair programming
  • reviewing artifacts

Also, software architecture patterns can be used to solve the common recurring problems.

Software architecture patterns

Software architecture patterns provide solutions for common and recurring problems in software designing process. They give the high level structure of the system that can be understandable by other developers as such patterns are commonly used.

There are a lot of patterns, but the most commonly used:

There are a set of quite ‘new’ architectures and principles which are worked well for applications deployed to the cloud:

Cross-cutting concerns

Cross-cutting concerns represent functionality which are used by multiple part/layers of the application (e.g. security, logging, caching, error handling, configuration, monitoring). So logic of such concerns are called by different components.

The following methods are used to implement and use the logic of cross-cutting concerns:

Performance

Before working on performance improvement and optimizations, need to make sure that the code is correct. But the software system should be enough fast as it affects user experience.

Performance is one of the quality attributes and it should be documented. It also should be testable and measurable. Usually improving performance is done using an iterative way: monitoring, profiling, analyzing, implementing.

There are a set of terms related to performance:

There are a couple of standard mechanics and ways to improve performance:

Security

Security is important part of any software application. There is CIA triad which summarize the attributes that the system can have:

  • confidentiality
  • integrity
  • availability

Software architect should try to keep a balance between these attributes.

There is threat modeling which is structured approach to analyzing security for an application (STRIDE threat model, DREAD risk assessment model). Also there are techniques to create an application that are secure by design:

Cryptography is the study which allows to keep information in secret. IAM (Identity and access management) allows to centralize information related to the application security.

Most common web application risks:

Documenting and reviewing

Documenting is an important part of delivering architecture. It allows to educate, train other team members, share architectural knowledge and provide entry points for review.

There are a set of techniques to describe an architecture in an understandable way, e.g using UML and architectural view models (like 4 + 1). Some additional information can be found here.

Reviewing architecture methods:

DevOps

DevOps allows to build, integrate, deploy and deliver the application in fast, automatic and incremental way. It allows to follow ‘fail fast’ principle during releasing a new version of the application and roll back to the previous version quickly in case of the failed released version.

  • Continuous integration, with automatic builds and tests, allows to validate changes quickly.
  • Continuous delivery allows to deliver artifacts that can be deployed to the production at any time automatically.
  • Continuous deploy allows to push new versions of the application to the production in automatic way.

Needs of DevOps should be considered during the building of software application design. The following quality attributes are important for DevOps:

  • testability
  • deployability
  • maintainability

Cloud models

  • Infrastructure as a Service (IaaS)
  • Containers as a Service (CaaS)
  • Platform as a Service (PaaS)
  • Serverless/Function as a Service
  • Software as a Service (SaaS)

Legacy architecture

There are a lot of challenges in maintaining, improving, and extending legacy applications. Software architects should be able to refactor the legacy application to make it easier to extend, modify or fix.

The following actions and techniques should be considered to do refactoring:

  • making the code of the legacy application (or a part of it) testable
  • removing redundant code (dead, unreachable, commented-out code)
  • using the tools to do refactoring
  • making small incremental changes
  • extract functionalities into separate components or microservices
  • prepare migration to the cloud
  • modernizing build and deployment process

Soft skills

Soft skills are important for the software architect role. It is hard to define and measure such skills, but it is impossible to train them and enhance:

Software evolution

Software architecture should be designed to make applications extendable and changeable. So software architects should expect that there will be changes in the application. There is Lehman’s laws of software evolution.

Fitness function is a type of objective function that is used to determine how close a given solution is to achieving the desired result.

Making incremental changes, using standards, following the last responsible moment strategy, and designing loosely coupled applications allows making changes more easily in the future. It is a good practice to follow robustness principle during the designing API.

Continuous improvement

Software architects should improve their skills continuously. There are a set of activities that allows to do it:

  • continuous learning
  • writing blog
  • teaching others
  • trying new technologies
  • writing code
  • attending meet-ups
  • taking responsibilities
  • following the work-life balance
  • being proud of the work

Notes have been created after reading Software Architect’s Handbook []