Questions tagged [design]

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

Filter by
Sorted by
Tagged with
-2
votes
0answers
32 views

checking is ellipse is filled or not problem [closed]

following code below works fine but feels kind of a mess. any one has a better way to do this I am creating a basic "Enter Pin" to unclick screen on a app. So if user enter 1st digit, than ...
2
votes
1answer
35 views

Handling deployment of a stateful service?

For fun, I'm developing a multi-player card game. I plan to run it on a single cheap VPS, so deployment would have to kill the process and re-start it with the new code. There is no Load Balancer. I'm ...
-2
votes
0answers
30 views

Best back-end architecture for a card game? [closed]

For learning, am looking to make a simple card card back-end server. Want to support the following: Runs on a single box (like $20/month Linode). No need to worry about LBs. At most 10,000 concurrent ...
1
vote
1answer
41 views

Intuitive RESTful API design for logistics shipments availability, accept, allocation decision?

I am trying to model APIs for Create shipments Fetch Available shipments (based on region preferences) Accept shipments (allows logged in user to accept multiple shipments on first come first serve ...
1
vote
2answers
97 views

Designing UI module for an application

I have an UI module that will expose only one class - UserInterface. The class will be responsible for collecting user input and providing output (command line UI style). From logical way of thinking, ...
-2
votes
1answer
57 views

How changing the video quality works while watching video online?

How does changing the video quality works behind the scene? Suppose I am watching a video on youtube (I will use YT as an example in this question) and suddenly my internet speed becomes slow, in that ...
-4
votes
1answer
55 views

Calculate math function depend on N value [closed]

I have method with the following prototype : R[] = method(k,n) which : n = ordinal value 0 <n <10^9 k = math function depend on n value : i.e n^6 R = array of computed values For example : n = ...
2
votes
2answers
85 views

What pattern for translation is better, naming the key by screen/context or by text?

I'm in a dilema where I'm translation a full mobile app where the translations are going to be a key value pair but I'm not sure how to name the key. Should I name the keys describing what the text is,...
-2
votes
4answers
128 views

Do logic on the backend or front end? When handling the results of a “wizard”?

We are creating a SPA, and thus the frontend is more than just a view for backend generated pages. Now to create an "entry" you normally press create, and then fill in the data for that ...
0
votes
0answers
45 views

Designing a proof mechanism

DataModel contains a Proof that contains all the information of its integrity along with the method with which the Proof should be verified. In this case I designed a JWS type of proof that can be ...
10
votes
5answers
3k views

Pros and cons of representing routes as legs or stops?

What are some pros and cons of representing routes as legs or as stops? A leg is a departure and arrival location, a departure time and a duration (or an arrival time and a duration). A stop is an ...
0
votes
1answer
78 views

Design: Tying behavior to state

I have the following (hypothetical) setup and am wondering if anyone has design suggestions, keywords, or nudges. I have a class Walk that implements a method doActivity. This method keeps track of ...
-3
votes
1answer
39 views

Serving content to authenticated users

I'm wanting to store lots of data in cloud storage - like S3. I want some data to only be accessed by authorised users, one way I could do this is to authenticate the user on my service, download the ...
0
votes
1answer
36 views

How should I handle dealing with a stream of incoming data?

I'm creating a NodeJS application that receives a ton of incoming financial data (prices) through Websockets, like anywhere from 1 to 5 data points per second which I would then like to send to the ...
0
votes
4answers
261 views
+50

How do I decouple this coupled application?

I currently have this Bot Viewer application Which consist of the application itself - the Bot overviewer, which depends on a library Bot.Core. Within Bot.core we have defined the core interface for ...
-1
votes
1answer
36 views

Designing a class implementing a method which signature types depends on the instance contained

My goal is to define a Service class which process method accepts a RequestType argument that is defined by the contained ServiceType and returns an object of a type defined by ServiceType. By doing ...
3
votes
2answers
419 views

Where to store the results of a class internal computation?

Let's say I have a class with some suitable instance variables which are then used for some computation (via a method of the class). As the computation will generate lots of data which needs to be ...
0
votes
2answers
112 views

Method that is aware of interface underlying type without reflection

I'm struggling with the design of a method CallSystemX() that needs to accept a parameter of multiple Types. To get around it I created an interface called IRequest to be able to pass different types ...
1
vote
1answer
56 views

Visitor pattern applicable ? - Applying rules to a list of registrations

I have a list of Registration's, on which I need to apply a set of rules to each individually. Rules can be a single Rule, or a sequence of rules, representable by a tree. One rule is a ...
-3
votes
2answers
77 views

What design pattern / class / interface should I use for encapsulating a program? [closed]

I am building a chess - related application, and I want to use a pre-compiled program called Stockfish as my chess engine. I am wondering what is the best practice to encapsulate the usage of the ...
-2
votes
1answer
86 views

Achieving loose coupling

My scenario involves the following classes: I have three types of Peer that creates a RegistryType instance because its methods are needed. Same for Identity class. Each PeerType need 0 or all the ...
0
votes
0answers
33 views

Mediator design with a circulator dependency

My project is web related, and the intent is that I am decoupling two pages worth of actions so that each class would have a list of actions on their page, and if any action so happens to navigate to ...
0
votes
1answer
45 views

Design for multiple clients to iterate through entire database table

I need a design for multiple clients to process an entire database table, and processing each row independently and without overlap. If there are 10,000 rows and 5 clients, each client will eventually ...
-3
votes
0answers
26 views

Design a user data export functionality [closed]

I recently came across a question of how to design a user data export functionality in our current system e.g. Export a user's info from a website, all their comments, all their photos, activity etc. ...
-3
votes
1answer
84 views

What are some of the good and bad aspects of this basic design? [closed]

I made this design for a university assignment, but I am genuinely interested of this design's good and bad aspects. The design was supposed to be an OOP design. The system is meant to be an online ...
7
votes
4answers
401 views

Why does the C++ standard still allow uninitialized primitive variables?

If reading uninitialized memory is undefined behavior anyway, why has the C++ standard not been changed so that objects of primitive type (int, unsigned, float, double, bool, char) get default-...
4
votes
3answers
162 views

CQRS: getOrCreate - is this a command, query, or both?

Consider the following scenario: If the user isn't registered in the database, register them. Return their ID. If the user is in the database, return their ID. The API endpoint for this may look ...
2
votes
2answers
117 views

Difference between facade and orchestrator in the context of microservices

Suppose we have 2 microservices - service A and B. These two services are independent for most parts and API client talks to them directly. However, their functionality overlaps or intersects in some ...
1
vote
1answer
127 views

Enforcing changing rules in a board game - how to do it?

I'm trying to code Star Trek The Dice Game. The basic concept is you roll dice, which become different types of crew (Science, Medical, Command, Engineer, etc...) and you can "spend" crew to ...
0
votes
1answer
178 views

Does it make sense to reuse microservices in a desktop application with an “offline” mode?

Lets say we have a microservice architecture consisting of: multiple frontend clients, e.g. an Android App, an iOS App, and a Javascript Web Frontend a Java Spring (HTTP Rest) microservice to access ...
0
votes
1answer
98 views

Sharing form validation rules between backend and frontend (Having single source of truth)

I'm currently working on a web app using ASP.NET Core (C#) on the backend and Next.js (TypeScript) on the frontend. I have a lot of forms that need to be validated and I don't want to write validation ...
0
votes
1answer
36 views

Syncing Business Logic Across Multiple Levels

Let's say that in a project we have a function (in PHP for example) that checks whether a particular user is eligible for a discount. Also, we have a report (written in SQL) that pulls all users that ...
1
vote
1answer
104 views

Sharing types & endpoints between frontend & backend [closed]

I'm looking for a clean solution to share types, endpoints and response format between a backend and frontend. The backend will be in Python & the frontend in Typescript. The backend is a REST API....
-1
votes
1answer
73 views

Design for Maintaining changes over time which supports arbitrary updates in different time points

I have a collection of documents, which hold a subject id, a timestamp and a value. For example: { sid: 1, t: 3, v: "A" } { sid: 1, t: 5, v: "B" } Which means subject#1 is ...
-2
votes
0answers
26 views

Designing an extendable software project template: reducing complexity

I set out to create a script for initialising software projects. GitHub templates are cool, but after using one, all names and project links must be changed. I wanted to have a few dialogs to fill in ...
-1
votes
1answer
66 views

How to run and manage multiple instances of an application (different start params) on multiple servers?

Our main (C#) application: takes in parameters and starts working (batch processing, takes anywhere from minutes to hours) up to x instances of said application per server instances are started by ...
1
vote
2answers
163 views

C Const Safety with Struct Data Pointers

In our codebase, having precise management of memory, data was being passed around like so: typedef struct { size_t const sz_size; size_t sz_len; int32_t * const restrict pData; } S_ARR_T; ...
2
votes
1answer
131 views

Do we still use modular subsystems with object-oriented models?

I have been reading some old design books (SSADM, JSD.etc) on software engineering that deal mainly with a procedural view of creating systems. I was just wondering if we still use these old ...
-3
votes
3answers
172 views

Should we allow users to write to database directly? How to do it correctly

I'm developing a new application that allows the user to do many writes. Therefore, it is very inefficient that we use our server-side to handle every write request by users. Should we allow users to ...
1
vote
1answer
122 views

What design pattern to implement notifications for a .NET application?

I have an ASP .NET web application dashboard that is used to send notifications to several .NET desktop clients. The current implementation is that the web app writes the new notification to a ...
1
vote
1answer
77 views

Loose coupling vs transparency in visitor pattern that visits composite

I have a composite object (I will call it A) that has fixed number of sons (I will call them A1 and A2) All of them have an Accept(Visitor) method. I have a GUI, A is the main window that consists of ...
0
votes
1answer
44 views

File parsing in UI Layer or Application Services Layer

Let's say that I have a list of financial transactions that I need to read in from the file. I want to make the best guess I can at what account should be credited/debited based on the transaction ...
0
votes
0answers
31 views

Doing the same tasks from multiple places when using Clean Architecture and CQS?

I'm working on some tooling that will help speed up the process of setting up a new computer for new developers. I want the user to be able to execute many tasks either as one task or grouped together ...
0
votes
3answers
72 views

Designing this module to support exchangeable drivers

We have a battery manager implementation which uses a fuel gauge driver and a charger driver. Currently both of these drivers are hard-references to the fuel gauge and charger driver we currently ...
1
vote
2answers
79 views

Using objects to construct nearly the same objects

I am getting worried I have some terrible design pattern here in JS/Node.js/MongoDB. It seems to that to create an object, I need an object that looks like that object. This includes data that comes ...
-3
votes
1answer
35 views

How are different resolution settings for videos handled by server and client based on setting and connection speed? [closed]

I was watching youtube and squinted at the text in the video and wondered what happens when I switch from 720p to 1080p. Does the streaming service, Youtube and or any other, just have the files in ...
0
votes
1answer
55 views

What approaches are there for handling elements in contiguous memory while being dependent on other user input

I am creating a vectorized reinforcement learning environment. It handles multiple instances of a board game in synchron. Up until now, the state of the environment was a specific representation of ...
1
vote
2answers
69 views

Where to put a deffiniton of an external data provider in a DDD/Onion Architecture application?

Consider that when working on an Application which is modelled using DDD and implemented using Onion Architecture, you come along a following business case: The Application, as one of its features, ...
1
vote
5answers
205 views

OOP applications and Databases

I am having such a hard time with OOP and databases. Both in C++ with SQL and even more so with Node.js and MongoDB. For this question I will use Node/Mongo. Let's say we have a user object. Over time ...
0
votes
1answer
63 views

How to use single Spring-Boot instance to cater to multiple environments?

We have a Spring-Boot Web application currently deployed to 7 environments (DEV, SIT, UAT, Pre-Prod, Prod, etc.). This application connects to other REST services, which has different URLs for each of ...

1
2 3 4 5
95