Questions tagged [design]
Questions about problem solving and planning for a solution through software design.
4,914
questions
-4
votes
0
answers
16
views
Is electron a good option for a web-based desktop application that runs python and c/c++? [closed]
I want to create a visual programming electron web-based standalone desktop app that can run locally and with performance, that also allows you to visually program with python or c/c++. The visual ...
0
votes
0
answers
26
views
Refactor conditional multiple AND OR operations? [duplicate]
I have a piece of code where two objects (incoming request object and a profile object) are to be checked for matching conditions.
So the first method is as below where I check whether the profile ...
-1
votes
0
answers
33
views
Should I store non-editable items lists in a database?
Relational database is mostly used for storing editable user data.
But how about storing non-editable lists of information? Possible examples are:
GUI-related: main menu items, selectbox options, ...
0
votes
2
answers
116
views
Use aggregation like LSP in C++ [closed]
While reading book named Clean Architecture: A Craftsman's Guide to Software Structure and Design, I came up to a question with LSP(Liskov Substitution Principle).
In page 95, there is a figure ...
-2
votes
0
answers
19
views
Can I have some tips on how should I start making my game function in JavaFX? [closed]
I'm making this JavaFX project that I have as homework, it's an implementation of the 'Dots and Boxes' game I have to create using JavaFX with SceneBuilder.
Since I didn't have much time learning much ...
-5
votes
0
answers
44
views
Good practices for web development at a company [closed]
just started a new job and current have been assigned to create a web site with multiple pages(specs below). In my web development experience I have just made small little websites kinda for my self ...
0
votes
1
answer
155
views
Properly "exposing" a variable from a class in Python
I have a Launcher class that manages (check if they're alive and if not respawns them, also starts, etc.) Clusters which are processes launched through the multiprocessing Discord module.
To post ...
0
votes
0
answers
36
views
WPF Best way to create viewmodel from another viewmodel
Often I want to open a new window from within some view.
I see opening a window as view logic. So I don't want code in my viewmodel that creates/opens/changes windows or anything else that interacts ...
0
votes
1
answer
86
views
Plugin architecture vs Interface Segragation Principle (SOLID) [closed]
Uncle Bob's Interface Segragation Principle (ISP) tells us that many client-specific interfaces are better than one general-purpose interface. But plugin architecture in common case suppose to have ...
0
votes
2
answers
75
views
Is it a good idea to use database sequential id as a key in external key-value storage?
I use Postgres database to store user information. Some of that information is sensitive so it was decided to store that information in Vault. The user table in Postgres has id's generated by a ...
0
votes
1
answer
52
views
How can one combine two system architectures, say client-server and repository architecture?
I have a situation where I think it would be best to combine two architectures but I am not sure if this is possible or that it is a good thing to do.
By combining them I mean taking certain parts of ...
1
vote
4
answers
126
views
Is a flag for analytics a functional requirement?
Refined description
Because of great contributions, the description mutated as follows:
My application's purpose is to register customers into a system.
The requirement is: enable traceability for ...
0
votes
2
answers
87
views
How to deduplicate implementation details coupling to the host objects' actions?
I came upon a situation where multiple classes manifest duplicated logic. They all delegate to a worker object, but when interrupted they have to stop the worker.
class A {
Worker w;
public ...
-1
votes
0
answers
45
views
Separating entity persistence from logic
So, this is probably a repeated question, but I couldn't find a question which solve my questions.
At the beginning of the year, I started as a Junior Java Developer in a company that is in the market ...
5
votes
6
answers
409
views
Unsupported concurrent calls, throw exception or log a warning?
Context
Let's say I have a navigation service that allows me to navigate to a page.
The Navigate method is async because an animation (about 250ms) is involved.
public interface INavigator
{
...
-1
votes
1
answer
44
views
What is the best way of sorting a list based on the relevance from another service?
I have a product listing service, and it will give a list of products for the logged-in users, and the list is paginated, with ten products per page. I implemented this pagination using MySQL LIMIT ...
-1
votes
1
answer
91
views
Correct way to deduplicate conditional statements [closed]
I'm facing with problem that in every function (with serves as service for endpoint) I need to check what is value of query parameter (mode). I need to check it on many callables, E.g.
def create(self,...
-1
votes
2
answers
67
views
Using same validation from 2 places with a tweak in one of them
I'm calling a validation function from 2 places in my code, which perform a series of validations on the input I receive. As a result, the function outputs a list of all validations that broke.
My ...
0
votes
6
answers
249
views
How do I stop constant doubts on my code when programming? [closed]
I often find myself ovewhelmed by questions, I'll explain my self in a practical example detailing how I think about my tasks.
I'm often critized on how I approach the problems, and the general ...
2
votes
1
answer
168
views
What is the best way to compartmentalize complex logic problems?
I am working on a problem with lots of if-then-else calculations. I am trying to compartmentalize the logic to make it more maintainable and less error prone. But, as I try options, I don't see what ...
1
vote
4
answers
120
views
Dilema about having a Country, Province, City model separate Aggregate or in the same aggregate
We are porting an old monolith application and we are trying to apply the DDD concepts, we started looking for what we think are the Bounding Contexts of the application.
We have what we thought would ...
0
votes
2
answers
57
views
Design Review: Queuing tasks to add rows of data followed by task to send email
I need to send personalized emails to a filtered set of users (~100,000) on every fortnight. I am using Marketing cloud API for it. The way I am thinking of designing the system is as follows:
...
-1
votes
1
answer
70
views
Best Design for a software keeping track of status [closed]
So I basically have to write a web app for a business use case where I have single base model with which many sub-parts may or may not be associated. I'm trying to implement a system for a car ...
1
vote
1
answer
144
views
Implementing shared content in a system with several users
I am working on a system that allows users to track their musical practice.
The system allows users to create 'exercises' that store a few pieces of information like name, description and external ...
-1
votes
2
answers
49
views
How to deal with upsert PUT requests in a Spring Boot web application without crossing service and controller layers?
I've got a pretty simple web service that I need to add a PUT endpoint for that can handle upserts. This application is primarily a middleware layer to handle logging, caching and instrumentation in ...
-1
votes
1
answer
108
views
Smart pointer class choice: Simplicity vs. right tool for the job
I'm wrestling with a design choice question here.
I've got a class that needs a couple of semaphores. Semaphores are non-movable objects. Objects of this class however need to go into a vector (there'...
1
vote
2
answers
157
views
Should an entity know how to render itself or is it renderers job to figure out how to draw an Entity?
If I have a graph which consists of nodes like this:
class Graph
{
public:
...
int32_t width();
int32_t height();
const Node * getNode(int32_t height, int32_t width)...
3
votes
0
answers
82
views
Difficulty understanding how federation increases cache performance for databases?
I am studying system design for distributed systems and in this page (https://github.com/donnemartin/system-design-primer), one of the following advantages was mentioned for federation for databases ...
0
votes
2
answers
66
views
How to design relationships with constraints on subclass type?
I'm developing a full-stack Rest application following a narrative description of a working context. There is a class Job with two subclasses Job_A and Job_B. Job_A produces Report_A while Job_B ...
3
votes
2
answers
342
views
Real time chat at scale
I have been looking at different solutions for large scale chatting solutions. I feel as if I understand 90 % of it but am turning to this forum to tie the knot.
I imagine running a bunch of message ...
-4
votes
1
answer
79
views
Pass a value to a class via a constructor or a method? [closed]
I'm newbie in Java and I have question. Pass a value to a class via a constructor or a method?
public class HelloWorld{
public static void main(String []args){
TextModifyFirstVersion ...
0
votes
3
answers
87
views
Identify Enhancements early as a QA
I am having a problem currently where product managers are raising improvements as bugs. Also, they expect us testers to catch them early. Our company doesn't have any requirement document and as QA ...
0
votes
1
answer
66
views
Best way to calculate profit/loss with historical data
Problem
I need to build a profit/loss graph for a mobile app. The api from which I can get the historical price data only allows me to retrieve 1 item at a time. If the user has 500 items that would ...
1
vote
2
answers
98
views
Instance of component inside a (non-instance) component. Does it make sense?
A colleague of mine did this UML component diagram to represent both the required/provided interfaces and the internal structure of the subsystems that compose the system we're working on:
(The ...
-1
votes
1
answer
69
views
Design: Designing a Status Tracking Tool
We have a robust set of micro-services available.
For simplicity, let us call the services
S1
S2
S3
S4
S5
For simplicity, think of the flow to be this.
S1 -> performs step1 (start step)
S2 -> ...
-2
votes
1
answer
67
views
Is it okay to return an object in a list endpoint according to REST API specification?
I need to add extra data to a list endpoint. Basically it is the list I want to return and an extra data. Like below
{
"results": [...],
"extra_data": {
"field": &...
2
votes
5
answers
338
views
Do db calls in constructors lead to more DRY code?
It recently came to my attention that its best practice to avoid database calls in constructors. I feel like this means you end up repeating unnecessary code, thus the code is less DRY?
For example, ...
-1
votes
1
answer
105
views
Dealing with multiple application instances
I'm developing an application (Java & JavaFX) that writes/reads data (a file). The problem is I don't want to restrict user to run only one instance (of my app) at a time, as I really can't think ...
0
votes
2
answers
93
views
How to infer the type of a CSV file from contents or headers?
We've got a few CSV file templates with different set of headers. In each CSV template there's at least one unique header and each template is meant for a different entity in the system.
Right now, ...
5
votes
4
answers
166
views
How to provide logging to consumers of a NuGet package/library
I've been building a library (NuGet package as I'm in the C# world here) & I want to add logging so the consumer of the library can optionally provide some logger to the library. However, there ...
0
votes
1
answer
49
views
Design a non replayable endpoint for a service
I am trying something out in Springboot and stuck with a weird issue where I want to send some data from my frontend (react app) to backend (SpringBoot) and make that request non replay able by users (...
0
votes
1
answer
147
views
How can I split tightly coupled code in an OOP language?
So I've a class that is some kind of wrapper of a state machine for a multipart upload and it's database writes/reads. Everytime something is uploaded via REST basically the following happens
...
2
votes
1
answer
116
views
Data Ingest Architecture Advice
I have a requirement where we need to collect N different events and store them for analysis. I am having trouble coming up with a general architecture for this.
FINAL REQUIREMENTS
The end goal of the ...
1
vote
2
answers
262
views
Design of a modular application
I'm developing an application (Java) in a modular architecture. I have two approaches in mind and I'm not sure which one will be "better code" in case of maintenance and conventions.
I have ...
-1
votes
2
answers
111
views
Protocol Design robustness against corruption
I am currently in the design phase of a binary protocol which is intended to be agnostic of the transport layer, meaning it should work on top of for example websockets as well as serial device to ...
-2
votes
1
answer
64
views
Using search trees to expedite coding for rubik's cube solving algorithm [closed]
I'm a mechanical engineering student currently building a rubik's cube solver. I'd like to code a VSCode program (meant to interface with an arduino mega) that uses the basic CFOP method (solves cross ...
0
votes
0
answers
82
views
Best practice architecture to implement Spotify Auth for a Flutter frontend app and Node.js backend?
I am currently building an application that uses the Spotify API to work with a user's playlists. My frontend is a Flutter app, which is connected to the backend, that is built with Node.js. Currently ...
0
votes
0
answers
44
views
Best way to align multiple RESTful API's through an API gateway
We currently have a monolith public api which serves most of our api endpoints. This has introduced a bottleneck as the owning team needs to make changes to publicise anything new and other teams don'...
4
votes
3
answers
243
views
Class Constructor that Takes Two Arguments of the Same Interface - But Order Matters
I'm getting ready to release a feature to production tomorrow & feel I have misdesigned said feature. I'll try to explain my scenario clearly. I'm looking for alternative design suggestions to ...
0
votes
2
answers
138
views
Can a socket be connected to many balls in a component diagram?
I have to draw a component diagram that depicts the architecture of my system with its subsystem decomposition and its dependencies.
My system has a 3 tier architecture:
The top layer just acts as a ...