Questions tagged [design]
Questions about problem solving and planning for a solution through software design.
5,046
questions
0
votes
0
answers
3
views
How would you add a Puppeteer web scraping process to a standard CRUD REST API?
I'm trying to figure out how to design a REST API for this use case. I understand how to implement a "traditional" portion of a CRUD REST API, however, I'm not sure how to add a Puppeteer ...
2
votes
2
answers
113
views
Efficient way to Decouple classes in class design
I am working on a class design question - design a simple grocery store with a self-checkout system
I am a beginner, and have 2 parts to the question -
Part 1
After briefly jotting down requirements, ...
-2
votes
1
answer
59
views
Proper use of microservices within the system
I have an application in which a client interacts with a backend, which interacts with blockchain. Since blockchain executions can be time-consuming, they are executed asynchronously within different ...
-1
votes
1
answer
71
views
Fast methods to consolidate 20 csv files into one xml file [closed]
We have 2 systems Legacy & New and I have to migrate the data from the legacy system to the new system.
The legacy system exports the data in .csv format while the new system accepts the data in ...
1
vote
0
answers
72
views
Limiting exposed interface for state transitions
Scenario: Given a class with some internal state and methods to manipulate this state, I want to limit the exposed methods that are available to potential clients/users of my API.
TLDR: In the ...
0
votes
1
answer
67
views
Logical architecture based on modules and SPI
I'm looking for the most proper way to design a modular application with ServiceLoader.
--MAIN IDEA--
module app.view | exports app.view.View interface that defines UI api
module app.engine | exports ...
1
vote
1
answer
75
views
Composite repositories: minimizing dependency injections
I have an application with dependency injection that consumes a REST API. The API calls are abstracted into entity-specific repositories. Some of the repositories are: HttpNotebookRepository, ...
0
votes
2
answers
54
views
Where to check preconditions in multi functions
In a library, there could exist three types of functions. The first are those which are visible to the user i.e. their declarations are installed in the library's include directory. The third are ...
-1
votes
1
answer
39
views
How to handle dependencies between objects/components
Im currently working on a college project on the simulation of magnetic interactions of particles, see physical simulation: design thoughts.
Right now im starting to code my system according to this ...
2
votes
2
answers
191
views
What make a microservice a microservice?
I am new to microservice.
While learning about them, I was wondering what is the basic rules (the minimum) that make a microservice a microservice.
I have found some rules/characteristics along the ...
-1
votes
0
answers
47
views
Model variations depending on requirements - naming and placement
Let's say there is an Item model. Depending on requirements in a given ViewModel (WPF with MVVM) I will need different things.
For example in some cases I would need model to have 3 properties: Number,...
2
votes
2
answers
104
views
Pattern for a base class to do pre-validation and/or post-processing on a deriving class's overridden method?
I have the following pattern repeating itself in multiple places:
abstract class Database {
void connect() {
this.setStatus( CONNECTING )
try {
await this.realConnect()
}
catch ...
23
votes
6
answers
6k
views
How important is it to clearly understand requirements and architecture before starting to code? [closed]
Whenever possible I have been requiring an understanding of the requirements and architecture for the next scope of work before starting to code.
Sometimes due to schedule pressure on larger projects ...
0
votes
1
answer
100
views
Are there any guidelines for calculating hardware requirements in a containerized environment?
At an architectural section of an interview I was asked to produce hardware requirements for a certain system I designed. It was a microservice-based system which runs in Kubernetes, Openshift or any ...
3
votes
2
answers
1k
views
Is this approach to website design adequate or am I making a mistake?
I'm not conversant with this topic, and therefore I watched a tutorial about a one-page dynamic PHP website (quite educational in my opinion) in which the creator designed the following pages.
For ...
1
vote
3
answers
170
views
Is in my case role based access better than permissions?
Hello StackExchange community, I'm in a bit of an impasse for my current project.
The software in question is a collaborative program designed to let employees work together on the platform and assign ...
0
votes
0
answers
52
views
Refactoring: where should master data reside?
I inherited a backend project and want to refactor the management of master data. The master data consists of a couple of database tables that contain fields like year, rebate_in_percent or category.
...
0
votes
0
answers
62
views
REST API design - Categorised response objects - All, Sub, Dub movies paged response
I am having trouble deciding what is the best way to implement a REST API which does the following:
When page gets loaded, it displays a list of Movies and above is a category selector tab (ALL, SUB, ...
0
votes
0
answers
41
views
Dispatching different events in consistent order to event handlers in c++
The requirement is illustrated as follows:
P-Thread1 -> Q1<EventType1> ==================== | <=
P-Thread2 -> Q2<EventType2> ==================== | <= Poller Thread
...
0
votes
1
answer
159
views
Is it secured to accept and execute user provided CURL commands
Assume you have to figure out a dynamic way where the user can provide an API call to hit in the backend
for example, user to provide a webhook to call on his end server
So, An idea for users to ...
0
votes
1
answer
80
views
How to refactor parallel inheritance tree?
I have a (php) program, which must change yearly. This program calculates tax for every year and there are sometime changes in requirements.
First, the user fills their incomes, expenses, etc.
Then ...
-1
votes
3
answers
139
views
Is it better to override methods in classes or make methods general?
I am creating the backend of a microservice that will serve as a tool to see in real time how the company's employees are distributed by projects and what days they have assigned to each one. The ...
-1
votes
1
answer
34
views
What is the convention for deciding which resource to place an endpoint under? [closed]
I have an endpoint that teachers can use to invite students to a virtual classroom by providing their emails in a list format. Let's call it POST invite-students. I have these four resources:
api/v1/...
0
votes
1
answer
78
views
Trie data for searches in time ranges
I am developing an API responsible for returning the distinct searches made on a service given a date prefix.
Example data:
2015-08-01 00:00:18 %22http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%...
0
votes
1
answer
145
views
Many if conditions
I have the code but I want to be pseudo as possible so I learn from other ways as much as possible.
So what I am building is web based tool and in one section we have a table.
This table renders lines ...
-1
votes
1
answer
139
views
Better way to represent grammar symbols in C
I'm trying to build a simple compiler for a subset of the C language in C. To achieve this, I needed to figure out a way to represent the grammar symbols. Basically, each symbol can either be a "...
-1
votes
3
answers
276
views
Is it ok to save all fields of an entity as a string if it should not be changed?
I have a complex object that has several fields can be updated until it is locked.
Is it proper to save this locked entity as another entity which has no object child, only string data.
complex object
...
0
votes
1
answer
55
views
How to design a fifo coupon distribution system
I have an app written in java and using mysql as DB. I need to create a coupon distributed system where I have 100 coupons stored in DB and the first 100 customers who login should get those coupons. ...
0
votes
1
answer
74
views
Do we need to test an integration of units if each unit has been tested against collaborator (mocks) and interface contracts?
Given:
Let's say I have 3 objects A, B, C that form a cluster. Each unit (A,B,C) is independently tested with mocked collaborators. The "integration" is the call to A that calls out to B and ...
2
votes
2
answers
111
views
Design dilemma with relation between entities and 'global'
I have the following dilemma with designing a piece of software.
How can I design a relation between the follwing entities so that a configuration rule can be global or apply to a building / room or ...
2
votes
2
answers
100
views
Designing Products with multiple variations
I have a Product entity:
public class Product
{
public int Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
[ForeignKey("Brand"...
1
vote
2
answers
73
views
Rest API: paths versus queryparams for user accounts
I'm looking for some guidance around REST design for user account endpoints. I generally understand REST and some of the principles involved, with paths being used to fetch items from a resource:
/...
0
votes
2
answers
114
views
Mapping class diagrams to source code
I'm attending a software engineering class at my university, and my final consists of a fully-documented desktop application to be built in a four people team.
While designing and coding this software,...
2
votes
1
answer
75
views
UML Class Diagram Excersise
Problem statement:
The information system of a university must manage information relating to its employees, departments,
institutes, courses provided, and research projects.
Information relating to ...
-1
votes
1
answer
76
views
CRUD for hierarchical data in ASP.NET - single view/controller vs. separate view/controllers?
I'm trying to develop a CRUD feature for an ASP.NET app that lets me manage customer information. Each customer can be subscribed to one or more services, and each service can have one or more terms.
...
0
votes
1
answer
55
views
Separating model and applicative user in app
I am working on a mobile application, and I want to plan a separation between the model layer that represents a user (that comes from the server) and the "applicative" user that has the same ...
7
votes
9
answers
2k
views
Changing number of arguments of a function
I wanted to know the best practice(s) for ensuring scalability while passing arguments.
Say, in version 1.0 of an application, the foo function looks like this
void foo(int i)
Now, in version 1.1, ...
2
votes
1
answer
175
views
UML Diagram double arrow
In a Microsoft Learn article on MVVM there is an, what I assume, UML diagram that didn't make sense to me. (https://learn.microsoft.com/en-us/archive/msdn-magazine/2009/february/patterns-wpf-apps-with-...
1
vote
1
answer
66
views
Design a model for a user
There has been a change in the project I am working on.
Until today, there was only one type of user in the system.
From the moment you logged in, you had all the information about the user.
The new ...
2
votes
2
answers
89
views
Sharing a data class in a flow
Suppose there is a flow of functions in C++
step1();
step2();
step3();
step4();
step5();
and they interact by adding and modifying data on a data class D (only data, no functions). For example, step1(...
0
votes
0
answers
49
views
How to improve the Mediator algorithm when new widgets are added?
i want improve mediator algorithm when the new widgets are added.How do I make changes in this form?
plas help me
and the code:
2
votes
1
answer
163
views
How much logic can the infrastructure level hold in Clean Architecture
I am trying to wrap my head around the concepts of Clean Architecture, and specifically about the responsibility of the Infrastructure layer. Its purpose is often described as "to provide ...
3
votes
1
answer
82
views
Should we process data in the transmitter class or in the receiver class?
I have a transmitter class which contains raw data which represents physical values (double and int). These values should be taken by a receiver class to display them with logs (string) sorted ...
0
votes
1
answer
96
views
Cron job to read multiple "entities" from the database
I have one microservice (in GO) that needs to read a whole table every hour, filter out some data and send it to another application.
So as an example, imagine I have the following model:
type User ...
1
vote
2
answers
92
views
How do I guarantee ordered processing of occurring events in concurrent environment?
I have a Kafka topic providing events of the following type: id(hash):[ADD|REMOVE].
These events may be generated at a high rate and are idempotent, i.e. getting 123:ADD one time and ten times in a ...
1
vote
0
answers
35
views
Rendering large list with search functionality
I have a SQL Table which has ~50k rows and I want to display the rows on a webapp. I think that rendering all the rows at one go is probably a bad idea considering the size. I am thinking about ...
1
vote
1
answer
146
views
Is this a good use of events?
At my company we are revising some backend architecture. I think I have identified a use case where event streaming (for example with Apache Kafka or RabbitMQ) makes sense.
Because me (and everyone ...
2
votes
2
answers
315
views
Is it good design to have a repository update multiple entities?
I'm building a web application using Laravel. I use the repository pattern as my data layer.
Imagine there's some entity like Product and a product can be assigned to a ProductCategory.
The Product ...
2
votes
2
answers
122
views
physical simulation: design thoughts
I'm an applied physics student and currently working on a simulation of the magnetic interactions of multiple protons within a protein.
Me having only little experience with programming and almost ...
0
votes
1
answer
75
views
In DDD, must a Value Object turn into an Entity when some limited idenifiablity is required?
I have an Entity type, let's say Car for example. There is a Value Object type Tire for it. Each car has a set of tires with certain properties. Sometimes tires are replaced, which is communicated by ...