Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [design]

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

1
vote
3answers
152 views

Does saving a file to temp and deleting whenever a checkbox is toggled considered a wise choice?

My team and I have this Desktop client developed in JavaFX. It basically has a "Remember my password" checkbox. If the user ticks this checkbox, reboots, and reopens the app, the user should be ...
0
votes
0answers
9 views

Different Guice Module Class for each client

Say, I have a package, where I have multiple Proxy classes to connect it to different services? Which is a better design: Having one guice module class for each client implementation instantiation. ...
50
votes
9answers
11k views

Should you guard against unexpected values from external APIs?

Lets say you are coding a function that takes input from an external API MyAPI. That external API MyAPI has a contract that states it will return a string or a number. Is it recommended to guard ...
3
votes
4answers
301 views

Which value to use to represent “since forever”?

You've probably been in the same situation: there's a class of objects which have a specific date before* which they should not be considered "active." But how should you represent "active since ...
-1
votes
1answer
68 views

How to determine the application used on top of TCP?

I am currently implementing a TCP Proxy Server. The huge problem I have right now is that, based on the clients' TCP data, I am trying to determine whether the client is making an HTTP, FTP or SMTP ...
-2
votes
4answers
161 views

Static Factory Methods vs Constructors

Which one of the following way is recommended and why? Date d = Date.from(curr); Date d = new Date(curr); Can you also provide some examples behind the reasoning?
1
vote
2answers
354 views

DDD - Referencing Aggregate Root of other bouned context?

I'm building a personal project, as an introduction to DDD, I'm doing a little bit of analysis and can't get my head around it. My ERD looks as follows: To go over it, as an admin you can setup a ...
1
vote
1answer
171 views

Problem in creating a correct finite-state-machine for a given short text

