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'.
419 questions
4
votes
2
answers
256
views
How to untangle bounded contexts after a team ownership reorganization?
This is inspired by Eric Evans' presentation about bounded contexts when doing Domain driven design.
In his presentation he presents a case where a bank has initially 2 teams that manage 2 bounded ...
-1
votes
3
answers
465
views
Moving from 3-tier architecture to clean architecture
Generally, for a simple project: how do you move from 3-tier architecture to clean architecture? What I'm trying to do here is to get a feedback on how would the developer which understands 3-tier ...
-4
votes
1
answer
86
views
Feedback on custom "Orchestration" architecture
I've been doing some deep thinking on how to structure code and found myself coming up with a (for me) new pattern. The pattern is based on a highly modular approach with a large focus on indirection, ...
1
vote
1
answer
159
views
REST API with swappable backends
What would be the best way to have a single REST API but with multiple "backends" (Not sure if this is the correct terminology)? Currently we have a basket/cart API that handles product ...
0
votes
1
answer
138
views
How to handle data when source of truth is through API
I am making a webapp that deals with money movement. All the financial actions are done through an API. For example, right now I can create an account for a user, add funds to their account, transfer ...
6
votes
6
answers
1k
views
Is a callback function with `this` as an argument a bad practice?
I have a class that has a callback function that gets triggered on some event. The user of the class instance is expected to do stuff on the instance itself, inside this callback function. So I am ...
0
votes
2
answers
176
views
What is a good architecture / design pattern for giving multiple shared attributes in different combinations?
I have a need for many different objects to have various combinations of attributes. For a demonstrative example, a flaming dog would have a dog attribute, a flame attribute, and a tail attribute, ...
0
votes
0
answers
45
views
Separation of Students and Users in NestJS Microservice architecture
I need help with the architecture pattern I should use in a NestJS project.
So I am using a command/query approach for developing my RestAPIs. Right now it's a Monolith and not a microservice ...
0
votes
2
answers
152
views
Allow-Rendering-Prevent-Download Architecture
I am trying to devise a simple system that, with the use of tokens, allows a specific file to be rendered in the client's browser, yet prevents the user agent from being able to download the file. ...
5
votes
1
answer
943
views
What is the difference between Hexagonal Architecture and Anti Corruption Layer Pattern?
I tried searching the web but can't understand the difference/boundary between hexagonal(ports and adapter) architecture and ACL Pattern.
While hexagonal architecture talks about creating ports(...
1
vote
2
answers
300
views
Combining Command and Visitor design patterns
Designing the architecture of a personal project, I've come up with the idea of using the combination of these two patterns to solve an architectural issue. In an MVC context, I need to implement ...
0
votes
0
answers
60
views
isolating user run scripts on docker without performance impact
Scenario:
We have a application (web based), in a small part of this application a users is able to create a small python script to mutate (in memory) data. Currently all of these scripts (if it is ...
0
votes
1
answer
170
views
Where to put the reference to Application Insights in an application designed with the Clean Architecture template?
We are implementing an application by trying to follow the Clean Architecture template for C#.
Our application is an ASP.NET core web api and we want to implement the observability for that ...
0
votes
1
answer
327
views
How choose between Clean Arch and Hexagonal Arch(Ports And Adapters)?
I'm studying architecture patterns and I don't understand which type of scenario is more preferable to use clean architecture or hexagonal architecture. Is there something like that? For example, &...
0
votes
4
answers
302
views
Best practice for using read-write lock
Given a system where users can access different services through the API for conducting business transactions, I am currently working on integrating a read-write lock into the system. One approach I ...
2
votes
1
answer
106
views
impacts on splitting web application (java) for reducing memory & compute footprint on primary user-facing app
TLDR;
what if you are tasked with taking out a feature and making it app 2 to reduce memory/compute foot print from app 1? Making an API contract between app 1 & 2 would defeat the purpose ...
0
votes
0
answers
98
views
By creating an architecture, it is better to have many classes that handles different scenarios, or a single one that handles all? [duplicate]
During my limited professional experience, I have been involved in microservices projects with a common structure:
The Controller takes a request and validates it using the jakarta.validation....
2
votes
2
answers
252
views
How to design fault-tolerant distributed "all-or-nothing" system?
I have a system where Client(C) sends request to Server(S0). S0 then sends the response back to Client that "request received" and closes the connection. C can regularly poll S0 to check on ...
3
votes
1
answer
1k
views
Best practices for team development with NuGet projects in .Net
TL;DR I want to change the way our current enterprise code base is constructed to utilize NuGet packages for the inter-project references, but that seems to present some challenges when considering ...
0
votes
3
answers
397
views
How to reconcile the fact that dependency Injection break encapsulation? (Especially when others are allowed to wire up your dependencies for you)
I was reading Martin Fowlers take on Dependency Injection, and in general have been trying to discuss it a bit online to help get rid of my own misconceptions and to understand this principle better.
...
3
votes
4
answers
289
views
Please explain the "swapable dependency" arguments for IOC containers
I get that IOC containers can be useful to help break dependencies and allow you to test a class in isolation. I don't wish to focus on that right now, instead, I'm trying to understand some of the ...
2
votes
4
answers
249
views
Design of API which is based on third-party implementations
I have 5 interfaces in an API component, which in its turn call an external 3d party solution provider (REST).
The goal is to make this component universal, and under the hood support multiple service ...
1
vote
1
answer
121
views
UI or Application layer responsibility - retrieving additional data for display
I have an application service that retrieves Order data. The service is consumed in UI, where it can be edited by users.
Additionally, the users wants to see related data such as ordered products' ...
3
votes
9
answers
4k
views
Is it an anti-pattern to use interface for entity?
I read an article about that using an interface for an entity is an anti-pattern for these reasons:
Your interface signature is identical to your class.
There’s only one implementation of your ...
1
vote
1
answer
214
views
Implementing MVC in C++ with minimal boilerplate despite lack of reflection
Powerful reflection capabilities make implementing nice architectural design patterns such as MVC and Dependency Injection very simple in languages like Java and Kotlin. In particular, reflective tags ...
2
votes
1
answer
502
views
Centralize input validation across multiple Microservices
My company, which specializes in logistics and transportation, delegated the majority of the backend microservices to our team. All of the microservices (which our team inherited from "past ...
0
votes
1
answer
115
views
Is RabbitMQ suitable for allowing SaaS customers to subscribe to events?
I work on a SaaS system which is generally a single-tenant environment. Customers (whom the SaaS instances are for) would like a way to subscribe to events, such as updates of certain data entities. ...
0
votes
1
answer
125
views
What is the name of the approach (practice) when several unrelated entities are returned at once in the response to a request [closed]
For example, for a mobile frontend, you need to get all the data for rendering at once. The interface is divided into blocks, in which there can be both blocks with a catalog (categories) and other ...
0
votes
1
answer
68
views
How to handle concurrently caching expensive request data in postgres?
I have a kubernetes deployment which is fielding expensive (but cache-able) requests, let's say a website scraping service (not really) which takes about 15 seconds to scrape a website. In my backend ...
3
votes
2
answers
264
views
In the usual "3-layer" architecture pattern, where would one best create dynamic, user-readable strings?
I've been trying to build this (principally desktop, but could eventually be turned into a cloud app) document editor program for a while and have it laid out using the broad principles of the 3-Layer ...
0
votes
0
answers
231
views
Pattern for Nuget Package (Abstractions, DepedencyInjections, etc.)
I've been interested in following what other successful libraries are doing with their nuget packages. Unfortunately, I can't seem to find any materials to read online and I don't even know what to ...
1
vote
1
answer
84
views
Handling a single event as broadcast and round-robin depending on service
I have Service A that publishes an event to RabbitMQ. I have two instances of Service B that will use the event to write to its database. I have two instances of Service C that will send the event ...
1
vote
1
answer
96
views
In the state pattern, what happens when the action doesn't depend only on the state?
I have some doubts about the state pattern, but I think it is better to ask one question at a time, so it is easier to focus on the answer.
The state pattern establishes which actions can be performed ...
2
votes
1
answer
265
views
two diffrent database in unit of work
I will explain my problem in the form of an example.
Suppose we want to use both databases in a transaction.
Data is edited in database 1 (for example, Postgres) and then added to database 2. Finally, ...
1
vote
2
answers
376
views
Using multiple databases in a bounded context
Sometimes we have to use multiple databases in one project
with the intentions of:
Denormalizing data or read models
Using the advantages of that database (technology)
There has been a lot of talk ...
0
votes
2
answers
397
views
Workers and orchestrator
I’m working on a system where we have several scheduled long running operations.
In our case this is website crawls that we perform for customers. The current setup is pragmatic where we have one ...
1
vote
2
answers
121
views
JavaScript: Change prototype chain to morph objects from a deserialized JSON to business objects
This post assumes, that dtos on the UI side (SPA) could be viewed as business objects in almost all cases - except that the business logic is missing. I'm fully aware that a dtos first responsibility ...
0
votes
3
answers
532
views
What is the difference between these two MVC diagrams?
I want to understand what is the main difference in these two diagrams when it comes to the Model-View-Controller pattern. If there is a difference, how should I choose to construct my program? What ...
-1
votes
1
answer
107
views
Most relevant objectively-quantifiable reason to choose to use an object method vs. a function that just accepts the object as a parameter? [closed]
When writing code in a programming language that has the option of creating standalone functions vs. methods of a class or struct, what is the most relevant objectively-quantifiable reason to choose ...
-1
votes
1
answer
106
views
How can I prevent an object from being re-sanitized everytime it is passed as input to a function?
Suppose that I have a class named CharStream
Additionally, there are a large number of functions which convert their function input into a CharStream
def funky_the_function(_input):
input = ...
0
votes
1
answer
610
views
How to decomposing a single bounded context into multiple microservices for organisational purposes?
I have a monolith implementing what is basically an ETL process, receive data from external system, orchestrate the processing of it, and then pass the results back to an external system. (The ...
1
vote
1
answer
63
views
How to deal with mixing models between services?
I am working on an API that has a User resource to represent the current user and a User service that handles business logic for representations of this user.
I need to introduce an Organization ...
1
vote
3
answers
1k
views
Using Repository Pattern with .NET Entity Framework with a single Get method with optional parameters for each table include
We have a very messy data repository component, with dozens of methods to interface a DbContext (entire database) in Entity Framework.
It was (and is) coded in a way that adds a new repo method for ...
1
vote
1
answer
264
views
Architecture review for desktop application with distributed components
We are planning on building a desktop application with a few web components. I want to know how resilient is this architecture.
Essentially the design looks like
Mixing web components with desktop ...
1
vote
1
answer
504
views
Microservices Pattern - Downstream Services Registering Themselves with an Upstream Orchestrator?
I'm looking for some guidance on a design proposition I have to accomplish the following use case:
We have several small microservices that each generate a unique set of "analytics" or ...
2
votes
1
answer
147
views
Design for the future or make it tightly coupled to the implementation
My question is regarding how would the developer know when you add interfaces/protocols to their code and inject them as dependency.
Consider an example of BudgetService.
protocol ...
1
vote
2
answers
2k
views
Implement message queue in API Gateway
Recently we have this client who asks for a API Gateway solution, in this case it’s Kong. Currently, they have 10 services (200 APIs) that are running on really legacy stuff (built with C++ and ...
2
votes
1
answer
1k
views
Server-side Long Running Tasks
I am trying to decide on which approach to follow for long running tasks.
Web Client (user) story
Web client connects to the server (REST API + WebSocket for real-time notifications)
Web client POSTs ...
0
votes
1
answer
2k
views
Three layer architecture and using DTOs to transfer data between layers
I have a 3 layer architecture application with presentation layer, business layer and data access layer. UI -> BLL -> DAL UI Layer has reference to only BLL and BLL refer only to DAL.
My BLL has ...
1
vote
0
answers
90
views
How to have only one consumer handle a long running task at a given point?
I need to design an application which makes requests to an external API. External API has a hierarchy of entities: User which contains ListOfItemss which contain Items. I need to get data on all Items ...