Layers

Architectural Patterns

Architectural patterns describe the fundamental structure of a software system and are often based on design patterns. The five Pattern-Oriented Software Architecture series books provide a precious source of architectural patterns.

 Layers

Let me start with the big picture: what is the difference between an architectural pattern, a design pattern, and an idiom?

Architectural Patterns, Design Patterns, and Idioms

The main difference between architectural patterns, Design Patterns, and Idioms is their structural categorization based on their scale and abstraction:

  • Architectural patterns describe the fundamental structure of the entire software system. They are often based on design patterns.
  • Design patterns define the components’ interaction and focus on subsystems.
  • An idiom is implementing an architecture or design pattern in a concrete programming language. The popular idiom in C++ is Resource Acquisition Is Initialization (RAII). Container,  smart pointers, and locks model them.

Let me bring my thoughts about architectural patterns, design patterns, and idioms to the point:

  • The structural categories go from abstract to concrete. Idioms are the most concrete ones.
  • They’re acting on the macro level (architectural patterns), micro-level (design patterns), and programming language (idioms).
  • Architectural patterns focus on the system, design patterns subsystems, and idioms programming language.

POSA

The Pattern-Oriented Software Architecture series (POSA) is a precious source of architectural patterns. It consists of five books:

I will present in my posts seven very often used architectural patterns: Layers, Pipes-and-Filters, Broker, Model-View-Controller (MVC), Reactor, Active Object, and Monitor Object.

POSA 1 provides the first classification:

From Mud to Structure

These patterns provide a controlled decomposition of an overall system task into cooperating subsystems.

 

Rainer D 6 P2 500x500Modernes C++ Mentoring

  • "Fundamentals for C++ Professionals" (open)
  • "Design Patterns and Architectural Patterns with C++" (open)
  • "C++20: Get the Details" (open)
  • "Concurrency with Modern C++" (open)
  • "Generic Programming (Templates) with C++": October 2024
  • "Embedded Programming with Modern C++": October 2024
  • "Clean Code: Best Practices for Modern C++": March 2025
  • Do you want to stay informed: Subscribe.

     

    • Layers: Split a task into layers. Each layer has a specific responsibility and provides a service to a higher layer.
    • Pipes and Filters: Decompose a task that performs complex processing into a series of separate elements that can be reused. This can improve performance, scalability, and reusability by allowing task elements that perform the processing to be deployed and scaled independently. (https://docs.microsoft.com/en-us/azure/architecture/patterns/pipes-and-filters)

    Distributed Systems

    Build systems whose components are located in different processes or address spaces.

    • Broker: Structures distributed software systems that interact with remote service invocations. It is responsible for coordinating the communication, its results, and exceptions.

    Interactive Systems

    Build a system with human-computer interaction.

    • Model-View-Controller (MVC): Divides the program logic of a user interface into the separate components model, view, and controller. The model manages the data and rules of the application. The view represents the data, and the controller interacts with the user.

    POSA 2 added further classifications:

    Event Demultiplexing and Dispatching

    Initiate, receive, demultiplex, and dispatch events in distributed and network systems.

    • Reactor: An event-driven application that can accept multiple client requests simultaneously and distribute them to different service providers.

    Concurrency Patterns

    Addresses concurrency architecture and design issues for components, subsystems, and applications.

    • Active Object: Separates the method execution from the method call.
    • Monitor Object: Synchronizes access to an object so that only one member function can be executed at any time.

    What’s Next?

    After this overview of the POSA books and their pattern, I will present the architectural pattern Layers in my next post.

     

    {module title=”Marketing”}

     

     

     

     

     

    Thanks a lot to my Patreon Supporters: Matt Braun, Roman Postanciuc, Tobias Zindl, G Prvulovic, Reinhold Dröge, Abernitzke, Frank Grimm, Sakib, Broeserl, António Pina, Sergey Agafyin, Андрей Бурмистров, Jake, GS, Lawton Shoemake, Jozo Leko, John Breland, Venkat Nandam, Jose Francisco, Douglas Tinkham, Kuchlong Kuchlong, Robert Blanch, Truels Wissneth, Mario Luoni, Friedrich Huber, lennonli, Pramod Tikare Muralidhara, Peter Ware, Daniel Hufschläger, Alessandro Pezzato, Bob Perry, Satish Vangipuram, Andi Ireland, Richard Ohnemus, Michael Dunsky, Leo Goodstadt, John Wiederhirn, Yacob Cohen-Arazi, Florian Tischler, Robin Furness, Michael Young, Holger Detering, Bernd Mühlhaus, Stephen Kelley, Kyle Dean, Tusar Palauri, Juan Dent, George Liao, Daniel Ceperley, Jon T Hess, Stephen Totten, Wolfgang Fütterer, Matthias Grün, Phillip Diekmann, Ben Atakora, Ann Shatoff, Rob North, Bhavith C Achar, Marco Parri Empoli, Philipp Lenk, Charles-Jianye Chen, Keith Jeffery,and Matt Godbolt.

    Thanks, in particular, to Jon Hess, Lakshman, Christian Wittenhorst, Sherhy Pyton, Dendi Suhubdy, Sudhakar Belagurusamy, Richard Sargeant, Rusty Fleming, John Nebel, Mipko, Alicja Kaminska, Slavko Radman, and David Poole.

    My special thanks to Embarcadero
    My special thanks to PVS-Studio
    My special thanks to Tipi.build 
    My special thanks to Take Up Code
    My special thanks to SHAVEDYAKS

    Seminars

    I’m happy to give online seminars or face-to-face seminars worldwide. Please call me if you have any questions.

    Standard Seminars (English/German)

    Here is a compilation of my standard seminars. These seminars are only meant to give you a first orientation.

    • C++ – The Core Language
    • C++ – The Standard Library
    • C++ – Compact
    • C++11 and C++14
    • Concurrency with Modern C++
    • Design Pattern and Architectural Pattern with C++
    • Embedded Programming with Modern C++
    • Generic Programming (Templates) with C++
    • Clean Code with Modern C++
    • C++20

    Contact Me

    Modernes C++ Mentoring,

     

     

    0 replies

    Leave a Reply

    Want to join the discussion?
    Feel free to contribute!

    Leave a Reply

    Your email address will not be published. Required fields are marked *