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
39 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 ...
user avatar
4 votes
5 answers
394 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 ...
user avatar
  • 57
-3 votes
0 answers
37 views

Simple elevator algorithm that also accepts incoming requests [duplicate]

I need to implement a simple system that models the functioning of a single elevator. Now, I am aware of the SCAN algorithm (also called "elevator algorithm") and how it works, but I ...
user avatar
0 votes
0 answers
9 views

Elegant way to go about navigating between components in React

I'm busy creating a navigation flow on the startup page in a SPA, and I'm experimenting with different methods of going about navigating between components. Here's an image to give you an idea of the ...
user avatar
1 vote
2 answers
55 views

Modules Design and Communication Between Them

I'm trying to design a monolithic application following DDD and clean code. Lets say I have Users, User Types, Products, Product Types and Purchases. I want to implement using different modules. At ...
user avatar
  • 31
0 votes
2 answers
75 views

Publish-subscribe inside a single application

I've been using the publish-subscribe pattern for a while for communicating devices and it works really well, making it easy to add extra services without touching the rest. I'm thinking of using it ...
user avatar
0 votes
1 answer
84 views

Should mocks used in unit tests represent entireties or subsets?

I was working on a unit test that has a mock object looking something like: public class TestMock { static { Doodad a = new Doodad(0); Doodad b = new Doodad(1); Doodad c = ...
user avatar
  • 999
3 votes
3 answers
136 views

Simplifying TryGet methods to execute logic

Sorry my title is terrible i couldn't think of a concise title to use. I have a bit of code that needs to consume two quantities from two objects, this is done using a TryGet() type of method and the ...
user avatar
  • 2,000
1 vote
2 answers
79 views

Java OOP Philosophy/Design: Mutable classes

I do know that the best practice these days is to model immutable classes in Java. An ex: below // It makes sense to model this in an immmutable fashion class 2DPoint { private int x; private int ...
user avatar
  • 119
0 votes
0 answers
34 views

Design efficient real-time data subscription to reduce service workload

I am designing a service for a hobby app in JavaScript and looking for feedback on best way to design the service. TickerService Accepts an array of stock tickers. eg: ['AAPL', 'AMZN', ...] ...
user avatar
  • 1
4 votes
1 answer
194 views

Does my View Model violate the Single Responsibility Principle? Or am I just used to toy examples from tutorials?

I am a very beginner writing one of my first webapps. I'm using FastAPI and I'm stuck on the logic of creating an endpoint that has to do a lot of things before it returns something back to the user. ...
user avatar
  • 149
2 votes
0 answers
65 views

Is the difference between "changesets" and "snapshots" in version control primarily a space-time tradeoff?

There are many version control systems out there, and they tend to use one of the following models to store separate versions of a repository: Snapshots - each version of your repository is stored in ...
user avatar
  • 328
0 votes
1 answer
44 views

REST API designing resources for complex entities

I have an ASP.Net Core Web API where I am having difficulties designing the REST resources based on the EF Entities I have. There are three entities that describe a Reservation. First, there is the ...
user avatar
0 votes
2 answers
93 views

When using composition when to favour wrapper methods?

When using composition, when should we favour wrapper methods? Let's say we have the classic car example. public class Car { private Battery battery; //wrapper method public void load(...
user avatar
  • 29
0 votes
2 answers
79 views

Store static data in public folder as json file or directly in .js file?

I'm busy working on a website – somewhat new to this – and I don't quite know where I should store static data: in the public folder as a separate json file, or within the .js file as an object. In ...
user avatar
0 votes
1 answer
67 views

Design of A Multithreaded Simulator

When designing my simulator, I have gotten stuck on 2 main design choices. The simulator can be described as having X number of nodes (between 50 - 2000) that each need to independently do some ...
user avatar
-2 votes
0 answers
38 views

Improve code design of legacy code [duplicate]

I'm working on a legacy project in java(struts 1 framework) and I want improve code design of it. Basically is a struts framework(jsp, form and actionControllers) on tip, linked to controller has a ...
user avatar
0 votes
1 answer
91 views

Validation in a simple DDD example

I'm doing a simple project that represents a CI Pipeline in a low scale. So I'm trying to model "the best way possible" to practice DDD. Basically I have the following information: ...
user avatar
0 votes
0 answers
42 views

Handling recurring events

I have a application built with nodejs. It's hosted on AWS and uses postgres as the database. The application allows for users to create bookings. When a booking is created, an email is sent to the ...
user avatar
  • 101
0 votes
1 answer
64 views

Updating data when fetching

Is it possible to fetch data and update it if a time constraint has been met? Originally, my implementation was a cron job that regularly updated the data in my PostgreSQL table every minute on the ...
user avatar
  • 103
1 vote
3 answers
171 views

Class design: should I split responsibilities or should the class take care of itself?

I have a Curve class that has some CurveData inside as private member as well as getter functions for topics of interest (e.g. peaks, width and so). So the math logic of a curve is inside this class. ...
user avatar
3 votes
2 answers
308 views

Is it logically possible to consistently name commits in a VCS using an ordered sequence?

Imagine you're creating a completely new version control system, like Git, Mercurial, SVN etc. from scratch. Rather than identifying commits by SHA hashes, you identify them using an ordered sequence ...
user avatar
  • 328
1 vote
1 answer
153 views

Polymorphism: Overriding properties versus overwriting attributes

In polymorphism, your base class defines an interface. The inheriting classes fill in the data for that interface. The key is that the interface remains the same. Given that, if your interface is ...
user avatar
0 votes
0 answers
22 views

How to implement an approval queue for created/updated/deleted records?

Say I have 5 different types of records which can be created, updated, and deleted. Each time one of these actions are performed, an item is added to a global queue which people need to look through ...
user avatar
  • 2,412
0 votes
0 answers
78 views

Which design to follow to override a flag from a jar in the application using it?

At my workplace, there are lot of Java/Spring/Spring-Boot based applications which have a common jar added as maven dependency. This common jar is always used as a SNAPSHOT dependency and I am not ...
user avatar
  • 119
-1 votes
2 answers
69 views

Designing class for fixed-size data structure backed by ArrayList

Say we want to write a Java class that represents a fixed-size list. Let's call it Chunk.java (as in, it represents a chunk of data to be processed or sent somewhere). My implementation of this class ...
user avatar
-1 votes
2 answers
242 views

Is it bad practice to have too many direct subclasses?

Let's say we have an undo/redo system and we have a superclass storing an object that should later form a tree of the attributes that can be undone/redone. This would require every class that should ...
user avatar
  • 29
0 votes
0 answers
68 views

How do we logically divide a Chatbot app meant to support both Slack & Microsoft Teams

We are building bot application that suppose to support both Slack & Teams. Both Slack & Team has a single Web hook endpoint which makes the app code tightly coupled with them and hard to make ...
user avatar
  • 109
0 votes
0 answers
15 views

React function that opens and closes form in which user selects some data?

I am developing sales invoice form in ReactJS as SPA application, which communicates with API/DB (Laravel). I have the following use case: user clicks on one button (e.g. Select Person, Select Good); ...
user avatar
  • 1,009
0 votes
2 answers
71 views

Having a front end grid component fetches its metadata from the backend, is this a "bad" strong coupling?

The idea is that for each resource we want to dispaly in a grid, there will be one endpoint for data and another for metadata. The metadata endpoint will bascially return a list of columns and their ...
user avatar
-1 votes
2 answers
76 views

More efficient FIFO inventory calculation?

I am implementing a basic ledger system for which I want to calculate costs based on the FIFO system. Is there a more clever method than an O(n) search? Example Suppose I have two lists of ...
user avatar
0 votes
1 answer
115 views

Design for hardware UIs

What is a suitable software design approach for handling user input from hardware buttons, where the function of each button depends on state? I'm designing a musical instrument which has a lot of ...
user avatar
  • 167
-1 votes
2 answers
85 views

Multi-threaded design for continuous messages analysis

Since I don't have much knowledge of multi-threaded design and English is not my native language, I don't know how to exactly describe my problem. Let's say I have a mini-program in school, which has ...
user avatar
-3 votes
1 answer
43 views

Best Practices for Designing Around Presence/Absence of Home Button on Tablets?

Older iPads used to have a home button: Newer iPads don't have it. They have a line on the screen you're supposed to swipe up to get to the home screen: Now if an app has a row of links or buttons ...
user avatar
  • 97
2 votes
4 answers
170 views

Database design - how to model database tables for similar objects - booleans / enums / inheritance / archived vs active

I only recently started to work with backends. My database is supposed to store information about maven-like artifacts. There are going to be applications and configuration artifacts. Now those ...
user avatar
  • 129
0 votes
2 answers
172 views

Are microservices unfit for our domain logic

I work in a software company with a single product, a 25 year old monolith application (1.2m lines of code) handling all HR related data (employments, salary, collective agreements etc.). I've been ...
user avatar
0 votes
3 answers
117 views

REST API design: how to represent users joining and leaving groups?

I'm designing a REST API in which users create groups that other users join and leave. A user creates a group by making a request like this: POST /groups Request body: { "name": "...
user avatar
  • 13
0 votes
0 answers
22 views

SOAP client app design approach - many endpoints with similar contracts

I have a question regarding the code design for a client application that will connect to external SOAP services. Basically, I need to write a client application in .NET that will connect to external ...
user avatar
  • 109
-2 votes
1 answer
141 views

Is it possible to predict last 3 digits of a closing stock price? [closed]

So, i just start learning in AI field and i want to develop my skill more. So, i just curious is it possible to predict last 3 digits of a closing stock price? which mean the output result will run ...
user avatar
0 votes
1 answer
54 views

How to design a table component that stores data and also includes HTML code

I am developing a front end application given a back end with some API. The application has two similar views. Both views make use of a big table that's also used as a form . For example, in the ...
user avatar
0 votes
2 answers
117 views

Microservices - create post for logged in user

I am working on a small project with microservices architecture in Spring Boot. As to not make unnecessary calls to users-microservice, I have duplicated some necessary User data (id, name, summary, ...
user avatar
  • 1
0 votes
0 answers
35 views

Design a Program which Forwards Work Pieces to Corresponding Modules

I am working on a program that will listen to a queue of incoming message and will process each message differently depending on the metadata of that message. The messages must be processed in order ...
user avatar
  • 1
1 vote
0 answers
173 views

Best way to store key-value pairs of different types in c++?

I'm reading values from a (PE) binary file. The values have a known length and position in the file and are stored with no padding (right next to each other). They store various types (int, long, ...
user avatar
  • 111
0 votes
0 answers
113 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
0 votes
0 answers
44 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
155 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
206 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
1 vote
1 answer
201 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
1 vote
0 answers
186 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
2 answers
81 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
2 3 4 5
99