Questions tagged [design]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
82 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
129 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, ...
1
vote
1answer
55 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
1answer
34 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
365 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
75 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
45 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 ...
2
votes
1answer
141 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
124 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
52 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
42 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
184 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
29 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
178 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
25 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
69 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
45 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
67 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
65 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
68 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 ...
-1
votes
1answer
142 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
707 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
62 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
121 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
88 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 ...
1
vote
4answers
177 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
80 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
94 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
321 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
124 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
116 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
112 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
737 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
193 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
195 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
152 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
202 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 ...
0
votes
2answers
52 views

Scala Option apply method when passed a None

Not sure if this is an appropriate question for here, please let me know! In Scala, the ever so useful Option class has an apply method in its companion object that allows us to quickly wrap any ...
0
votes
1answer
30 views

When designing a system how could I describe the way sequence diagrams are related?

After the sequence diagram are made the sequence methods become code, before writing some code that would alter database records I would like to know how to detect if a sequence is doing the job ...
2
votes
1answer
168 views

Should gravity sources pull objects or objects pull themselves to gravity?

I'm doing a project in unity where I turn off the general gravity and implement it myself. What I'm trying to acheive is to have GameObjects be affected by several gravity sources on every tick. I got ...
2
votes
3answers
289 views

Is this design with globals bad?

I designed a Snakes and Ladders game. I divided into a reasonable amount of classes and I believe I did a good job regarding the OOP design. I have one question about a decision I made for the design,...
1
vote
1answer
100 views

Architecture/Design for Hardware Control Software

I'm currently working on the control software for a system that includes a lot of user controllable hardware and also has many configurations. Configurations in this context refers to a specific ...
0
votes
3answers
104 views

What to do when a class' method depends on another class' method to pass an array with a certain key?

To cut a long story short, assume I have a Register, a Provider and a Generator class. In my Register, I have the addItem method that allows me to add items to a collection. The Provider's job is to ...
1
vote
2answers
68 views

Template Method pattern. Problems extending signature due to a new object type

I have a conceptual question about SW design. I prepared the following example: One abstract base class: internal abstract class BaseFamilyObject { // //... // internal abstract ...
2
votes
3answers
98 views

Is it preferable to “compose” monadic functions or “chain” them?

To the best of my understanding Monads were created to allow for composing functions with those that had potential side-effects - loosely speaking. For me composition implies code like so: f(g(h(x)))...
0
votes
0answers
38 views

Querying the domain model

Background: I am working on a document classifier which needs to classify document based on some keywords. The list of keywords and the category is provided as the configuration parameter. The ...
0
votes
0answers
34 views

How to store metadata (e.g. table name) for a model class?

What is the proper way to get a metadata of the type in languages that doesn't allow static methods/functions to be overridden? For example, I'm using Dart: abstract class Model { // Constructor ...