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'.

Filter by
Sorted by
Tagged with
111
votes
7answers
54k views

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 ...
50
votes
3answers
23k views

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....
45
votes
11answers
13k views

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

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 ...
30
votes
11answers
7k views

How many design patterns and levels of abstraction are necessary? [closed]

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 ...
25
votes
5answers
35k views

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 ...
25
votes
4answers
19k views

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 ...
22
votes
1answer
14k views

Learning Asynchronous programming [closed]

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 ...
19
votes
5answers
23k views

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 ...
18
votes
4answers
20k views

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 ...
17
votes
3answers
20k views

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 ...
16
votes
3answers
5k views

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 ...
13
votes
4answers
17k views

Are there advantages to hard-coding data values into a program?

I'm a self-taught, novice-ish coder, so I apologize if I don't nail the programmer lingo. I'm working on a project in which I am providing data, which will be continually updated, to developers who ...
13
votes
4answers
9k views

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 ...
13
votes
3answers
14k views

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: ...
13
votes
2answers
25k views

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 ...
11
votes
3answers
4k views

What is difference between publisher-subscriber and reactor patterns?

Publish-subscribe and Reactor patterns looking very similar to me. How they are different? In both patterns a message is getting passed to subscribers indirectly (listeners in reactor pattern). I ...
11
votes
2answers
7k views

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 ...
11
votes
5answers
8k views

Designing a robust architecture for multiple export types?

I'm looking for patterns or architectural guidance for an upcoming feature I'm designing. Basically, it's an export feature with multiple export targets, and I'm looking to find a way to make it ...
10
votes
4answers
891 views

Replace Conditional with Polymorphism in a proper way?

