Skip to main content

Questions tagged [design-patterns]

A design pattern is a general reusable solution to a commonly occurring problem in software design.

Filter by
Sorted by
Tagged with
1 vote
4 answers
156 views

I'm working on a Spring Boot application with a VoucherService and VoucherController. I currently have the service method return an ApiResponse<T> directly, like this: @Transactional public ...
Conquer the world's user avatar
2 votes
2 answers
304 views

I have a data aggregation function that collects statistics from multiple sources. The problem is that whenever I add a new metric, I need to manually update the code in three different places, which ...
Tank's user avatar
  • 37
2 votes
7 answers
359 views

Recently a junior team member was asked to use a survey tool to act as a system by which fuel delivery drivers could submit their Bill of Lading to our dispatch team for record collection after ...
David Stratton's user avatar
0 votes
6 answers
291 views

In a certain program I would like to have three objects, say, a, b, and c, with c being a shared private member (sub-object) of a and b. The data between the three objects shall only go this way: a &...
Alexey's user avatar
  • 958
1 vote
1 answer
152 views

Problem Match prioritized tasks with suitable workers. Details Consider a task with following properties - type and size. Based on task type, tasks are prioritized. While a worker has following ...
Ammar's user avatar
  • 123
0 votes
1 answer
114 views

I'm developing a microservice-based application that processes a high volume of messages. Each message must be handled according to the user’s personal settings and some tenant-specific (customer) ...
GeekChap's user avatar
0 votes
0 answers
76 views

I like using dependency injection but sometimes I find that I have to nest some dependencies so deep that I would almost rather use a global variable (despite this being bad practice). Here is an ...
Leftover Salad's user avatar
3 votes
1 answer
194 views

Imagine I got user which might be either author, administrator, reviewer An author have relation on book that he wrote. An administrator have relation on banned user (we track which administrator ...
Vincent PHILIPPE's user avatar
2 votes
3 answers
166 views

Below is a scenario that needs to be modeled using the Domain-Driven Design (DDD) approach. A Project can have Notes added to it. A Note cannot exist without a Project. A Note needs to be viewable ...
EMN's user avatar
  • 795
3 votes
3 answers
492 views

Our development team works with a micro-service node.js architecture. This means we work with a very large amount of repositories that currently each take care of their own dependencies. To avoid ...
dreagan's user avatar
  • 147
4 votes
2 answers
713 views

I just learned about the Functional Options pattern in golang. what are the benefits of using it over just allowing to pass a config struct and just overriding the default values provided in the ...
moshevi's user avatar
  • 149
1 vote
3 answers
311 views

In a CQRS architecture, at least as implemented by Vaughn Vernon in IDDD_Samples, the query services lives in the application layer. But then where and how should authorization be handled? For example,...
Kyle Richards's user avatar
3 votes
5 answers
1k views

Specifically, I mean code structured in a way where storage is global. Bare with me, as my terminology is all over the place. If I want to create a variable, I "load" it into a global cache. ...
Scene's user avatar
  • 149
2 votes
3 answers
317 views

I'm currently reading "Implementing Domain-Driven Design" while going through the code samples, but I'm having trouble modeling aggregates that stores a huge list of value objects. For ...
Kyle Richards's user avatar
21 votes
5 answers
4k views

I'm developing an enterprise-grade warehouse management application for a chemistry laboratory. A critical feature involves mixing multiple stock solutions to create new solutions based on predefined ...
Biowav's user avatar
  • 321
2 votes
3 answers
998 views

I've been considering the way to solve this problem for a while, and I'm currently stuck between two options I both feel are suboptimal. Here's an abstract example of what I'm dealing with: I have a ...
pulpicated's user avatar
-2 votes
1 answer
215 views

I'm working on an ASP.NET Core application that requires handling multiple types of a single entity. Each type has its own properties and validation rules, which has led to confusion and complexity in ...
Marko Sami's user avatar
1 vote
2 answers
203 views

I've been reading articles on Hexagonal, Onion, Clean Architectures, and other Domain-Driven Designs. A common theme they emphasize is decoupling components. From what I gather, this means the UI ...
Saurabh Batra's user avatar
2 votes
3 answers
275 views

I have an application, which contains a logger. The logger already exists and is ready to be used, so it can be passed directly to the constructor. class App { private readonly logger: Logger; ...
404 Name Not Found's user avatar
0 votes
2 answers
128 views

I'm trying to make a utility Master class for aws client, and have mainly come across 2 types of commands/operations. Ones that require the S3Client, and others that do not. Therefore, I divided the ...
haxwagores's user avatar
-2 votes
1 answer
234 views

I am currently developing a microservices architecture consisting of two services, and I'm facing a challenge related to transaction management and error handling. Microservice A: This service is ...
Oleg Pro's user avatar
2 votes
4 answers
446 views

Suppose a class needs multiple properties of the same type. I don't want a big constructor where the user can mess up the order of args (remember, they are of the same type, no compile-time errors) ...
Sergey Zolotarev's user avatar
3 votes
6 answers
608 views

EDIT: This post has a single question but a lot of context. The single question is if there are downsides with the approach I'm taking over the common Visitor pattern. I've been thinking about the way ...
AFP_555's user avatar
  • 423
1 vote
1 answer
316 views

Question: What are common architecture patterns/strategies of updating user data (think of XML/Json/sqlite/custom binary format) when the format of the data needs to be changed, and when that change ...
GameRaccoon's user avatar
2 votes
1 answer
174 views

I have a Spring Boot REST API that will copy content from one Amazon S3 bucket to another. The source and destination buckets are specified in the body of a POST request sent to the API. This works ...
Space Cadet's user avatar

1
2 3 4 5
91