If you attended any of Software Architectures classes or read any books regarding the Software Architecture, it is common to have buildings Architecture as an analogy to understand the main concept about the Software Architecture. We will use the same here to understand what is the style and what is the pattern
An architectural style is characterized by the features that make a building or other structure notable and historically identifiable. A style may include such elements as form, a method of construction, building materials, and regional character. Most architecture can be classified as a chronology of styles which changes over time reflecting changing fashions, beliefs, and religions, or the emergence of new ideas, technology, or materials which make new styles possible.
For example, to imagine that there are a lot of Building architecture styles which changed over time
|Gothic Architecture style||
Source: St Paul’s Church
|Modern Architecture style||
Source: JFK International Airport
There are others as well, you can see that these styles are different in their characteristics which define the main architecture of the building and they evolve by time and improvements can lead to new styles. An architectural pattern in software also known as an architectural style is analogous to an architectural style in buildings, such as Islamic or Gothic or Greek Revival or Queen Anne. It consists of a few key features and rules for combining them so that architectural integrity is preserved. All Software architecture is based on one of the Software Architecture styles of combinations of more than one style.
Taylor, R. N., Medvidovic, N., & Dashofy, E. M. (2010). Software architecture: foundations, theory, and practice. Hoboken: John Wiley & Sons.
As in the architecture word, every word is elastic and concepts can be understood differently, in some books they consider the architecture styles and patterns are the same and others did not considered that, we can notice from the above figure that there is a difference between architecture style and architecture pattern from scope and application domain knowledge, So, Architecture patterns can be a subset of Architecture styles targeting specific scope and require more domain knowledge. It argues that a Pattern is a context-problem-solution not like the style
Moreover, architecture patterns are more about the HOW and more domain specific, while architecture styles are more about the WHAT and less domain specific.
Architectural style (i.e., architectural pattern). An architectural style is “a specialization of element and relation types, together with a set of constraints on how they can be used.”
An architectural style is determined by:
- A set of elements.
- A set of relationship topologies of the elements.
- A set of constraints.
- A set of interaction mechanisms.
Although, if we considering the details level of the architecture, we have 3 levels or groups; Styles, Patterns, and Idioms, architectural styles that record solutions for system-level organization, design patterns that record solutions to detailed software design problems, and language idioms that capture useful solutions to language-specific problems.
The main difference about an architectural style is that it defines a set of organizational principles for the system as a whole, rather than for going into the details of each component of it. We consider a design pattern to target a much more specific problem related to the structure of a particular component of the system. While when we deal with specific programming language we are dealing with specific design patterns related to this language which is called language idioms.
A design pattern provides a scheme for refining the elements of a software system or the relationships between them. It describes a commonly recurring structure of interconnected design elements that solves a general design problem within a particular context.
A language idiom is a low-level pattern specific to a programming language. An idiom describes how to implement particular aspects of elements or the relationships between them by using the features of a given language.
What are the benefits of using an Architecture styles
- It is considered as a starting point of thinking and inspiration for building your architecture.
- On of the well-known styles can be a solution for the problem you are trying to solve.
- It helps in understanding your situation and problem in more depth
- It provides a deep understanding of what are the weaknesses of the style you may consider and how you will overcome these weaknesses.
- You may not find any solution for your problem and you can be inspired to create new style or pattern.
- They are reusable
- They have a standard definition in which supports interoperability.
- They have their own vocabulary of their design elements.
How Architecture Styles and Patterns are described and documented?
Architecture styles and patterns should have the main following information:
- Name: A meaningful name of the pattern to be easily recognized.
- Context: What are the situations in which the pattern may apply.
- Problem: A clear statement of the problem that the pattern is trying to solve and any constraints and principles that need to be met in order for the pattern to be effectively applied.
- Solution: A description of the solution to the problem that the pattern focuses on.
- Consequences: A clear statement of the tradeoffs that we need to consider or the problems may exist after applying this pattern.
- Shared nothing architecture
- Object request broker
- Representational state transfer (REST)
- Cloud computing
- Internet of Things
- Block chain
- Multilayered architecture
- Domain Driven Design
- Blackboard pattern
- Exception Handling
- Business Rules/Constraints
- Taylor, R. N., Medvidovic, N., & Dashofy, E. M. (2010). Software architecture: foundations, theory, and practice. Hoboken: John Wiley & Sons.
- Rozanski, N., & Woods, E. (2008). SOFTWARE SYSTEMS ARCHITECTURE.
- Bass, L., Clements, P., & Kazman, R. (2003). Software Architecture in Practice, Second Edition. Addison Wesley.
- List of software architecture styles and patterns. (2017, April 03). Retrieved July 01, 2017, from https://en.wikipedia.org/wiki/List_of_software_architecture_styles_and_patterns