Consider two classes Dog and Cat both conforming to Animal protocol (in terms of Swift programming language. That'd be interface in Java/C#). We have a screen displaying a mixed list of dogs and ...
9
votes
5answers
1k views

OOP :What are some of the situations in which class based design is better than interface based one?

I was reading JDOM's website. Why is the JDOM API defined in terms of concrete classes rather than interfaces? Jason Hunter summarizes the arguments against an interface-based API for JDOM: With ...
9
votes
2answers
923 views

Is Haskell function composition an instance of pipe & filter architectural pattern

The pipe & filter architectural pattern is defined as a chain of processing elements, arranged so that the output of each element is the input of the next. Every example seems to consider inter-...
9
votes
2answers
2k views

Enterprise patterns for JWT authentication for REST-based application?

The JWT specification describes only the payload and how it is sent, but leaves authentication protocol open, which allows the flexibility, but quite unfortunately, flexibility can lead to ...
9
votes
1answer
790 views

Is event sourcing only for when writes are rare?

I'm reading up on event sourcing and can't stop asking myself if it only makes sense in exotic situations where writes are very rare or military-grade auditing is required. A non-exceptional system ...
9
votes
2answers
1k views

Where does apply authorization rules for my layered application?

This question is about applying rules of my application that confuse me. My controller is using service and the service is using repository. public class CommentController: ApiController{ [...
8
votes
2answers
728 views

Is "evolutionary software architecture" a contradiction?

In my understanding, evolutionary architecture boils down to making architecture easy to modify. Now architecture is often defined as the things that you should get right early because they will be ...
8
votes
4answers
428 views

Code structure to handle multiple markets? (different business rules for every state in the USA)

We're developing an app that has slightly different requirements for each business market (countries and states) that it's available from. It seems like a common situation but I can't seem to find a ...
8
votes
2answers
638 views

How can I "get in the know"?

My company posted a job listing to get me a helper. A recruiter called me today and all he kept saying was "MVC this Entity Framework that..." - He sounded shocked when I said the project uses ...
8
votes
2answers
10k views

REST: How to determine transient exceptions?

As I try to deal with the possibility of failure when I invoke RESTful endpoints or in general any HTTP endpoint I've been wondering if there is any standard or pattern in the HTTP specification or in ...
8
votes
3answers
33k views

Repository pattern with service layer - too much separation?

I have an MVC site which uses the repository pattern. I don't feel like I'm using the MVC style enough, so I'm getting ready to re-architect some of it. But I'm also wanting to do it so if the front-...
8
votes
1answer
5k views

DDD: Domain Model Factory Design

I am trying to understand how and where to implement domain model factories. I have included my Company aggregate as a demo of how I have done it. I have included my design decisions at the end - I ...
8
votes
4answers
2k views

Acceptable placement of the composition root using dependency injection (DI) and inversion of control (IoC) containers

I've read in several sources including Mark Seemann's 'Ploeh' blog about how the appropriate placement of the composition root of an IoC container is as close as possible to the entry point of an ...
7
votes
3answers
4k views

Microservices communication: Avoiding single point of failure

As far as I know, there are two commonly used patterns when dealing with services communication in a microservices architecture: Direct-calling other services. For example: Service A handles some ...
7
votes
3answers
3k views

How does Polyglot Persistence handle relational data?

I have recently been studying up on microservices, and an associated idea that I've seen is that of polyglot persistence and microservices working with their own databases, or whatever storage they ...
7
votes
2answers
1k views

Is the application architecture of Facebook Flux a new idea?

Facebook announced that it's using the architecture they call Flux to develop their projects. It consists of a single direction dataflow, and concepts like a Dispatcher, Stores and Actions (well ...
7
votes
3answers
1k views

Architecture of interaction modes ("paint tools") for a 3D paint program

We are developing a Qt-based application to navigate through and paint on a volume treated as a 3D pixel graphic. The layout of the app consists of three orthogonal slice views on which the user may ...
6
votes
2answers
2k views

How to architect a store to avoid overselling inventory (distributed database scenario)

We currently have a store/shopping cart system that uses a single database. We have products with a field for the number we have in inventory (say 100 widgets). We have a customer table. When ...
6
votes
4answers
433 views

What are some approaches used in financial applications to prevent deposit/withdrawal sync problems?

I am currently facing a problem with an application that has deposit/withdraw functionality. The underlying database (Cassandra) offers no read/write locks. Now suppose user A has deposited 100$...
6
votes
3answers
2k views

The best approach for keeping two software products in one codebase

Alright, let me shine some light on the ambiguous question. We have an analytics application written in Angular 2 and Scala that's used by quite a number of businesses. Some time last year there was ...
6
votes
1answer
7k views

DTO vs. read model

If I understand the concept of read models correctly, then it's just a simple query to return a use case specific data set. But a DTO seems to have the same purpose, but in a more complex way (...
6
votes
1answer
3k views

Engineering approach for Metadata Driven Architecture

Recently came across MDDA, I think the term was first coined by Salesforce (pg3) and others have followed it like Metadata Driven Architecture at benefitfocus.com (less dense and well written). The ...
5
votes
2answers
475 views

Singleton design for small/medium sized music player project

I am refactoring the code for a music player I wrote in Java/JavaFX. I have a few key objects which are accessed throughout the program by various other classes. I think there will be four or five ...
5
votes
5answers
5k views

Cyclic dependencies in microservices

Just wanted to know if cyclic dependency is something that one should avoid in microservice design. For example, let's say we have a simple web store that sells fruit. It could have: Account Service -...
5
votes
1answer
375 views

Is My Data Access Layer Really My Domain?

I'm not an architect, but am trying to put together a diagram which represents the architecture of the application which I am maintaining. I have one question (but welcome any comments about the ...
5
votes
1answer
316 views

If your company ships multiple products, does it make sense to use a mono repo for your integration tests?

Assumption: Each product codebase is in a separate repo. If the product codebase was a mono repo, it would be a no brainer to just put them together. Assumption: Integration tests in this context ...
5
votes
1answer
2k views

What is a first class connector?

I was reading Towards Architecture-based Self-Healing Systems, and came upon the term first-class connectors. What are they? Searching some more finds this paper Systematic Construction of Software ...
5
votes
2answers
2k views

Static Analysis tools to detect architectural patterns

Currently for school we are working on a research project. The central question of this project is: Which architectural patterns can be detected using static code analysis? With architectural pattern ...
5
votes
1answer
325 views

Too many conversion between layers

I'm developing a back-end application and I ran into the problem of too many conversions between layers. For a single type it is like this: So every time I update the model, I need to update six ...
5
votes
2answers
695 views

Dependencies within the inner hexagon of Ports and Adapters

In this article Mark Seemann explains how Onion/Hexagonal Architecture (or Ports and Adapters) are somewhat similar to a layered architecture when the Dependency Inversion Principle (DIP) is applied. ...
5
votes
1answer
2k views

Event Sourcing , sagas, bus and eventual consistency

I am currently learning about Event Sourcing via the book Microsoft .NET - Architecting Applications for the Enterprise. Event sourcing is, in my own words, an architectural pattern of storing "events"...
5
votes
4answers
3k views

DDD, modularizing the application and domain layers without breaking the DIP

Quoting DDD theory: The application layer is thin in terms of domain logic - it merely coordinates the domain layer objects to perform the actual work. When it comes to modularization, and ...

1
2 3 4 5
7