Skip to main content
Filter by
Sorted by
Tagged with
Advice
1 vote
3 replies
64 views

Description: I am building a web app, let's say about an organization for approving participation in a free service. There will be the following roles: Organization employee Citizen Administrator ...
Stathis Ath's user avatar
Best practices
0 votes
1 replies
45 views

I’m trying to design a “future-proof” React/JS setup where the app can switch between different AI backends (local models like WebGPU/WebLLM, API models like OpenAI/Gemini, and maybe even custom ...
Eli's user avatar
  • 57
Best practices
1 vote
2 replies
51 views

I’d like to ask about best practices for using a finite state machine to handle different enemy behaviors. I already created a state machine for my basic enemies with the following behavior: ...
TryingToImprove's user avatar
Best practices
0 votes
1 replies
55 views

I am looking for advice on how to best pass around the fit results from a (Python) script to another script. Currently, I am exporting the best-fit parameters and function names into a YAML file. I ...
Lost_Soul's user avatar
Best practices
3 votes
3 replies
69 views

I’m part of a team of 10 developers, and recently our product team requires us to use feature flags for almost every new change. The idea is that they can always “roll back” to the previous behavior ...
Jon's user avatar
  • 464
Best practices
0 votes
0 replies
49 views

I’m currently working on a personal Android project using Kotlin and Android Studio, following a basic MVVM architecture: ─main │ ├───java │ │ └───com │ │ └───example │ │ └───...
alex_pythooon's user avatar
Best practices
0 votes
3 replies
77 views

I’m studying and implementing the Composite design pattern in C# for a university project. In most textbook examples (GoF, Refactoring.Guru, etc.) the class hierarchy looks like this: Component ├── ...
user31880897's user avatar
1 vote
1 answer
86 views

What is the best practice for creating an object based on the value of a string argument? I am loading my configuration from a file and passing the string as an argument that gets mapped to a specific ...
mike erbaturakis's user avatar
Advice
0 votes
0 replies
32 views

Question: I'm building a testing system for a data quality SaaS app where tests are entirely props-driven (similar to React component testing philosophy). Goal: Create reusable, composable test ...
Vijay Savaliya's user avatar
Best practices
1 vote
2 replies
58 views

I am trying to create a full SwiftUI Document app (using swift 6, as it matters). Apple doc says that the Document init(configuration:)and fileWrapper(configuration:)are called on a background thread -...
AirXygène's user avatar
  • 3,061
1 vote
0 answers
82 views

TL;DR Suppose a Python library defines an interface meant to be implemented by third-party code. How could this library provide a factory function that creates instances of those implementations, with ...
mgab's user avatar
  • 4,054
0 votes
0 answers
82 views

I wanted to create a flexible MessageProcessor, depending on the SupplierType(= enum) and depending on which MessageProcessor comes out a different Message-object will be used. The current situation ...
zhrgci's user avatar
  • 716
-1 votes
0 answers
162 views

I'm developing a game with Unreal Engine 5.4.4 and C++ using Visual Studio 2022. From a Character class I’m calling a GameMode’s method that will destroy this Character class that is calling the ...
VansFannel's user avatar
  • 46.2k
Best practices
2 votes
4 replies
118 views

Follow-up on this question: Singletons: good design or a crutch? It is true, that using singletons can make testing harder, and bugs can hide behind them. GoF defines singleton to use when: Global ...
zerocukor287's user avatar
  • 1,694
Best practices
3 votes
1 replies
115 views

I am creating an E-Commerce app. It has Category and Product classes. Both have multilingual descriptions, so, tables with title, description, meta-*, etc. and unique key (id, language_id). To add ...
qarabala's user avatar
  • 178
3 votes
1 answer
83 views

I’m refactoring my Laravel application to follow a clean architecture approach with clear separation of concerns: Controller → Service → Repository The Controller handles the HTTP layer,the Service ...
Lana Hanna's user avatar
-1 votes
2 answers
159 views

I complete the implementation of a VM (ALU part) by adding operations to a Coprocessor. In this sense, I'm looking for a C++ design. Through a template, the VM is instantiated in 2 ways : A first ...
bitmap kid's user avatar
-1 votes
1 answer
67 views

A question on consideration for case/approach choice. Let's say we have an app that has an ORM model and also uses simple realisation of the Command pattern. Inside of each command we need to ...
Gennadiy's user avatar
  • 341
-3 votes
1 answer
73 views

I have an 8-level hierarchy of classes in Java. This is useful so each abstract class implements methods that are common in the whole sub-branch of the tree. That's working fine. However, after going ...
Joe DiNottra's user avatar
  • 1,083
0 votes
1 answer
157 views

In Java, I can write something like this: public class Brother { private final Parent parent; public Brother(Parent parent) { this.parent = parent; } public void annoySister() { ...
office.aizaz's user avatar
0 votes
0 answers
45 views

Goal Implement a Singleton Design Pattern for a struct, without multiprocessing considerations. Minimal example Here is the base of the code, without the singleton logic. struct ...
GregoirePelegrin's user avatar
2 votes
0 answers
225 views

I'm designing my system which consists of three parts, abstract layer (al) where traits and generic data structures are defined; implementation layer (il) where different structures implement traits; ...
Eason's user avatar
  • 171
0 votes
0 answers
78 views

I have two functions in my application startup sequence: // Function A async function loadPlugins() { // loads plugin definitions } // Function B async function createStoreInstance() { const ...
dlocyalp's user avatar
5 votes
2 answers
201 views

Let me introduce first the problem. I will present a simplification of my QT6 project app (in C++) to not make it too difficult to read, as the original code has lots of unnecesary things for this ...
Alberto Moreno Castro's user avatar
0 votes
1 answer
103 views

I am developing an app on Windows using the WinAPI. This app has a UI built using my own framework. Some views of this UI are animated and need to be refreshed over time. Prior to implementing ...
user18490's user avatar
  • 3,904
1 vote
1 answer
108 views

When I make a POST request, the server responds immediately with an id, but the actual result is delivered later via a server push event (e.g., WebSocket or Pusher). Here's what I'm trying to do: When ...
dlocyalp's user avatar
5 votes
1 answer
226 views

I'm implementing factory method for my polymorphic class. The "traditional" way to do so would be to have two families of classes: for objects themselves and for their factories. In this ...
legokol's user avatar
  • 83
1 vote
1 answer
78 views

I'm working on a feature where I need to send analytics data whenever a command is executed — for example, whether the command was triggered via a hotkey or a UI button. However, I want to achieve ...
Harutyun Dokhoyan's user avatar
0 votes
1 answer
77 views

I am writing a bot capable of playing a cooperative board game with other bots or human players. In this game, there are black cards and white cards. Players can hold up to 5 cards in their hands. The ...
Adriano Todaro's user avatar
0 votes
1 answer
86 views

I’m building a Rust library that manages multiton instances keyed by strings. Users of the library provide factory methods to create instances implementing a trait, and the library should: Return the ...
Source's user avatar
  • 381
-4 votes
1 answer
171 views

I'm a bit rusty with UML and unsure if my class diagram effectively represents the architecture of my Unity system. Goal: I'd like the diagram to clearly show how GUI elements get updated through a ...
Andrea Cumino's user avatar
0 votes
0 answers
120 views

I'm trying to build a simple Finite State Machine (FSM). Intuitively, I've described each finite state as a typeclass: class FS st where fsUpdate :: st -> StatefulEntity -> StateMondad st ...
kubivan's user avatar
  • 393
1 vote
1 answer
153 views

I have a templated class Bounded which have parameters: fundamental type Min value allowed Max value allowed policy (wrap, limit) I can do it if the struct defining policy is defined outside the ...
Tomáš Nadrchal's user avatar
6 votes
2 answers
155 views

I’m currently building a unit converter app in Java (as a beginner), and I want to avoid duplicating logic for each type of unit. Right now, I have different enums like Length, Weight, Time, etc., and ...
jamesdiaz's user avatar
  • 137
0 votes
2 answers
86 views

In a interview, someone asked me this situation. How can you improve this. search with many filter condition design pattern Eg: let say search a gym by it distance, by its pincode, by its name, by its ...
nitesh's user avatar
  • 45
4 votes
2 answers
99 views

I'm new to Java class design and need help with the following: Example scenario: I want to pass the company name and email to the BaseEmailMessage class, and fetch these values from the application....
kdeepak's user avatar
  • 79
13 votes
0 answers
101 views

Explanations of Mixins in a C++ context, but many of them seem to describe use cases that are essentially Policy-Oriented Design. This has led to some confusion on my part. From what I understand, ...
Bernard Gressing's user avatar
1 vote
1 answer
100 views

Suppose I have a Parent class in Java: public class Parent { protected int value; public Parent() { value = performHeavyCalculations(); } private int performHeavyCalculations(...
i1ravenov's user avatar
1 vote
1 answer
56 views

We have an application that serves as a configuration repository, storing data in a relational database. Whenever a user changes a configuration item, it is persisted to the database and our goal is ...
Giorgi Gviani's user avatar
0 votes
1 answer
68 views

I'm currently working with a distributed system composed of multiple microservices, some of which communicate via RESTful APIs and others through asynchronous messaging (Kafka). My current challenge ...
Mark Mayfield's user avatar
1 vote
0 answers
72 views

I’m working on a PHP project where I’m using PHP-DI for dependency injection, but I’m struggling to configure a hierarchical structure of classes cleanly and scalably. I have interfaces like ...
jairhumberto's user avatar
0 votes
1 answer
160 views

A private lambda function is accessing a private final class member that is initialised in the class constructor. However, this code pattern compiles with error: variable num might not have been ...
user1589188's user avatar
  • 5,778
0 votes
2 answers
75 views

I have a question regarding whether exception classes should contain business rules, for example, supposing I have several exception methods, and in these exception methods I end up populating entity ...
Vagner Wentz's user avatar
-5 votes
1 answer
73 views

I have a simple form a user fills out. He selects some things from the DB like other users, etc, to fill in some entries, types other things manually, and submits it. So I have a question: the docs ...
ZzZombo's user avatar
  • 940
3 votes
2 answers
96 views

I am currently refactoring a legacy Job class to make it adapt to dependency injection pattern. However I have trouble managing the lifetime of IDisposable objects. It really get me stuck for a while, ...
BigHeadBangBang's user avatar
0 votes
0 answers
71 views

As a university software engineering project, my group has to make a videogame out of the board game Galaxy Truckers (rules summary, if it helps), using the MVC pattern (we're using Java as a language,...
Giacomo Amaducci's user avatar
0 votes
1 answer
192 views

I'm starting to get comfortable with Vue's composition API, but every time I make a composable I ask myself which pattern to use. If I have a composable whose state depends on outside triggers: ...
Christian's user avatar
  • 841
1 vote
0 answers
129 views

I'm developing a workout tracking app that integrates with Health Connect to collect and process sensor data during a workout session. The expected workflow is: The user starts a workout. Health ...
Clover99's user avatar
0 votes
1 answer
72 views

I am working on a implementation of the observer design pattern where each observer is tied to a concrete type which should be received on notify. See the following minimal example: Playground link ...
Mihai's user avatar
  • 1,106
-2 votes
1 answer
121 views

The following is a toy example: An image stores a width, height and filepath, represented by the struct IMAGE: #include <cstdlib> #include <type_traits> struct IMAGE { int WIDTH; ...
timmy george's user avatar

1
2 3 4 5
644