Questions tagged [design]

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

0
votes
0answers
3 views

How can independent game-modules block system-wide behaviour

We've stumbled at an inconvenient design in a game and wondering, whether there is nothing simpler. The background needs some explaining so I'm sorry for the wall of text. The setting We have a ...
-2
votes
0answers
19 views

How to cache multiple version of site [on hold]

I have a site with feed of user notes, and i want to show to users only top 100 notes (paginated by 10 per page). Every note has some tags (like subreddits on reddit), and every user can add some tags ...
0
votes
0answers
13 views

Updating an entity and many relationships: database vs application layer

We are working on a transformation project It has records in table entityA and entityB, which has a relation entityAB. We need to delete records in table entityA and recreate them with some other ...
0
votes
3answers
78 views

Domain Models with complex properties construction

According to this article: Using Ids in Domain Models is not a good practice. We should reference the entire domain model instead. In this case, when we want to provide only Getters for our ...
-1
votes
0answers
17 views

How to automatize report emails generated on front? [on hold]

I have an angular application connected to a backend php API. Im currently generating PPTX report in angular app because we need to generate a nicely designed HTML and CSS report, but new client need ...
0
votes
0answers
108 views

Design Review: Randomly generated primary keys in database [on hold]

Problem: In my web application entities have unique IDs, and for some type of entities(e.g. user, order etc.), the IDs are visible to users via URLs. MySQL is used for storing the entities. Using ...
0
votes
1answer
47 views

What sort of data limit would make sense for pulling down all data vs autocomplete/pagination via ajax?

Imagine a page with an autocomplete textbox on it, to get Customer. I am wondering what sort of limit for record size makes sense in this day and age regarding whether all the customers should be ...
1
vote
3answers
63 views

Handling errors in looper/event loop interface

I have a C++ class that spawns a thread that contains an event loop of sorts and the class provides an API to query the list of events that have occurred since the last call, i.e something like std::...
0
votes
1answer
111 views

Where would you handle exceptions: controller, service, repository?

I have been having this dilemma from time to time whenever I have to design or start a new project from scratch. I particularly like how Spring framework is organised in terms of classic software ...
0
votes
2answers
65 views

Incorporate a background job enqueue endpoint in a REST API

To exchange data between our standalone frontend application and the backend API, we currently have a REST API, with standard endpoint to list/create/update/destroy ressources with a consistent naming ...
1
vote
3answers
91 views

Service Oriented Architecture (SOA): One Database or Multiple Databases?

In Service Oriented Architecture (SOA), should there be One Single Database "with the share as much as possible philosophy" or Multiple Databases by Service/functional area? I know in Microservices, ...
0
votes
1answer
31 views

What is a good strategy for managing PubSub subscriptions

I am working with Reddis but this could apply to any PubSub implementation. Essentially we are trying to implement an event system using Reddis's PubSub capabilities. As an example UserA creates a ...
0
votes
2answers
54 views

Application Structure and how to structure Business rules

I am building a cli application in php that keeps track of when people within an organisation should get a birthday present. The application takes an input text file containing a list of names and ...
0
votes
1answer
27 views

Venue Reservation System Logic Approach/Clarification

I hope this is the right place to ask since this is a programming related question. I’m developing a venue reservation app (similar to booking.com) and am almost done however I have 1 request for ...
3
votes
2answers
320 views

Should one make the database calls in the constructor or method of a class?

