Questions tagged [architectural-patterns]

An architectural pattern is a general reusable solution related to the high level structure of software systems. For reusable solutions having a more specific scope (e.g. individual classes/components and their interactions), prefer the tag 'design-patterns'.

Definition

Architectural patterns are general reusable solution related to the general structure of software systems, similar to design patterns but with a broader scope:

  • Software architecture refers to the high level structures that make a system.

  • Patterns describes a common problem and the core of a solution in a way that it can be reused.

High level structures are for example applications that make a system, layers that make an application, services or microservices, groups of components. Architectural patterns is about how these structures can be related and used.

Disambiguation

The borderline between architectural pattern and design pattern is fuzzy.
For example MVC can be considered as:

  • a design pattern, because in a very small scale it could be about just three classes and how they interact
  • a combination of design patterns, as the "Gang of Four" has pointed out in their pioneering book on design patterns
  • an architectural pattern, because M, V, C can each represent a large group of classes, and their relation between the three is in fact about similar relations between the classes that compose them.

The choice of the right tag requires to take into account the purpose of the question:

  • use if it is about how to organize a system into larger parts and how these parts interact as a whole.
  • use in all other cases, and especially it if is about relations between individual classes.
  • both are not mutually exclusive.
396 questions
131
votes
7 answers

Clean Architecture: Use case containing the presenter or returning data?

The Clean Architecture suggests to let a use case interactor call the actual implementation of the presenter (which is injected, following the DIP) to handle the response/display. However, I see people implementing this architecture, returning the…
53
votes
4 answers

Ways to share DTO across microservices?

My scenario is as follows. I am designing a system designed to receive data from various types of sensors, and convert and then persist it to be used by various front-end and analytics services later. I'm trying to design every service to be as…
45
votes
11 answers

What does Robert C. Martin mean by SQL being unnecessary?

I've been reading/watching a lot of Robert C. Martin content. I've come across him saying SQL is unnecessary because of solid state drives. When I search other sources to back this up I get a bunch of random articles describing the difference of SQL…
31
votes
5 answers

Function returning true/false vs. void when succeeding and throwing an exception when failing

I'm building an API, a function that uploads a file. This function will return nothing/void if the file was uploaded correctly and throws an exception when there was some problem. Why an exception and not just false? Because inside an exception I…
30
votes
11 answers

How many design patterns and levels of abstraction are necessary?

How can I tell my software has too much abstraction and too many design patterns, or the other way round, how do I know if it should have more of them? Developers I work with are programming differently concerning these points. Some do abstract…
26
votes
4 answers

Is CQRS/MediatR worth it when developing an ASP.NET application?

I've been looking into CQRS/MediatR lately. But the more I drill down the less I like it. Perhaps I've misunderstood something/everything. So it starts out awesome by claiming to reducing your controller to this public async Task
Snæbjørn
  • 391
  • 1
  • 3
  • 7
22
votes
1 answer

Learning Asynchronous programming

Asynchronous non-blocking event driven programming seems to be all the rage. I have a basic conceptual understanding of what this all means. However what I'm not sure is when and where my code can benefit from being asynchronous, or how to make…
21
votes
5 answers

Is the Entity Component System architecture object oriented by definition?

Is the Entity Component System architecture object oriented, by definition? It seems more procedural or functional to me. My opinion is that it doesn't prevent you from implementing it in an OO language, but it would not be idiomatic to do so in a…
19
votes
3 answers

Model-View-Controller: Does the user interact with the View or with the Controller?

I have recently learned about the MVC design pattern. I'm learning from the Head First Design Pattern book. According to this book (if I understand correctly): The Model is most of the application logic and data. The View is basically the GUI that…
Aviv Cohn
  • 21,190
  • 31
  • 118
  • 178
18
votes
4 answers

How to handle "circular dependency" in dependency injection

The title says "Circular Dependency", but it is not the correct wording, because to me the design seems solid. However, consider the following scenario, where the blue parts are given from external partner, and orange is my own implementation. Also…
RoelF
  • 283
  • 1
  • 2
  • 6
16
votes
3 answers

Is using Observer pattern a good idea while building a Chess Game?

I am trying to design a Chess Game using OOPs concepts that has a UI element to it. My idea is to show the number of squares / cells a piece can travel to when selected. Basically I want to show the paths / directions in which the it can travel /…
15
votes
4 answers

Database design for objects with multiple states

Context I'm designing a database which, simplified, should be able to handle users sending job requests to each other, and after that a job can be started, finished, and reviewed. The design should be scalable (think millions of users). Approaches…
14
votes
2 answers

Avoiding constructors with many arguments

So I have a factory which creates objects of different classes. The possible classes are all derived from an abstract ancestor. The factory has a configuration file (JSON syntax) and decides which class to create, depending on the user's…
14
votes
2 answers

Are the Repository Pattern and Active Record pattern compatible?

Currently I am developing a webapp where I have defined models implementing the Active Record pattern. Each model also is defined by an interface that specifies the Entity properties and makes it easy to inject it into other classes, specially…
13
votes
3 answers

How to design a high-availability application

We currently have a classic n-tier application: DB / web service / front-end. It has other components, but it's the basic layout. We want to improve the application availability for 3 main reasons: Our host sometimes experiences outages (as they…
thomasb
  • 323
  • 1
  • 3
  • 11
1
2 3
26 27