Questions tagged [design]

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

Filter by
Sorted by
Tagged with
3
votes
3answers
228 views

Is my understanding of SOLID principles correct regarding my concrete implementation?

I read everything and its opposite about how to organize its code. Of course, I try to follow the SOLID principles, but since I consider myself quite a beginner, I would need some outside advice on ...
-2
votes
1answer
66 views

Handling Legacy Database with Spring Boot Java

We are given a task to create an Web Service API for a mobile application. The problem is we have to use a legacy database that is not normalized and its very tedious to work with. We are accustomed ...
0
votes
0answers
61 views

Is gRPC a good choice for my scenario?

Im starting to develop a visually-simple but infrastructural-ly robust real time multiplayer game to show off my backend skills and hopefully get a job at Blizzard or something like that. The game is ...
0
votes
0answers
24 views

Offline app with syncing features with React Native

I am currently building an ordering application where users can send orders for available items. It must have the functionality to work offline as well. After user is online, the user has the sync ...
-1
votes
1answer
107 views

Doing work when passing constructor arguments

This is very closely linked to the question Legitimate "real work" in a constructor? but not quite the same. I am interested in having feedback on whether this is acceptable or has any risks....
0
votes
3answers
61 views

“Assign” Role Association between two classes

If there is Class A and Class B and there is an association that B can be assigned to A.And the multiplicity is 1:M or M:1 from A to B.Example: 1.Room has Collection of Keys, and Key can can assigned ...
0
votes
1answer
78 views

How to design a social media follower/followed relation with UML?

I am working on a UML diagram for social media website like Facebook: The main class of this system is User, which has members as userid, email, phone, address, Friends, etc. A user may follow a set ...
-1
votes
1answer
56 views

Best way to create a modal setup

I'm making an online food ordering platform similar to something like Uber Eats. I have the menu items stored in the database which are then sent to the front end where I use a templating language to ...
0
votes
1answer
60 views

How to determine ideal chunk size for file writing?

I have a class that is responsible for writing formatted binary objects to a file on a network drive with a 100Mbps bandwidth. Each time an object is created (via lets call it w.addObj()) it formats ...
1
vote
0answers
52 views

How to efficiently map unknown vector fields

I've got a problem I've been wrestling with, and I'm really truly stuck: I have a bounded, continuous vector field and my goal is to map it using discrete measurements at specific points. I can only ...
2
votes
1answer
82 views

Are there any C++ command pattern implementations which make it easy to add additional functions and their parameters

