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
0 votes
0 answers
90 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....
Paul Marcelin Bejan's user avatar
1 vote
2 answers
208 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 ...
sam's user avatar
  • 23
2 votes
1 answer
229 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 ...
James Feazell's user avatar
0 votes
3 answers
248 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. ...
Scotty Jamison's user avatar
1 vote
2 answers
190 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 ...
Scotty Jamison's user avatar
2 votes
4 answers
179 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 ...
PavelPraulov's user avatar
1 vote
1 answer
69 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' ...
Liero's user avatar
  • 141
2 votes
9 answers
3k 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 ...
Mercury's user avatar
  • 53
1 vote
1 answer
134 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 ...
The_Sympathizer's user avatar
1 vote
1 answer
254 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 ...
lecarpetron dookmarion's user avatar
0 votes
1 answer
74 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. ...
Richard's user avatar
  • 101
0 votes
1 answer
116 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 ...
fogel's user avatar
  • 21
0 votes
1 answer
60 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 ...
Kellen Cataldo's user avatar
3 votes
2 answers
234 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 ...
The_Sympathizer's user avatar
0 votes
0 answers
77 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 ...
Lawrence's user avatar
  • 123
1 vote
1 answer
53 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 ...
DaveO's user avatar
  • 136
1 vote
1 answer
87 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 ...
Álvaro García's user avatar
2 votes
1 answer
149 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, ...
Amir Hosein's user avatar
1 vote
2 answers
212 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 ...
PersianMan's user avatar
0 votes
2 answers
184 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 ...
Markus Knappen Johansson's user avatar
1 vote
2 answers
99 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 ...
morpheus05's user avatar
0 votes
3 answers
300 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 ...
codertryer's user avatar
-1 votes
1 answer
94 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 ...
MikeSchinkel's user avatar
-1 votes
1 answer
94 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 = ...
Samuel Muldoon's user avatar
0 votes
1 answer
276 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 ...
user1937198's user avatar
1 vote
1 answer
58 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 ...
JRhodes's user avatar
  • 19
1 vote
3 answers
538 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 ...
Veverke's user avatar
  • 423
1 vote
1 answer
149 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 ...
Varunkumar Manohar's user avatar
1 vote
1 answer
292 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 ...
underzealous-apricot's user avatar
2 votes
1 answer
140 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 ...
john doe's user avatar
  • 141
1 vote
2 answers
977 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 ...
Rex Low's user avatar
  • 119
1 vote
1 answer
681 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 ...
Gr3at's user avatar
  • 121
0 votes
1 answer
1k 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 ...
Alfons Deda's user avatar
1 vote
0 answers
67 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 ...
Yos's user avatar
  • 155
1 vote
2 answers
301 views

DDD rich domain model - dynamic dependencies - EAA

class Product... public static Product newWordProcessor(String name) { return new Product(name, new CompleteRecognitionStrategy()); } Martin Fowler presents this code in his book "Patterns of ...
Ten Jones's user avatar
-1 votes
1 answer
107 views

How to automatically calculate the norm for users in our time registration application?

I'm creating a time registration application for employees where they can register their hours. I want to show the users their "norm" (not sure if this is an actual word or just made up by ...
Allart's user avatar
  • 99
1 vote
2 answers
122 views

Applying Domain Driven Design to applications with both reading and writing heavy logics

We are planning a complete rewrite of a very complex project (10+ years, ~15 different application modules) and we would like to adhere to DDD and CQRS as much as possible but we are struggling to fit ...
Andrew's user avatar
  • 11
1 vote
3 answers
113 views

Separating network logic from business logic

I am creating a simple P2P file sharing system, where one peer can send some Objects (e.g., String, custom objects, etc...) to another peer. The peer, that receives the Object, can then manipulate it, ...
Simone Brigante's user avatar
1 vote
4 answers
577 views

Avoiding Synchronous Communication Between Microservices

Something that annoys me when reading about decoupling microservices is that the problem is often stated, with either poorly explained, bad, or no solutions provided, which seems to especially be the ...
The Corn Inspector's user avatar
0 votes
0 answers
41 views

Design pattern for scheduling method calls (open-loop control) [duplicate]

I have an ERP-style system that needs to allow users to orchestrate an Entity.action() on a variety of objects that implement the Entity interface, at different datetimes. Calling action() would ...
Escher's user avatar
  • 185
-2 votes
1 answer
218 views

Is it OK to use a Command Sourcing instead of Event Sourcing? Replay events in Commands-Repositories

I have a system that uses a graph database without any ORM, mapper or tool that tracks entity changes, like EntityFramework. I'm not using domain entities, instead I have an Event that calls changes ...
Augusto Will's user avatar
0 votes
1 answer
65 views

Intraservice Communication Using Kafka

recently i came across an architectural diagram in my organization, where a backend service sends messages to itself using Kafka, so basically it queues the messages and reads from the queue and ...
Gitonga Tosh's user avatar
-1 votes
2 answers
136 views

Appropriate design pattern for coupled Objects

I code an Object-Oriented simulation where you can have a Unit move on a Terrain. The cost of such move depends both on both Unit capabilities and Terrain features: a boat can move on water, a plane ...
Uriel's user avatar
  • 131
0 votes
0 answers
50 views

How big should database adapters/gateways be?

Outline When you build an Adapter that connects your application and the database, How big should you make this adapter? Should it contain all possible queries that could be made to the DB? Do you ...
DarkTrick's user avatar
  • 207
0 votes
2 answers
228 views

Microservices that needs to change row in shared DB

I have an application that can be reduced/simplify to this flow: user sends request to app A app A inserts info about the request and user into DB ( marked as "B in progress" and "C in ...
Johnyb's user avatar
  • 397
0 votes
2 answers
148 views

In an "Always On" architecture, how are duplicate concurrent transactions handled?

Imagine a scenario where a gift card has been purchased with cash, the gift card is duplicated, and each card is used to purchase an iPad at a self-service counter at exactly the same time. What are ...
Paul's user avatar
  • 19
0 votes
1 answer
165 views

Are Microservices Architecture and a Single Customer View able to co-exist?

Given the microservices pattern is the decomposition of software by business capability with ownership of state, and a single customer view is an aggregated, central, "single" data store of ...
MrPanucci's user avatar
  • 109
3 votes
3 answers
3k views

Synchronous vs Asynchronous Event Driven Architecture

I have been searching extensively about the difference between synchronous and asynchronous patterns and how this relates to event driven architecture. On its face it is quite obvious, I simply ...
Frankster's user avatar
  • 159
3 votes
5 answers
3k views

How do Singletons differ from Static variables?

Although I do find some (apparently old) posts on the topic on the web, I could not find one here at SE. Thought of raising this here to see if what I read is accurate/is all there is to it. So ...
Veverke's user avatar
  • 423
0 votes
2 answers
106 views

How to handle functional differences in an app in different locales?

I'm working on an app that needs to be localised for two different countries, let's call them Atlantis and Buranda. As well as translating the site into the relevant languages and displaying dates, ...
Allan Lewis's user avatar

1
2 3 4 5
9