Architectural Styles, Architecture Patterns, Design Patterns, and Language Idioms


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

Name Style Characteristics
Gothic Architecture style

Source: St Paul’s Church

  1. Wider windows
  2. The wider windows were decorated with tracery (a system of window decoration) and ornamentation
  3. Gothic Rose Windows are associated with great Gothic Churches and Cathedrals however some small Rose Windows were featured in the Chapels of Gothic Castles.
  4. Fan vaulting
  5. Hammer beam roofs
  6. Towers were often surmounted with very slender towers
Modern Architecture style

Source: JFK International Airport

  1. Emphasis on horizontal and vertical lines
  2. Simplicity and clarity of forms and elimination of “unnecessary detail”
  3. An adoption of expressed structure
  4. Rejection of ornamentation
  5. An adoption of the principle that the materials and functional requirements determine the result
  6. Eco-friendly designs
  7. Green architecture designs
  8. Green building materials

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:

  1. A set of elements.
  2. A set of relationship topologies of the elements.
  3. A set of constraints.
  4. 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

  1. It is considered as a starting point of thinking and inspiration for building your architecture.
  2. On of the well-known styles can be a solution for the problem you are trying to solve.
  3. It helps in understanding your situation and problem in more depth
  4. It provides a deep understanding of what are the weaknesses of the style you may consider and how you will overcome these weaknesses.
  5. You may not find any solution for your problem and you can be inspired to create new style or pattern.
  6. They are reusable
  7. They have a standard definition in which supports interoperability.
  8. 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:

  1. Name: A meaningful name of the pattern to be easily recognized.
  2. Context: What are the situations in which the pattern may apply.
  3. 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.
  4. Solution: A description of the solution to the problem that the pattern focuses on.
  5. Consequences: A clear statement of the tradeoffs that we need to consider or the problems may exist after applying this pattern.

Examples

Styles

  • Client-server
  • Shared nothing architecture
  • Object request broker
  • Peer-to-peer
  • Representational state transfer (REST)
  • Service-oriented
  • Microservices
  • Cloud computing
  • Internet of Things
  • Block chain

Pattern

  • Three-tier
  • Multilayered architecture
  • Model-view-controller
  • Domain Driven Design
  • Micro-kernel
  • Blackboard pattern
  • Sensor-controller-actuator
  • Presentation–abstraction–control

Idioms

  • Logging
  • Exception Handling
  • Archiving/Caching
  • User/Role/Policy/Permissions
  • Business Rules/Constraints

References

  • 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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s