For my situation I have a device receiving string commands such as turn_on, pump, etc. Some of these commands also have arguments attached to them such as an int. I have methods like this void turn_on(...
2
votes
3answers
164 views

Enums or Multiple Inherited Classes

I am reading about OOD and came across Parking lot design problem.Parking lot has parking floors which has parking spots.The parking spot class looks as follow: public enum ParkingSpotType { ...
0
votes
3answers
142 views

Use the type returned by a function as information

Over time I become used to use the type of the returned value of a function as a piece of additional information. For example: A function that is supposed to return or an array if the arguments are ...
-1
votes
3answers
99 views

Difference between update a property and fire an event

It seems to me that update a property is always an 'event' and that all you can do with an event handler can be done in the property let/set routine. And, in my limited experience, I never needed to ...
2
votes
0answers
35 views

Designing a filtering function

This question is not so much about how to implement a solution as I've already implemented a working solution, but more about how to improve how I implemented it. The implementation process of the ...
-1
votes
4answers
160 views

System Design: Efficient way to import hundreds of different CSV formats

OVERVIEW We have multiple data providers who provide us information from a large set of data sources. These end data sources provide data in CSV format. Since, the CSV formats are not consistent ...
-2
votes
5answers
275 views

Why does today's companies follow old RFC's?

Let me start by saying that of course conventions are important, there should be a rule of thumb for some cases that is representing the best action to follow by, in order to prevent mistakes and make ...
1
vote
0answers
50 views

Notification System Design for Multi User Application

I have a requirement to design a notification system for multi-user(~1000 users) application, here are the high level requirements. System event gets triggered on specific operations. On event ...
-4
votes
3answers
135 views

Methods that receive buffer objects AND return another Object - is that bad design?

The Argument Some say that if you write a method that receives a buffer, iT MUST RETURN VOID -> the buffer is your exit point. Do not abuse the methods by receiving buffers AND returning a another ...
0
votes
1answer
49 views

Pubsub model - publisher broadcast to remote subscribers

With a single publisher(go-routine) and multiple subscribers(go-routine) on same machine, below message hub help create pubsub model: type PublisherHub struct { subscribers map[*subscribmediator....
0
votes
1answer
100 views

How does a database update trigger a notification to application layer?

Application component 1(ap1) record/insert/update a new state in graph database(neo4j) For every new state change in the database, application component 2(ap2) needs to be informed/notified that a new ...
-1
votes
1answer
72 views

How should I document a higher-order Python function?

I'm interested in designing a high level function in Python, (I.E. a function that takes other functions as arguments) but I don't know of any good conventions for documenting such a function. For ...
1
vote
1answer
55 views

Multiple sources of truth - Optimistic concurrency & Eventual consistency

I have a couple of web applications that write to their own databases. They also share a few entities, for example, the customer entity. My business case is such that the same field for the same ...
1
vote
1answer
144 views

When should an argument be set to None in Python?

The focus of my question is on design. If I have an argument that can be None and it is passed between several functions until finally being used, which function should treat it as a default argument? ...
1
vote
1answer
67 views

Multi threading a database driven service

First some background on the problem, we have a windows service (C Sharp) that receives new messages and processes them.It is database driven so it checks a table for unprocessed records, processes ...
4
votes
1answer
203 views

Temporary features - Good practices

I work in a company where we do administrative tasks for other companies. With covid-19, there are many temporary laws to take into account. My company did as it did before : simply creating the new ...
-4
votes
1answer
54 views

Best way to create a formula for meter readings

I have to design a way to create, store, and use formulas to read values from meters (electricity, water, etc). Example: Take 20% of meter 1, add to that 30% of meter 2 and subtract 100% of meter 3. I ...
1
vote
1answer
111 views

Benefits of Dynamic Mocks over Static Mocks?

I'm not sure if static vs. dynamic mock is the terminology used to describe this comparison, but I got this terminology from types of mocking static vs dynamic and Hand-rolled mocks made easy. To ...
1
vote
1answer
69 views

How to manage huge chunks of validation data inside a REST API

TL;DR What are common practices to separate validation logic inside a rest API & thereby keep the code clean and straight forward? (code example) Context & Example Let's say I'm developing a ...
1
vote
1answer
132 views

How to exchange rectangular arrays via HTTP efficiently and without tightly coupling requesters to responders?

Suppose a user defines input arrays on a JavaScript frontend. These are sent to a Python backend via the REST API. The backend computes a result for every combination of each array's elements. It ...
3
votes
4answers
200 views

When to have ID of instance as an instance field vs. decoupled?

Let's say I have a class called ValueSpec with these immutable instance fields: min_value: int max_value: int description: string Each instance of ValueSpec is uniquely named. This unique name is ...
3
votes
1answer
136 views

What do you call the interface design error that consists in splitting two public methods that should be called toghether?

Consider a poorly-designed interface in which there are two functions (say foo() and bar()) that can be called independently, but in order to get some expected behavior (or in order to keep the object ...
2
votes
1answer
120 views

How to model Business Objects depending on use cases?

I'm having trouble modeling the Business Objects of my application. In my domain I have substantially a list of bills of orders, and for every bill I have the pallet that contains the materials to ...
4
votes
3answers
348 views

What are the pros and cons of using a reference/pointer vs an ID

I'm writing in C++, but this problem applies to any language without GC and even to languages with a GC as well. I have a structure in memory in which I create/add objects. The structure takes ...
1
vote
0answers
44 views

Stuck on approach on how to serve a lot of data to users with a lot of possible combinations

So, I'm making an application which monitors specific things that happen within the area of a user. And I'm really stuck at the approach on how to serve specific real-time data to my users. I am using ...
0
votes
1answer
24 views

Including processes that are external to the system in Use Case diagram and DFD

I am designing a system with several diagram for a project. I am trying to summarize my question with 2 simple diagram which can demonstrate my doubt. Below are my use case diagram and a context ...
2
votes
2answers
135 views

API architecture design for fast reads of text file with 150m unique labels

Assume a text file with 150m unique records. Each record has two columns: (1) string and (2) integer. The string is a unique label, and the integer is the label's value. The only query will return the ...
1
vote
1answer
81 views

REST : Static API design

Lets say, I have a scenario where I have to expose an api to fetch supported shirt sizes(small , medium and large) My initial thought was /v1/shirts/sizes - But this clashes with the existing fetch ...
0
votes
2answers
389 views

Why don't URL shortening services just use an always incrementing number as the short URL?

It seems like the URLs are always Base encoded yielding a short string instead. Wouldn't it be easier from a design perspective to just use a number instead? Sure your urls could be "browsed"...
-2
votes
2answers
95 views

How can one choose between consistency and availability if the system you are designing is Tiny URL

I am putting together a system design for something similar to Tiny URL. It provides an API for mapping a URL to a short URL. Once created the short URL can be used to access the original URL. This ...
1
vote
2answers
124 views

URL shortening : data partitioning

I've been looking in many places about this question - most top Google search results are copy-pasted from a single source, and others are not particularly helpful. Not sure if I am allowed to include ...
3
votes
1answer
60 views

Is the class stereotype implicit in an UML class diagram ? Should it be specified?

Commonly I see class diagrams where there is no <<class>> stereotype. Others where there is the common <<interface>> and others with some interesting ones as <<shape>&...
0
votes
1answer
47 views

Structure and placement of a exporting module

Its an infrastructure monitoring application. We have a spring boot (2.x) based Service Oriented Architecture (SOA) with multiple modules in our project and the center point is a REST services module ...
1
vote
0answers
52 views

Issues Regarding Data Model Abstraction in Golang

I am currently writing a quiz web-app with a React front-end and a Golang backend, with a PostgreSQL database to keep track of the quizzes, the questions on the quizzes, and the choices in the ...
46
votes
6answers
8k views

Why is 2FA usually done after the correct password has been provided?

If all accounts have 2FA for a given product, is there any reason why the 2FA box couldn't be on the primary login screen? Is it bad practice to request 2FA code along with username and password on ...
2
votes
4answers
242 views

Altering the state of a composed class by its composing classes. Is there any rule or principle for not doing so?

In other words, is it good to define the method that removes an element in a collection inside the class representing the element, considering a composition relationship? Something like: listElement....
1
vote
2answers
83 views

Trying to figure out the optimal selection based on a set of rules

Background: We have software that displays different products to the user Problem: With a given set of rules, determine which is the primary product we should show the user. These are images. We are ...
-4
votes
1answer
156 views

Do these two design philosophy conflict with each other?

With few years of C programming, I noticed there are two major types of design choices for data organization. I offer an analogy below. First: height folder: Andy.txt, Bruce.txt, Chris.txt and Tina....
0
votes
2answers
119 views

Should I declare motivation when commenting? [duplicate]

When commenting code, which of the two approaches considered good practice? Explain the content of the code, "translate" it to human - readable language, but not provide any explanation ...
1
vote
1answer
65 views

Rust/specs – what is the good/idiomatic way of design level walls/static objects handling in an ECS architechture

Warning: long question ahead, don't be afraid, I just tried to be as precise as possible about details for who wants them but many paragraphs are skipables if you already understood what I want ;). ...

1
2
3 4 5
91