All Questions

Filter by
Sorted by
Tagged with
2 votes
2 answers
123 views

Should you pass an instance of service to a model class?

Say we have these view model classes. You can imagine there's an entry in the UI for each subtype of InfoItem, and each item contains some text and an icon. abstract class InfoItem(text: String, icon: ...
  • 249
3 votes
1 answer
290 views

Why should I map external IDs to internal IDs in my API?

We have a public API. Users will call this API by passing in different Guids as the IDs for entities. In the API, the Guid will be translated to the internal ID (Int32) for that particular record in ...
-1 votes
1 answer
71 views

development environment for C++ GUI applications

I am currently developing some C++ GUI application using wxWidgets (although the GUI framework doesn't really matter here) and thus far have been developing this on my own, which was working well. ...
  • 129
2 votes
3 answers
149 views

how to leverage overloading while keeping business logic out of models

I am running into a conflict between two best practice principles- overloading should be used instead of long chained if/else statements models should not contain business logic I am working on a ...
  • 139
2 votes
3 answers
177 views

User's comment field on a row in relational databases

Suppose that we have a SQL relational database for, let's say, asset management system. It uses a table of assets (1 row per one real-world object). There can be various metadata etc. To allow the ...
  • 191
0 votes
2 answers
229 views

Is MVC a sensible design choice for a CLI application?

I am working on a CLI chess game that only involves 2 human players, I decided to make it follow the MVC architecture to ensure separation of concern and to make the possibility of a GUI/web ...
  • 51
0 votes
2 answers
212 views

DDD, Isn't `User` the aggregate root most of the time?

In ddd there is the concept of aggregate root. The Aggregate Root is the parent Entity to all other Entities and Value Objects within the Aggregate. It seems to me that User should be the root ...
  • 277
0 votes
1 answer
179 views

How to optimize average rating calculation in a review system?

I'm thinking of a designing a review system (restaurant, hotel etc) where users can drop star reviews. Typically in a such a application, you can see the average rating of an entity along with all ...
3 votes
6 answers
370 views

Waiting until end of project to remove commented out code, remove unused code, and resolve compiler warnings

A co-worker of mine is working on project solo but would still like to have other team members review their code upon reaching certain milestones. Unfortunately, they also want to wait until the end ...
0 votes
3 answers
98 views

Using orm events or database triggers

In orms, we can easily perform our desired operations in the save() method (for example, when a record is added in the likes table, the count column in the post table will increase.) This is great, ...
0 votes
1 answer
144 views

Mocking / stubbing C# record types in a unit test

I have a series of record types in my C# project that I use with JSON.Net to deserialize json data. public record RadarrMetadata( IReadOnlyCollection<string> CustomFormats ); public record ...
  • 4,873
0 votes
3 answers
354 views

Why isn't a counter used to avoid nested for loops for index based operations?

Let's assume we have a method that we want to run as fast as possible and it needs to loop on a 2D array, naturally we would do a nested for loop as such: int[][] arr = new int[3][3]; for(int ...
  • 51
13 votes
2 answers
482 views

Does the Primitive Obsession code smell apply to Python?

Does "primitive obsession" as a poor design practice apply to development in Python? I have seen a lot of examples and discussion in the context of statically typed languages (like Java, C#),...
-1 votes
1 answer
99 views

Chat app database architecture [closed]

I understand that chat apps are a fairly well understood and architected thing. I’m looking for some best practices advice on structuring the backend, particularly as it relates to user inboxes. One ...
  • 227
1 vote
2 answers
184 views

Is it bad code design to use an out of scope static variable?

I have a function that uses a static variable to count how many times it got called: void func () { static int counter=0; counter++; /* some code */ } The code in the function executes ...
  • 121
7 votes
5 answers
398 views

Is global state really always bad?

I have a question regarding my general understanding of global state in software engineering. When I write an app I like to decompose it into little, manageable components and functions, that are ...
0 votes
1 answer
96 views

Should a class be an attribute for another class if all I need is the data from it?

Title sucks, I know, but I'm having trouble describing my question. Say I have a class Three_Eyed_Robot that sees the world in RGB through three eyes. Lets call them Red_Eye, Green_Eye, Blue_Eye, each ...
0 votes
0 answers
37 views

Pattern For A Load Behavior That Can Act On Any Class

I have a class called ContentLoader. This class has one method LoadContent<T>(T model, int?loadLogicDecider1, int? loadLogicDecider2, etc). It runs through the input class looking for a ...
2 votes
2 answers
133 views

Using the word "loop" as a subject in a sentence [closed]

I would like to explain the following code to my colleagues: for options in [{Option.NO_CUTOFFS}, {}, {Option.HEURISTIC}]: ... The following sentence is kind of awkward: This loop loops on the ...
-1 votes
1 answer
82 views

Identity Bounded Context for a small eCommerce System

I have to develop an eCommerce website following DDD. I just completed Ardalis and Julie DDD pluralsight course and need to come up with bounded-context for this project. Can you please assist if I ...
-1 votes
2 answers
62 views

Handling In-App Credits better approach

I met 2 different approaches to handling in-app credits. If the problem is defined as: Allow a customer to purchase credits, which they're allowed to spend on different in-system items. The credits ...
1 vote
1 answer
52 views

Aggregating embedded documents in MongoDB

I'm designing a mongo database and I have a dilemma if I should go for normalization. Let's say that there is a database with images and descriptions. Many alternative descriptions can belong to one ...
0 votes
0 answers
63 views

How to model these entities in DDD?

Domain: Barbershop Could someone help me to understand how to represent these related entities using the Aggregate pattern? I have this hierarchy (in my mind) ServiceGroup (Expected to contain ~50 ...
-1 votes
2 answers
110 views

Appropriate design pattern for coupled Objects

I code an Object-Oriented simulation where you can have a Unit move on a Terrain. The cost of such move depends both on both Unit capabilities and Terrain features: a boat can move on water, a plane ...
  • 131
2 votes
1 answer
106 views

How to add some data to an Enum in Python

I have a class that I use to define different types of plots I am performing class MyPlots(Enum): STANDARDSCALE = "standard" LOGSCALE = "log" there are default values ...
33 votes
7 answers
9k views

Does Garbage Collection Scan The Entire Memory?

I was reading a bit about garbage collectors and I am wondering if the garbage collector of a program scans the entire heap memory or what is allocated to it? If it reads the entire system memory, ...
  • 465
0 votes
3 answers
180 views

How to handle subclasses needing different method signatures for the overriden function?

I have an abstract class that represents chess pieces, it has an abstract method isMoveValid(Square futurePosition, PieceColor color) which checks if the piece moving to that square is valid or not, ...
  • 51
1 vote
1 answer
58 views

DDD - Modelling a system of groups and users

I'm looking for some advice on a system I'm designing, at its core it will allow users to create/join/manage groups of users. I thought it would be a good idea to try and apply some DDD principles, ...
0 votes
0 answers
56 views

What is the best way to desgin my api workflow?

I am building a bank management system using the microservices architecture. I have many microservices but I am going to talk about two. I have customer account service and transaction service. Let's ...
0 votes
0 answers
31 views

How to decide between different implementations for the same functionality in python

Say I want to implement a mathematical tool or simulator for mechanical joints. There are different types of joints (revolute, prismatic, etc). Which have different properties (degrees of freedom, ...
0 votes
0 answers
96 views

Designing a follow relationship in a Instagram-like application using DDD

I'm developing a Instagram-like app using DDD and CQRS (along with nestjs and neo4j). I have a users module which handles user profile and it is responsible for incrementing the number of followers, ...
4 votes
5 answers
605 views

How to prevent in house frameworks and libraries from becoming technical debt

My company develops many relatively small projects that a lot of times do the same things and have a similar structure. (e.g. read/write to a databse, data pre processing, building a query etc.). This ...
  • 57
1 vote
1 answer
116 views

How to scale transactional outbox pattern with document database?

I'm trying to understand CQRS, DDD by writing a small pet project which is somewhat similar to this great repo. I've come across Transactional Outbox pattern and as imo it was correctly pointed out in ...
  • 31
1 vote
0 answers
35 views

Storing SQL for table creation

I am currently working on a small web-app stored in a monorepo and using PSQL as database (hosted on GCP). It's my first time working for a web app and I have to create a lot of tables manually such ...
2 votes
3 answers
236 views

Object Oriented Programming - what is the best way to add new parameters?

I have a doubt about what would be the right OOP approach for implementing classes that do similar stuff with different parameters. To provide a simple example, I would use two polynomial classes, ...
-2 votes
1 answer
284 views

@Getter, @Setter vs @Data in lombok? [closed]

So I was sending code for review and approvals for some changes I made recently. that includes a class as below: import lombok.Getter; import lombok.Setter; @Getter @Setter public class ...
0 votes
1 answer
54 views

JPA/Hibernate/Spring - What if M side of @OneToMany is not relevant for business logic?

I am writing a Spring Boot REST API using JPA, so I have my application layers consisting of controllers services repositories entities models for request, response, DTOs This question is mainly ...
  • 119
0 votes
0 answers
28 views

Windows 10 IoT - Embedded Subvision System Deployment

I developed a supervision system for machines that use an industrial PC with Windows 10 IoT. To protect and limit the use of the OS, I use UWF and Kiosk mode (Shell mode), but the configuration is ...
  • 101
-1 votes
4 answers
145 views

How can I ensure same code formatting across IDE?

We are a small team contributing to our startup project, on a daily basis the code changes and multiple PR are raised daily. The general issue we face while reviewing these PRs is the code formatting ...
18 votes
5 answers
3k views

What Semantic Version increment to use for a filename change?

I have a program that runs on command-line, let's call it myprogram 1.0.1. It's published on GitHub. Now I discovered that name already exist for a well-know software, so I want to change the name ...
  • 309
2 votes
3 answers
175 views

Static types and dependencies in trunk-based development

There're certain things in code that can't be conditional. Two very common examples: static types dependencies. You can't naturally enable/disable a feature that implies a new dependency or a new ...
2 votes
1 answer
129 views

The notion of configurable strategies

I'm designing an algorithm that matches entries based on some notion of "proximity" (for the sake of discussion, assume we're matching floats). Furthermore: The input is a scalar and a ...
  • 233
0 votes
2 answers
137 views

Writing tests for API that results depends on table with millions of rows

I think my problem is very common but I couldn't phrase it correctly in the title. I have a Django API that returns some information about companies (like address, partners, situation, etc) given its ...
0 votes
0 answers
25 views

react native responsive styling for web and desktop

React Native doesn't provide a way to create responsive styling like in css with media queries. This is quite a huge problem when sharing react native code with react native web (and react native for ...
  • 119
0 votes
1 answer
148 views

Doubt about DDD, entity core and backing field

I was reading the documentation about how to use Entity Core in a DDD way. This is the documentation. It is said that I can configure EF to can map an internal private field to a private field, the ...
-1 votes
2 answers
119 views

REST API vs upserts and "updeletes"

I am building an API that (I am deliberately simplifying the schema below to only focus on what is questionable): I have a table that roughly looks like this: CREATE TABLE IF NOT EXISTS some_table ( ...
0 votes
0 answers
39 views

Separating Typeorm Entities from Domain Entities [duplicate]

Is it a bad approach to add domain logic inside typeorm entities if following the domain model pattern to organize business logic. import { Entity, PrimaryGeneratedColumn, Column } from "typeorm&...
  • 57
2 votes
0 answers
71 views

How to define the data model in an event-based infrastructure

After my team went all-out on the microservice paradigm with an emphasis on message passing, I'm having trouble defining and keeping track of all the events in the system. I've read some guides on the ...
  • 29
0 votes
0 answers
35 views

Is the combination of Image Classification and numerical data useful and possible with ML.Net?

Up front, this is my first ever question on StackExchange. So please be gentle with me. It is also my first time working with Machine Learning and ML.Net which means that I'm lacking fundamental ...
4 votes
3 answers
1k views

Error or not error?

I need to implement the following scenarios at the server: User sent too many answers in a given amount of time, for example, it can't submit more than 3 posts within an hour. User sent answer with ...
  • 258

15 30 50 per page
1
3 4
5
6 7
1232