I like to create a finite-state machine for the given text below. While solving this, I came accross with several problems I listed at the bottom. (This example is in terms of testing (where you later ...
-1
votes
1answer
69 views

Making the REST API to act as a playlist

Imagine the application I am building as a normal media playlist (Video / Music). On the client side, I select the files I want to play (Files are located on server), and I send its paths to the ...
1
vote
3answers
185 views

How to design deeply nested data structure?

I've been asked to design folder-like structure (in java, but I expect this solution to be language agnostic). There is one root, just like / on linux. Then, it can have almost indefinitely nested ...
-1
votes
1answer
64 views

Combine Ids to a single field

I would like to ask if there is any powerful method we can use to combine the Id's to a single field for faster search and retrieval. My case is like this, I have a table that stores ID's of ...
0
votes
1answer
83 views

Efficiently processing millions of records every minute

I am trying to improve the architecture of a system where data flows between 3 systems. Every minute, there are thousands of items generated on App 1, which are sent to Midpoint in the following way: ...
-3
votes
2answers
236 views

Database Schema for a multiplayer quiz game

I'm trying to accomplish this scenario : There are 2 types of users, let's say Admin and Worker, and there have different roles. Admin can do a CRUD of questions, and also can create a room where ...
0
votes
1answer
62 views

Should BDD/Gherkin be used only for user visible behaviour?

We're a small team of 3 senior and 1 junior developers and I've been tasked with introducing BDD within our development process. To say there's a lot of confusion about BDD is an understatement and ...
9
votes
5answers
1k views

How to implement RealNumber and ComplexNumber inheritance?

Hopefully not too academic... Let's say I need real and complex numbers in my SW library. Based on is-a (or here) relationship, real number is a complex number, where b in imaginary part of complex ...
0
votes
1answer
39 views

Custom ACL Implementation

I have been trying to figure out an ACL solution for my application which should manage API endpoint's access rights dynamically. Some said that I have an option of Spring Security ACL. I checked it ...
0
votes
0answers
65 views

Is this violating SRP? Data object with some additional info

I have data object's let say PersonDto (fields name, surname) and OrganizationDto (field name, type). Then I have some common screen, showing such data, but screen title is something related to type ...
0
votes
2answers
84 views

Method overriding as a substitution for instanceof in Java?

In short, is instanceof a bad thing? I had a code something like Converted convert(Object o) { if (o instanceof ClassA) { convert((ClassA) o); } if (o instanceof ClassB) { ...
1
vote
0answers
19 views

Spring Boot and Mustache app separation of concerns

I am wondering how best to slice up a Java Mustache web app which has: Data layer (JPA, Repos, Entities, etc) Service layer getting data from other company web services outside the package Web/...
0
votes
1answer
93 views

Do I include system dependencies when calculating Instability?

Given the formula to calculate instability... I = (Ce / (Ca + Ce)) with Ce = outgoing dependencies, Ca = incoming dependencies, and I = Instability, ...should I include system dependencies (such as ...
2
votes
2answers
82 views

Convert template type to derived type when calling a function?

Apologies if the title is incorrect, I couldn't think of better wording. I have the following code template <class E> void ResolveEntityHit(E& entity, Projectile& projectile) { ...
0
votes
2answers
177 views

How compatible are data science notebooks with clean architecture?

Clean architecture decouples an app's core from the presentation/UI layer. The UI is just a plugin, replaceable (eg, web-based to desktop) without impacting the core. Many data science apps mix code,...
1
vote
1answer
92 views

Architecture of iterating over polymorphic types

I have a base type of Entity, and multiple implementations, Enemy, Bunker, Projectile I have separated these entities into their own containers so I can pass them to different classes to perform ...
0
votes
1answer
82 views

Which is better solution - having separate model class against each REST API or keep adding info in single object?

I have a class Person. Person { String firstName; String lastName; String Date dob; String email; String mobileNumber; String address; } To add a person, I have following REST APIs: POST /...
1
vote
5answers
499 views

Why do we need to embed an interpreter in a program?

Emacs starts up as an editor (which probably has m functions that takes ninputs) and an Elisp interpreter running in the background (which can be used to change the behavior of the program - probably ...
52
votes
13answers
6k views

How to stop wasting time designing architechture [closed]

I have recently graduated from university and started work as a programmer. I don't find it that hard to solve "technical" issues or do debugging with things that I would say have 1 solution. But ...
3
votes
3answers
131 views

Does ReSharper's warning “SuggestBaseTypeForParameter” suggest design problems?

A water user can submit an Application for a water right with the hope of getting a Permit to use water, which might later become a BonaFideWaterRight. The right holder may apply to Transfer any of ...
1
vote
0answers
56 views

How can I have many application components partly share the same model?

I am trying to do the architecture of a new application we are building. We wanted something quite modular. Considering we are open source and we want other people to be able to easily add new ...
1
vote
2answers
121 views

Passing a period as datetimes vs as integer

When specifying a period is there ever a case where passing the number of the month as integer is preferred over passing two datetimes? For example GetTotalSumByMonth(int month) vs GetTotalSum(...
-2
votes
1answer
141 views

How to estimate the number of machines for system design interview questions [closed]

I was once asked a system design question during an interview. I don't remember the details, but it was a fairly typical web app, so I described what I thought was a pretty common architecture (users ...
2
votes
2answers
39 views

Create a new class with minimal data VS. using original class and setting non-necessary data equal to 0 or null?

I am using Scala for my example but I believe this probably could apply anywhere. Say I am using a class somewhere in my project that reads in data from a live stream of events which monitors where a ...
0
votes
1answer
112 views

Is there a way to use and ignore blocks of code, caused by events during runtime?

I'm working in C++14 and trying to figure out a way to put two classes (with the same name) inside the same header file. In this scenario one class would always be ignored as a result of something ...
2
votes
6answers
185 views

Does it make sense to draw business processes when designing a software solution

We are working with the design of the software. It is piece already working developed from scratch again. My managers are telling me to draw the business processes. I doubt in this due the fact that ...
0
votes
1answer
53 views

Java Design for Data enrichment based on logic defined in a database

I have the following requirement. Read data from a messaging Queue and process each message to enrich the message and then finally send the enriched message to a different system. The enrichment ...
0
votes
1answer
42 views

Distributing C# Dlls to Customers on Application Install

I am currently working on a software library that will be used to develop Class Libraries. These class libraries can be run by our application running on the user's machine The application uses the ...
2
votes
1answer
99 views

Using the call stack as a stack data structure

Sometimes, I use the call stack as a data structure. I use local variables as elements on the stack and use the data member of a class to store the top element. When I use this pattern, I feel like I'...
0
votes
1answer
69 views

What is the best unit of measurement for drawing with user scripts?

I want to make an android app that allows you to write scripts to draw stuff. Like text, buttons, images... using opengl. Now, if i have a function that draws an image like this: drawImage( ...
2
votes
1answer
91 views

Achievement System CRUD data structure

I'm developing this Achievement System and it must have a CRUD, that admins access to create new achievements and it's rules. I need some help with the Achievement CRUD data structure. Rules sample ...
0
votes
2answers
80 views

Problem in modelling this because too slow calculation (robot football)

I like to build a component connector view / UML diagram for the given problem but I realized it's way too slow if you try to do it exactly as it's given in the following text. My question is what ...
3
votes
2answers
113 views

Passing a list of base class objects to a method and using instanceof to filter them

I'm working on a Java reverse engineering project, where I am analyzing bytecode and trying to identify classes, methods and fields using the ASM framework. After identifying these I transform some ...
23
votes
8answers
4k views

On a once a day user action: 24 Hours Reset vs. Midnight Reset [closed]

When a user is able to perform an action only once a day, for example getting a free ticket for a competition, there are two possibilities I came across in my experience. 1) 24 Hours Reset If he ...
1
vote
3answers
73 views

Class methods that are never called and everything handled by the internals of the class itself

I have a class in my code and I'm not sure if the design I've implemented is correct or if there is a better way to do it. The class I have created have important useful methods that is used by each ...
0
votes
2answers
71 views

Instantiate a class with two parents

Suppose I have TypeA and TypeB classes, which are totally different, but both hold an list of TypeC objects. Class TypeA { List<TypeC> cs; } Class TypeB { List<TypeC> cs; } Throuth all ...
1
vote
0answers
22 views

Multiple apk's on Play Store for multiple feature testing

We have different teams working on multiple features. The feature release dates for each team are simultaneous. I want to create a mechanism so that each team is able to push an APK to the Play Store ...
1
vote
2answers
58 views

Building a plugins-based code in Python

I have a program which perform different actions depending on the plugins that are passed. For example, python main.py -m foo -m bar will perform the actions of foo and bar. The structure of the ...
1
vote
1answer
68 views

Functionality design: Multiple sources, multiple consumers with configuration

It is a Design Problem which I am listing out here. I have multiple event sources in my app, each one produces events with the different set of data (but each source is producing only one type of ...
0
votes
1answer
38 views

Processing data in a cluster with multiple tasks

The goal is to provide a scaleable system implementing multiple data processing tasks which can be seen as a graph. Data objects will travel that graph. Most object will visit the same nodes in the ...
-3
votes
1answer
126 views

When designing a web application with Vue.js and ASP.NET Core, is ASP.NET solely for the API?

When creating a web application from scratch with ASP.NET MVC Core (using Visual Studio 2017) and using Vue.js, is the MVC Core part of the application solely for the API? What other function would ...
2
votes
3answers
80 views

Is a setter with the composed object as a parameter better or separate setters for each parameter within the composed object?

I have two ideas on how to proceed with an availability class but I'm not sure which one is better. public class TimeRange { private Timestamp startTime; private Timestamp endTime; public TimeRange()...
3
votes
2answers
86 views

How thoroughly should you document business flows for a product or system you are learning?

I work on applications that have user documentation but it is not organized or updated to the current release. Is it worth my time to create my own documentation with screenshots and notes on all the ...