Questions tagged [design]

Questions about problem solving and planning for a solution through software design.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Validation in both controller and my service classes?

I use the Laravel framework. I've got controllers, like CustomerActivityController, and I've got a service layer with services like CustomerActivityService. Say I want to create a new customer ...
user avatar
-1 votes
0 answers
25 views

Software testing single node B-TREE [closed]

I am trying to solve this question about testing in software systems, can anybody help? Thanks.: And this is control flow graph for B-TREE: B-Tree algorithm of flow graph:
user avatar
  • 1
0 votes
0 answers
34 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 ...
user avatar
-1 votes
2 answers
112 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, ...
user avatar
0 votes
3 answers
175 views

Use aggregation like LSP in C++

I was reading about LSP (Liskov Substitution Principle) in a book called Clean Architecture: A Craftsman's Guide to Software Structure and Design. I have a question regarding how this would be ...
user avatar
-2 votes
0 answers
21 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 ...
user avatar
1 vote
1 answer
158 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 ...
user avatar
  • 121
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 ...
user avatar
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 ...
user avatar
  • 113
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 ...
user avatar
  • 145
1 vote
1 answer
56 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 ...
user avatar
1 vote
4 answers
128 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 ...
user avatar
1 vote
2 answers
88 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 ...
user avatar
  • 33
0 votes
0 answers
46 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 ...
user avatar
5 votes
6 answers
413 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 { ...
user avatar
  • 194
-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 ...
user avatar
0 votes
1 answer
92 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,...
user avatar
  • 111
-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 ...
user avatar
0 votes
6 answers
250 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 ...
user avatar
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 ...
user avatar
1 vote
4 answers
121 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 ...
user avatar
  • 33
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: ...
user avatar
  • 101
-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 ...
user avatar
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 ...
user avatar
-1 votes
2 answers
50 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 ...
user avatar
-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'...
user avatar
  • 1,029
1 vote
2 answers
158 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)...
user avatar
  • 161
3 votes
0 answers
83 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 ...
user avatar
  • 153
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 ...
user avatar
  • 109
3 votes
2 answers
348 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 ...
user avatar
  • 119
-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 ...
user avatar
  • 3
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 ...
user avatar
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 ...
user avatar
  • 101
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 ...
user avatar
  • 299
-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 -> ...
user avatar
-2 votes
1 answer
68 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": &...
user avatar
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, ...
user avatar
0 votes
1 answer
106 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 ...
user avatar
  • 35
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, ...
user avatar
5 votes
4 answers
170 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 ...
user avatar
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 (...
user avatar
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 ...
user avatar
  • 141
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 ...
user avatar
2 votes
2 answers
263 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 ...
user avatar
-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 ...
user avatar
  • 119
-2 votes
1 answer
66 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 ...
user avatar
0 votes
0 answers
84 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 ...
user avatar
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'...
user avatar
  • 1
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 ...
user avatar
0 votes
2 answers
139 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 ...
user avatar
  • 299

1
2 3 4 5
99