Newest Questions
64,391 questions
-1
votes
3
answers
95
views
Do GML switch-case statements perform worse than function tables? [closed]
The reason I wanted to ask is because of some code from Undertale that is responsible for choosing which dialogue set to use. It works something like this:
switch (id) {
case 0:
msg[0] = &...
0
votes
1
answer
140
views
Are there any good and modern 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 ...
0
votes
1
answer
28
views
Is my Level 1 and Level 2 DFD for the "Manage User Account" process correct?
I’m working on a Physical DFD Level 1 and 2 for an anomaly detection app, but this this post only concerns the DFD’s user-account processes. I want to check if my decomposition of a specific process ...
5
votes
5
answers
388
views
Recommended data structures/algorithms for checking peoples' availability schedules
I'm working on a platform that allows assigning users to events manually. Every user provides their general availability (Mondays 2PM - 8PM, Tuesdays not at all, Wednesdays 3:30PM-7PM, and so on). ...
1
vote
1
answer
217
views
Prevent unregistered users from accessing the system using JWT?
I am working on an identity and users service in a microservices system for which a passwordless, SMS-based authentication is a hard requirement, i.e.
User enters their phone number
System sends the ...
3
votes
2
answers
130
views
Multi processing or multi threading for pywinauto?
I am trying to automate an old GUI tool which requires filling in some data from a CSV and selecting appropriate tree item values based on it. I need to do this in multiple instances of the ...
5
votes
3
answers
1k
views
How to design a distributed system with an event broker where strong ordering is required?
I was trying to model a fairly simple real world model inside a distributed system and got stuck thinking about timing and order and would appreciate some external view on it.
Assuming I have this ...
4
votes
1
answer
111
views
Async-ifying WPF Window.Show()?
I'm working on a WPF application which has many user interactions which start with opening a non model window, allowing some interaction with the window and the rest of the application (think ...
2
votes
1
answer
102
views
How to make the common "organization > project > content" conceptual model handle more subdivisions?
I am working on a system of websites and am back to an age-old problem of how to group the content.
In simplest terms, I am wanting to build something like a hierarchical organization of content, ...
2
votes
4
answers
175
views
Multithreaded Game Server: Single send() or Many send()s for Game List?
I'm developing a multithreaded game server (C/TCP). I need to send a list of 50-100 available games to a console client.
Option A: Send 50-100 separate messages, using send() for every single ...
-1
votes
1
answer
157
views
How should I implement System Design patterns in general and when to use these patterns in every aspect?
I have been learning a lot of new things lately, DevOps, Cloud Computing, Monitoring, and Security. I have been facing my problems dead on, but System Design seems to be a bit complicated. I have ...
0
votes
2
answers
151
views
Is integration-testing all services the best approach?
I am building an API project, where I have a controller called C1, which calls service S1. Within this service, there are multiple method invocations to services S2and S3 and S4, as well as a call to ...
10
votes
6
answers
2k
views
Is there a name for the hierarchy of "trustworthiness" many engineers use while debugging?
I'm looking for a name or attempts to document a particular thought patten used by most experienced engineers when they debug.
Most experienced engineers develop a sense of hierarchy for what is ...
5
votes
5
answers
617
views
Is it good practice to check exception messages in unit tests? [duplicate]
Imagine I have a function like this (written in Java):
void sayHello(String firstName, String lastName) {
if (firstName == null) {
throw new IllegalArgumentException("first name is ...
3
votes
1
answer
257
views
Where should I store the access token in React?
I'm building a web app using Spring Boot (backend) and React (frontend).
My authentication is based on JWT, with both access token and refresh token.
The refresh token is stored in an HTTP-only ...
1
vote
4
answers
170
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 ...
1
vote
2
answers
255
views
What is a good strategy to avoid creating duplicate profiles for many individuals in a database?
I'm designing an application that is going to receive tens to hundreds of thousands of requests. Users submit requests on behalf of Customers (which are singular persons). Each request will contain ...
3
votes
0
answers
118
views
How to implement introspection of user-defined data in my software renderer
I am in the process of writing my own software renderer. I am currently working on setting up a shader system that allows users of the renderer to create their own Vertex Shader and Fragment Shader. ...
1
vote
1
answer
135
views
Where should authentication data be stored in a modular monolith with multiple authentication strategies? (NestJS)
I’m implementing the authentication module in a modular monolith built with NestJS.
Initial Draft
In the first draft, the User entity included the hashed password, refresh token, and refresh token ...
1
vote
1
answer
340
views
Which approach to specifying a database connection in a web API, is preferred?
Where I work, they have never implemented web APIs. At my previous job, which I left 11 years ago, I would write several web APIs to be used for applications, reports, etc. So when I came to this job ...
1
vote
2
answers
170
views
Where to initialize clients in C server?
I’m writing a multiplayer server in C using sockets and pthreads.
The project is separated by responsibility:
server.c/.h → networking (socket, bind, listen, accept, thread creation)
player.c/.h → ...
1
vote
2
answers
149
views
Should I introduce a controller layer to separate networking from game/player logic in a C server project?
I’m writing a multiplayer server in C using sockets and pthreads.
The project is separated by responsibility:
server.c/.h → networking (socket, bind, listen, accept, thread creation)
player.c/.h → ...
1
vote
2
answers
89
views
Finding a subset of vertices in graph
I have a graph: undirected, unweighted, no leaves, no disconnected edges or vertices.
The graph is populated with vertices of 3 types: A, B, C.
Let's say, I hold a vertex of type A, denoted as A0.
I ...
1
vote
1
answer
117
views
How should I design a password reset flow when the PasswordService depends on UserRepository (email vs ID)?
I’m working on a three layers architecture backend (Laravel).
Here’s the context:
I have a PasswordService responsible for updating a user’s
password.
and a Otpservice responsible for verifying/...
6
votes
2
answers
1k
views
How dangerous is storing sensitive information in LocalStorage?
Since I started studying security in web applications, it seems that everyone always says to never store sensitive information (e.g., refresh tokens, access tokens, and so on) due to the risk of ...
3
votes
3
answers
1k
views
Is a SPA still a SPA if SSR is used?
I’m developing a system with separate front-end and back-end components:
The back-end is already implemented with Node.js and Express, exposing REST APIs.
The front-end must be a private SPA, ...
-1
votes
0
answers
23
views
Does rate limit on crawler hurt SEO? [migrated]
In our website, we see many crawlers which pretends like human trying get contents. These crawlers are not well known like Google/Bing/Facebook etc. I can identify those crawler's IP and they are ...
-1
votes
2
answers
226
views
Does it make sense to use next.js only for the front-end?
We need to do the front-end with spa. The question is whether to use a full-stack framework like next.js, but only the front-end part, without server-side components. If I don't use them, could these ...
2
votes
2
answers
151
views
How to namespace global function overrides?
In PHP, trim() exists.
By default the second parameter is " \n\r\t\v\x00"
I wish to introduce my own version which doesn't deviate far from the core functionality:
// Trim whitespace in ...
14
votes
5
answers
3k
views
How do I find what's causing a task to be slow, when CPU, memory, disk and network are not used at 100%?
I'm currently analyzing a process that is considered too slow.
In summary, it's a task that loads a lot of data from Microsoft SQL Server, performs some basic stuff on it, and creates a report. It ...
0
votes
2
answers
112
views
Should I instantiate controllers in route modules or use static methods?
I’m building a modular REST API using Node.js + Express + TypeScript.
My controllers are defined as classes. In my route files, I currently create a new controller instance, like this:
import { Router ...
1
vote
3
answers
382
views
Why is short polling considered an antipattern for event-sourced systems?
I have an application with very strict requirements around auditing and the "replayability" of user actions. For this reason, I've chosen an event-sourced architecture because of its append-...
1
vote
1
answer
227
views
How should domain models be designed — rich domain models with encapsulated logic vs. anemic models with separate service/util layers?
I'm learning Domain-Driven Design (DDD) and studying different architecture patterns, and I’ve come across two seemingly conflicting design philosophies around domain modeling.
1. Rich Domain Model ...
0
votes
2
answers
190
views
How to reduce the number of class instances passed to the __init__() method of a Python class?
I have a Python class called FunctionsManager; its __init__() method is the following:
class FunctionsManager:
def __init__(self, instance_class1, instance_class2, ..., instance_classN):
...
0
votes
1
answer
87
views
Automated Testing classes with an injected DbContext [duplicate]
I've been working on an implementation of a service, and have found that there are a number of operations where I need to read from a database to provide a caller with certain data or objects.
In-line ...
7
votes
3
answers
552
views
What SOLID principles does the Java List interface challenge?
The Java List<E> interface includes methods, such as add(E) and remove(Object), that work as the names suggest on instances of mutable concrete implementations, such as ArrayList<E> and ...
1
vote
1
answer
82
views
Patterns for background apps using system tray and dialogs
I've had reasons to design an application that should 1) run in the background to show status and notifications, with 2) dialogs showing details and configuring the app through more powerful widgets. ...
7
votes
3
answers
389
views
How to test the parts of an application that cannot run in a test harness
I'm working on a program that runs as a sort of plugin to the Windows UAC prompt (and other similarly difficult environments). The testing situation is a bit abysmal. End-to-end tests are not possible,...
3
votes
4
answers
418
views
Does possession of a valid JWT automatically imply the user is authenticated?
I am tasked with implementing authentication and authorization in a distributed environment, so I plan to use JWT.
I get how authorization works with JWT - if the token is not expired, and the ...
1
vote
2
answers
254
views
How does a PostgreSQL cursor actually work? What are their tradeoffs?
I'm in charge of developing an application that sometimes needs to process massive amounts of data from a Greenplum (a PostgreSQL-derived) database. The process involves a Java 8 program running on a ...
1
vote
2
answers
61
views
Do data stores in a Level 1 DFD have to match the tables in the ERD exactly?
We're developing an anomaly detection web app as a Capstone Project, and we're currently revising our manuscript.
In our last capstone defense, one of our panelists mentioned that the data stores in ...
2
votes
1
answer
261
views
Is it okay to mix OOP and modular approaches when building a backend with TypeScript/JavaScript?
I’m designing a backend in TypeScript (could also apply to JavaScript), and I’m wondering about the architectural approach.
Is it better to stick to a single paradigm (e.g., fully object-oriented or ...
2
votes
3
answers
191
views
API Design: Should I explicitly check for and throw on nullptr parameters if I have full control?
Say I have the following header
#ifndef WINDOW_HPP
#define WINDOW_HPP
// includes...
namespace window
{
struct Window
{
GLFWwindow *handle = nullptr;
};
struct ...
0
votes
2
answers
204
views
Is exposing full backend entities to a Vue frontend a bad practice? A case for DTOs?
I am doing the frontend for a Java Spring backend. The project uses JavaFX for the front but I a migrating it for web usage (with VueJS). When I make an API call to retrieve an object, I am receiving ...
0
votes
2
answers
93
views
How can I efficiently handle click events and sequentially related operations (like user–URL deactivation) in a scalable URL shortener?
I am learning backend development by building a simple URL shortener project. My goal is to learn backend concepts and try to do things in simple but better ways, keeping scalability and reliability ...
2
votes
1
answer
206
views
Software Requirement Specification document "Purpose section"
When we write the "Purpose" section of a SRS document, do we write:
The document purpose?
or
The Software to-be-built purpose?
I have checked some examples and it seems the first one but ...
1
vote
1
answer
132
views
Should pagination metadata like totalCount be included in the ETag for cached paginated API responses?
I am currently rethinking my API response schema and caching strategy while implementing ETag-based caching for a paginated REST API (for example, listing places).
Each paginated response looks like ...
-3
votes
1
answer
185
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
3
answers
259
views
Single or multiple use cases for alternative actions in the same flow?
I’m modeling a use case diagram for an online marketplace system.
In one of my use cases, the seller can perform three different actions:
Accept an offer → closes the negotiation,
Reject an offer → ...
5
votes
3
answers
653
views
How much `auto` is too much when creating utility functions in C++?
How much auto is too much when creating utility functions in C++?
Here's an example. I have a Qt application where, at some point, I need to find what is the maximum value among the integers that are ...