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
118 votes
7 answers
60k 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 ...
user avatar
  • 1,315
50 votes
4 answers
26k 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....
user avatar
45 votes
11 answers
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 ...
user avatar
30 votes
11 answers
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 ...
user avatar
  • 535
28 votes
5 answers
38k 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 ...
user avatar
26 votes
4 answers
20k 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 ...
user avatar
22 votes
1 answer
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 ...
user avatar
20 votes
5 answers
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 ...
user avatar
18 votes
4 answers
21k 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 ...
user avatar
  • 283
17 votes
3 answers
21k 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 ...
user avatar
  • 20.7k
16 votes
3 answers
6k 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 ...
user avatar
  • 291
13 votes
4 answers
18k 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 ...
user avatar
  • 281
13 votes
4 answers
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 ...
user avatar
13 votes
3 answers
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: ...
user avatar
  • 323
13 votes
2 answers
26k 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 ...
user avatar
  • 425
13 votes
2 answers
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 ...
user avatar
  • 243
11 votes
3 answers
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 ...
user avatar
  • 1,950
11 votes
5 answers
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 ...
user avatar
10 votes
4 answers
942 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 ...
user avatar
10 votes
2 answers
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{ [...
user avatar
  • 328
9 votes
4 answers
449 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 ...
user avatar
  • 201
9 votes
5 answers
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 ...
user avatar
9 votes
2 answers
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 ...
user avatar
  • 2,564
9 votes
2 answers
945 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-...
user avatar
  • 370
9 votes
2 answers
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 ...
user avatar
9 votes
1 answer
799 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 ...
user avatar
  • 363
8 votes
2 answers
736 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 ...
user avatar
  • 6,361
8 votes
2 answers
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 ...
user avatar
8 votes
2 answers
642 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 ...
user avatar
8 votes
3 answers
34k 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-...
user avatar
  • 401
8 votes
1 answer
6k 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 ...
user avatar
  • 877
8 votes
4 answers
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 ...
user avatar
  • 215
7 votes
3 answers
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 ...
user avatar
  • 201
7 votes
5 answers
6k 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 -...
user avatar
7 votes
3 answers
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 ...
user avatar
7 votes
2 answers
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 ...
user avatar
7 votes
3 answers
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 ...
user avatar
6 votes
4 answers
467 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$...
user avatar
  • 171
6 votes
3 answers
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 ...
user avatar
  • 169
6 votes
1 answer
9k 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 (...
user avatar
  • 396
6 votes
1 answer
344 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 ...
user avatar
  • 191
6 votes
1 answer
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 ...
user avatar
  • 1,217
5 votes
2 answers
7k views

Can CQRS pattern exist without mediator pattern?

Can CQRS pattern exist and/or work without mediator pattern? I mean there are always commands and these commands have to be dispatched somehow to the handlers that perform some logic on them. Does ...
user avatar
  • 1,421
5 votes
2 answers
498 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 ...
user avatar
  • 189
5 votes
3 answers
223 views

Better to store references to an object, or to store its ID and retrieve it with a hashMap

Given the classes: public class SocialNetwork { private final Map<String, User> users; ... } public class User { private final String user; private final LinkedList<String>...
user avatar
  • 61
5 votes
1 answer
476 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 ...
user avatar
5 votes
1 answer
375 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 ...
user avatar
  • 167
5 votes
1 answer
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 ...
user avatar
  • 296
5 votes
2 answers
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 ...
user avatar
  • 151
5 votes
3 answers
2k views

Why using ViewModel when using also Repository?

I read this guide about recommended app architecture for Android. Here is a graphical summery: The role of ViewModel is clear, but I don't understand why we need it if we use Repository. The purpose ...
user avatar
  • 51

1
2 3 4 5
8