Questions tagged [design-patterns]
A design pattern is a general reusable solution to a commonly occurring problem in software design.
4,527 questions
-1
votes
2
answers
110
views
Best Practices for Secure Web App Admin Console
Query:
For a Web app using React/NextJS/Supabase, hosted on Vercel, what design pattern follows architectural and security best practices when designing an admin console? The console must serve as a ...
3
votes
1
answer
113
views
Architectural patterns for multiplexing multi-protocol TCP and routing connectionless UDP behind a strict single-IP NAT
Context and Problem Statement
I am designing a routing architecture for a bare-metal edge host residing behind a restrictive NAT router (a single public IPv4 address). This scenario is common in ...
1
vote
3
answers
377
views
How would you connect two portals in a game?
A simple game is initiated from a string such as
'X//X1
X1??2
OA2XX'
The characters refer to different tiles types and you have a CreateTile factory function that handles mapping the characters to ...
10
votes
5
answers
2k
views
Is it good practice to include utility methods as properties in data models?
My app is an Android app where I pass the below User object to all the screens.
This class contains hour format and timezone properties that determine time formatting preferences:
data class User(
...
0
votes
1
answer
83
views
Web application tied to a single reality: design patterns to generalize it [closed]
A web application was realized for the specific needs of a production plant.
Now the customer wants to extend its use to a second production plant and in the future to others.
Production plants look ...
0
votes
0
answers
53
views
How to abstract data provision in django?
Say myModel's data should be populated from multiple third party providers llm/api data.
I want to avoid repeating the get_response logic in multiple models.
My current thoughts consist of inheriting ...
5
votes
3
answers
291
views
How to organize multiple customized projects around a shared and evolving codebase?
I currently have around twenty GitHub repositories used by one group of developers. Each repository is a Spring Boot Java microservice.
I now want to open these repositories to a second group in order ...
2
votes
4
answers
585
views
Are there any functional approaches, to have variables that feel global (no need to pass them around explicitly), yet are local to an instance?
I'm developing a library in JavaScript (TypeScript, actually) which is split into several modules. It's meant to run both on the web and in non-web environments like Node.js.
The library is meant to ...
1
vote
5
answers
348
views
Is it good practice to return ApiResponse from a Spring service layer?
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 ...
-2
votes
1
answer
237
views
Is there a name for this anti-pattern? (reference to a class member passed to another class method) [closed]
Is there a name for this anti-pattern?
A reference to a class member is being passed to another class method, rather than having the class method set the class member directly.
public class ...
2
votes
2
answers
320
views
How to design extensible data aggregation code to avoid manual updates in multiple places?
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 ...
1
vote
1
answer
294
views
OO design - Process that relies on the current state of objects
We have a CAD software extension, where you can draw products like walls, doors, windows, etc., and you can export the drawing as an order, which contains the parts and costs.
As part of this export, ...
2
votes
7
answers
413
views
I'm looking for a design principle referring to using a system for it's intended purpose
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 ...
0
votes
1
answer
169
views
Best practices for serving encrypted files in Laravel?
I'm building a Laravel-based web application that functions as a personal online photo archive. Each user uploads and manages their own private collection of images. These images are encrypted at rest ...
1
vote
6
answers
380
views
Design pattern for exposing different parts of interface to different entities
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 &...