Take the following instance for example: CreditCardApplication class public class CreditCardApplication { public int Id { get; set; } public string FirstName { get; set; } ...
0
votes
1answer
52 views

How to design a system that can operate and replay its functions call stack?

I am writing a processor for the Citation Style Language (CSL) in JavaScript. Before I explain what my problem is, I must give some context first: CSL is an XML specification for describing how to ...
0
votes
1answer
43 views

How to associate tree nodes with other objects before they have unique identifiers

I've been thinking about a simple software design problem. Imagine I am writing a web application to edit a tree of objects. Each node of this tree has an ID property that is filled in when the node ...
1
vote
1answer
115 views

Contract based programming with verifications

I have a large project that is build contract based, where all functions verify input parameters and return values. But there are also cases where they for example verify that a call to a function is ...
0
votes
1answer
102 views

Walking a graph without recursion

I'm working on a class that receives a relational EDM/data model (e.g. a SQL DB or OData API manifest) and performs a couple tasks on them (not necessarily at the same time, could be two separate runs)...
2
votes
0answers
49 views

How to approach large amounts of data to be stored and mapped?

I am developing an iOS application that plots a large number of locations on a map, I have selected a data structure that is suitable for the pins on the map, though I am stuck on an approach for the ...
0
votes
2answers
35 views

Force State changing of an Object only from Holder

Suppose I have a Button class with a color attribute. I also have a Canvas class which stores all Buttons. Every time a color is being changed, some side action must take place (in this example, for ...
1
vote
3answers
172 views

What motivates the design of the root Object type in Java and C#?

In Java and C#, all classes derive from the root class Object (java.lang.Object and System.Object respectively). In both languages/libraries this class comes with a set of methods that are inherited ...
1
vote
1answer
26 views

Most readable way of generic views placement

What are your suggestions on placing many generic views? Let's consider a classic situation where I have many generic views for CRUD for given models. What is the best way to place them in views.py? ...
0
votes
4answers
159 views

Class diagram for electric guitar and bass

Hi I was recently asked this in an interview to represent a 6 string guitar and a 4 string bass in class structure. I am still new to software design and analysis so was not able to complete the ...
0
votes
1answer
24 views

Landing API Requests

I think this question is simple, but I'm not often designing APIs and so I haven't confronted it: How far should we go to adhere to the single responsibility principle? Let's say we are implementing ...
0
votes
1answer
67 views

What is better: Concrete class with Enums or subclasses implementing an Interface?

Suppose for example, there could be multiple types of vehicles. And in this scenario, only the speed and how many people can seat in the vehicle matters. Would it be better to have a concrete class, ...
0
votes
1answer
44 views

What is the function of the special directory(named debian) to the project design?

I am reading a github project: you see there is a directory(debian) in there, what the function of it? I have browsed the directory, there seems have some configuration files: shadowsocks/debian/...
0
votes
2answers
66 views

Develop based on my current requirements only? [duplicate]

I've a service called Claims-Service which has following signature: IClaimsService { EnsureClaim(claimType, userId) } It queries database to see if the claim is present in any of my roles or not. ...
0
votes
1answer
44 views

Reliable data synchronisation between several systems

We have several systems that hold the same data in different databases. The requirement is to keep the data synced in as much reliable way as possible. Performance isn't a concern because we don't ...
1
vote
1answer
67 views

Architecture for independent modules writing in the same database

Let's say I have a database with a table called "invoices". Then I have a web application where users can manually create invoices against said table. I also have a desktop application that can ...
0
votes
1answer
113 views

How do decentralised systems deal with all nodes being killed

In relation to DHT's (distributed hash tables), how do decentralised systems deal with all nodes disconnecting and thus having its routing meta data invalidated? i.e with the implementation of DHT's ...
7
votes
5answers
693 views

Refactoring: Replacing a temporary variable with a query. Is this code example bad practice?

Before I ask my question, I want to note that this is not my own code; it comes from the Refactoring Guru website: I often find myself using the code on the left, and I have one primary motivation ...
-2
votes
1answer
57 views

What is the right design for UI apps backed by Cloud services like AWS

I am looking for some general architectural guidance about designing good cloud apps, primarily using AWS. For the sake of argument, lets say it's a single page app, written in JS, hitting a couple ...
-1
votes
2answers
116 views

Help designing a product model with vast amount of properties

I've been asked how to re-design a legacy system by a relative for a company that builds custom chairs. On their website you can customize your chair in about 30 permutations : chair type, material, ...
0
votes
1answer
65 views

Architecture for message processing with scheduling, at scale

I have to design the architecture of a system that processes messages in a distributed manner. If this were the only requirement, I would use a message queue like Kafka and distribute the work with ...
0
votes
4answers
122 views

Can systems have only one use case?

I'm building a news aggregation system that collects news articles from several websites, then classifies them into categories, tags them with keywords and saves them to a database. All actions are ...
0
votes
1answer
30 views

Seperation of concerns: Submitting a form to create an email, store it and send it

Context I have a workflow that has an email form. The requirements are the following: A user completes the form that contains email fields and submits it. If everything goes well then an email model ...
0
votes
1answer
93 views

Is my understanding of modern IDEs autosave feature naive? [duplicate]

Long time ago I learned that text files are not like Random access Files, i. e., adding or updating info at the beginning of a text file involves moving all the rest of the file "forward" (or ...
0
votes
4answers
301 views

Is Template design pattern a bad practice due to inheritance?

I have been using Template Design pattern in my code for implementing CRUD procedures for different resources. There are some steps which are same for many resources and some which need some addition/...
1
vote
1answer
120 views

Single Use Token without a database [closed]

Is there a way to generate a single use token for password recovery, without using a database? This is because, I have an application that doesn't have a database, and doesn't store or has access to ...
1
vote
0answers
108 views

How to store relational data belonging to different client customers?

My users will be businesses with a small number of accounts each: e.g. Business #1 with 3 users, Business #2 with 5 users, etc. I am trying to determine the best way to organise the relation (on ...
0
votes
2answers
111 views

Passing data through public members

I am working with an existing numerical model implemented in C++, and I don't have much of a background in software design. This model reads in many (~100) of structured text files, performs numerous ...
0
votes
0answers
41 views

How to compose load balancing and circuit breaking for external data source

So I have this issue. My website uses data, that is scraped from a different site - sports results. This data can update in relatively random intervals, but I do not care if my data is a bit stale - ...
4
votes
5answers
726 views

Can we completely avoid Illegal States?

Is there are way we can completely avoid illegal states rather then throwing an IllegalStateException when a method is called when it should not be? For example: public interface Process { void ...
1
vote
3answers
190 views

Is it a good idea to use data structures(classes) provided by a dependency in our system?

I am building a new system, which I will call S, that needs to get some data from another system, which I'll name D. System D provides a client and a collection of classes(POJOs) to represent the ...
1
vote
2answers
154 views

What do you call a class that can be disabled [closed]

Is there a design pattern that fits this description? A factory that creates classes that can be disabled and enabled. The users of the class don't know if the functionality is enabled or disabled--...
4
votes
1answer
189 views

Design pattern for selecting data

I have implemented algorithm BFS(Breadth First Search) using a neighbors list ADT for scanning a graph and gathering information about it and answer questions. I have function called BFS which ...
1
vote
1answer
81 views

Approach to handle network breakdowns in application dealing with database?

I have an application that writes data to database. In case of network breakdowns, the connection to database gets lost & my db queries freezes the whole application. So, in order to make it ...
2
votes
1answer
148 views

Unit conversion of data

My team is developing a web application, where we have in the requirements to display the data in multiple unit which is set by the end user. Where should we write down the unit conversion logic, on ...
1
vote
1answer
194 views

Designing a Social Network with Graph Databases

I am prototyping a social network as part of a project I am working on and want to learn the right way to do it as if it were for an industry leading company. I've decided on implementing the social ...