All Questions
Tagged with patterns or design-patterns
32,172 questions
Best practices
0
votes
3
replies
96
views
How to suggest movies that the user didn't see already in real time?
I am building a simple school project, and the idea is that users form a group together, then an activity (for example movie activity), and then in that activity the app suggests movies for every ...
Advice
3
votes
6
replies
196
views
In Laravel, when should I use Controllers, Services, Actions, Repositories, Model?
I'm trying to understand the commonly accepted architecture patterns used in Laravel applications.
I've come across different approaches in various projects:
Controller → Model
Controller → Service → ...
Best practices
0
votes
1
replies
77
views
How to design a maintainable fallback pipeline for classifying bank transactions from different statement formats?
I am building a Java/Spring application that imports and parses bank statements from different banks.
Each bank provides slightly different transaction data.
After parsing, I normalize raw bank rows ...
Advice
0
votes
1
replies
91
views
what's the correct route to put the nested routes in, with featured-based architectrure
I'm learning Express.js and I'm working on a big project on my own, an e-commerce (kind of SaaS).
I'm building the nested routes and controller, service, repo, etc. but the project is so big that I ...
Advice
0
votes
2
replies
103
views
How To Manage Infrastructure And Domain Layer Properly In Clean Architecture
I am learning about Clean Architecture. I know there are different interpretations but I am trying to follow the original one by Uncle Bob.
I am implementing some basic logic in my infrastructure ...
Best practices
0
votes
2
replies
76
views
Best way or recommended to switch between repository implementations in Spring Boot without manually editing application.properties?
I am working on a Spring Boot project where I have multiple repository implementations for the same interface.
For example:
an in-memory implementation
a PostgreSQL implementation
a MongoDB ...
Best practices
1
vote
3
replies
116
views
Is it a bad practice to use many instanceof checks in a Spring Boot REST controller to map multiple persistence models?
I am building a Spring Boot REST API for a tree structure. The project uses an OpenAPI contract-first approach, so my controller implements a generated interface:
java
@RestController
public class ...
Advice
0
votes
3
replies
182
views
How to write layered code in C for embedded devices
I'm struggling to implement data persistence in non-volatile memory in a modular, reusable and layered way.
In my application I have (I think I have) 3 types of data to persist:
system configuration (...
Best practices
2
votes
1
replies
107
views
Is @ConditionalOnProperty actually the Strategy Pattern or just a startup-time Factory?
I'm using `@ConditionalOnProperty` to select between two algorithm implementations at startup:
java
@Bean
@ConditionalOnProperty(name = "app.tree-strategy", havingValue = "collections&...
Best practices
2
votes
13
replies
153
views
Best Way of Designing a Data Transfer Object for Variable Data?
My apologies if this question has been answered, but I was unable to find suitable information here and generally.
Within legacy applications that currently are still restricted to run on the .NET ...
Score of 0
2 answers
120 views
How to wrap a concrete subclass within the abstract/final design pattern
I'm using the equinox library for a project, written in python.
This library is used to define dataclasses and strongly recommends to use the abstract/final pattern when designing these classes.
I ...
Best practices
1
vote
1
replies
80
views
integrate dynamically with multiple external institutions
I’m building a Java Spring Boot system that needs to integrate dynamically with multiple external institutions (banks/payment providers/etc.).
Each institution can have:
Different protocol types (...
Advice
0
votes
4
replies
243
views
Multi states typestate pattern in Rust without violating OCP
I'm aware of the typestate pattern in the Rust programming language. However, I've encountered multiple problems while adapting this philosophy on an object that have multiple states at the same time, ...
Best practices
0
votes
0
replies
64
views
Game Engine Design - Dependency Injection vs Service Locator
I've been working on an ECS game engine using the EnTT library. I've tried to stick to the following design rules:
Components are purely structs
Systems are collections of functions (not classes)
...
Best practices
0
votes
1
replies
81
views
Where should "is this supported by our product?" flags live — on the data DTO or on a dedicated service?
I'm looking for a second opinion on a design decision.
No right answer expected - curious how others reason about it.
Context:
We have a multi-tenant platform. Each tenant is tied to a country, and ...