Questions tagged [design]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
152 views

Should this class be immutable?

Say I have a class that is used to monitor the size of a directory. Currently it can only monitor the size of a single directory: public class DirectoryMonitor { private final File ...
0
votes
0answers
22 views

Need suggestions for creating field level permissions which can be changed dynamically in an app

This is currently my User-Role-Permission model in the Db schema (excluded other tables to avoid confusion). My implementation goes like this: I have a Customer table and each Role has a different set ...
-1
votes
5answers
275 views

Should setters only set values?

I always like to overthink things, so here's my thought of the day: Should setters only set the values of class properties, and not perform any other logic? Suppose I have a class class User { ...
-1
votes
3answers
165 views

When should an order be created in a webshop [on hold]

Let's say I want to make a webshop, which sells custom mugs (for the sake of simplicity). In the shop, you go through 3 steps: Select cup size Select color Add a logo And then finally it is added to ...
0
votes
1answer
141 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
4answers
284 views

Are there limits for programming languages calling others?

So earlier today I found about IronPython: IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. This was my first ...
-1
votes
1answer
48 views

What is the best design for this use case regarding bidirectional relationship? [closed]

For this question let's consider a system in which the users can match with each other (let's say for simplicity exactly like the dating apps). User1 matches User2 (and the other way around) only in ...
0
votes
1answer
41 views

What's the use of event sourcing and asynchronous message queues for sending commands

In short: Out of order commands end up with out of order events, so does the ordering of the events matter in such situations? Since we are uncertain about the order of commands when an asynchronous ...
0
votes
3answers
120 views

Should the attributes of a class be part of the public interface even when they could break its methods?

As a minimal example, consider the following (in Python): class Foo: def __init__(self, bar): # Assume bar is a valid at this point self.bar = bar def divide_by_bar(self, num)...
0
votes
0answers
45 views

Need some design advice on my ORM for Immutable objects & ref passing

I'm adding Immutable objects support to my Micro ORM called "Symbiotic" In the case of a create, I need to pass back a newly created version of the value passed in because the object is immutable and ...
4
votes
1answer
96 views

Serverless Architecture - Integrating with Data Layer

My question is in context with the Serverless Architecture (e.g. AWS Lambda) and how does one interact with the Databases in this system. Typically in a 3 Tier architecture, we have a web service ...
0
votes
1answer
29 views

Update items based on a read operations on same items is a bad practice?

DynamoDB is the database solution, I'm using to store my items. It's a NoSQL/Document database and I got a real problem on real-time updates of items. First, the saved format is like { expiredTime:...
0
votes
1answer
61 views

Granularity of the Single Responsibility Principle [duplicate]

This is a related question and the OP appeared to go with extreme levels of granularity. The answers gave a good overview but I gather it's still somewhat down to personal interpretations/situations ...
118
votes
14answers
69k views

What is the ideal length of a method for you? [closed]

In object-oriented programming, there is of course no exact rule on the maximum length of a method , but I still found these two quotes somewhat contradicting each other, so I would like to hear what ...
0
votes
0answers
35 views

Logging OpenCV Mats [closed]

We'd like an abstraction for writing images (OpenCV Mats) to disk for diagnostic purposes during image processing. As we currently use the Serilog logging library (through ILogger in Microsoft....
0
votes
2answers
151 views

Rest API POST with illegal data in parameters: Bad Request or 404?

Take a hypothetical camera company providing an API to manage its users and cameras. Each user owns cameras, and every user of a camera has a role assigned (one of admin, operator, viewer - these are ...
-1
votes
0answers
13 views

How to design a generic RestClient using jersey 2.0.0 version and above? [closed]

I want to make a RestClient class using jersey API version 2.0.0 and above, that provides methods for all kinds of HTTP methods like GET/POST/PUT/DELETE and can support all functionalities like uri-...
0
votes
0answers
24 views

How to cache timestamp based key values with a distributed cache?

I have a dataset in a key value store (similar to Cassandra). The data model is - Key - ServiceName / timestamp_in_milliseconds value - operation In the write side I get some operations for a ...
1
vote
2answers
28 views

Excel Addin VBA, Backend/Frontend

I have a question regarding what is supposed to be backend and frontend for desktop applications and in this special case, an Excel Addin VBA. My application contains lot of forms and modules. I ...
0
votes
0answers
21 views

Comparison between central logic or distributed logic in microservices?

I'm designing an application in a microservices architecture. The app has its own logic but also needs to collaborate with other services. For example, the app is A, and other apps are B and C. ...
1
vote
0answers
101 views

Circular dependence and many references to the same object

I have tried to design a class diagram for my first game. But then I realized that there are some ugly parts. First, there is reference from StateSystem to State and from State to StateSystem. The ...
1
vote
0answers
24 views

How Best To Store Data Structures Around Flow

I'm working on building a simulator for HVAC units. The conceptual model I am working with is basically that an HVAC unit has inputs and outputs, and I need to be able to calculate the outputs for a ...
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 ...
-1
votes
1answer
140 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 ...
0
votes
2answers
132 views

What approaches are there to making apps homoiconic from users' perspectives; which are good, which bad, and why?

In terms of an application that's about affording its end-uses the ability to add, view, and manipulate their own data (like Podio, Trello, Redbooth, Asana, et cetera), I'm wondering how it can be ...
0
votes
3answers
102 views

How can I do a step based design form my applicaiton?

I want to create an application that has some optional steps. But I could not decide how to do step plans. It looks like a workflow. I have a Work entity. This work includes specific business steps. ...
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 ...
187
votes
16answers
98k views

Is it wrong to use a boolean parameter to determine behavior?

I have seen a practice from time to time that "feels" wrong, but I can't quite articulate what is wrong about it. Or maybe it's just my prejudice. Here goes: A developer defines a method with a ...
0
votes
1answer
73 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 ...
4
votes
2answers
1k views

Technical documentation vs Software design documentation

I am trying to start a documentation about a class library that is already finished/developed. The purpose of the documentation is to be used by other developers in order to understand what kind of ...
0
votes
0answers
32 views

“Expiration” of a Domain Entity in Microservice Architecture [closed]

I want to implement an expiration functionality for a domain entity. For example: User queries a Gift Code that should expire somewhere around 30 mins after creation. I see several approaches to ...
0
votes
0answers
56 views

Business logic in a stateless backend when frontend already has all the data

I have a frontend application, that only knows about and communicates with a single backend service. This backend service serves only this frontend app and no-one else. Backend is completely stateless,...
0
votes
1answer
75 views

Best design for a AMQP work queue

I have a system where a user uploads a file to import some users but it's necessary to do some validations and this take some time. I would like to create a work queue with RabbitMQ and the user will ...
2
votes
1answer
416 views

Message Queues and Multiple Subscribers

My team is discussing using RabbitMQ for microservice to microservice communication (among other things). We are also supporting a SAP backend that will be pushing data to us in a method undecided at ...
-1
votes
1answer
73 views

Is there a reason to have multiple projects for a single API? [closed]

I entered yesterday to my new job and while browsing their repositories, I noticed they have a project for every resource of a REST API. For example, if they need to add a REST resource called "people"...
-1
votes
1answer
101 views

I have a data set of over a million addresses and I want to display the closest N locations to a given address or current location

I am a student working on a personal project which is essentially a location finder that will be on a website. I have a data set of over a million addresses and I want to display the closest N ...
5
votes
1answer
2k views

What is a good software architecture for POS with offline mode?

I have a software for small delivery stores (pizzeria, Japanese, etc) here in Brazil running on a few dozen customers and have the possibility to expand it to many more customers after evolving it ...
3
votes
2answers
178 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 ...
0
votes
2answers
148 views

How to design an API wrapper with bulky operations on domain object? (Need guidance)

I need some guidance in designing an API wrapper for my backend APIs. I have tried to keep it as specific as possible. Context: We have a project which supports certain file operations like edit, ...
6
votes
2answers
7k views

System Design: Scalable Chat Server

Suppose you were asked to design a scalable chat server with the following requirements: The main use case is: player A sees B online, A sends a message to B, B receives it. The secondary use case is:...
-1
votes
3answers
169 views

Is it ok to have a class contain a list of its parent object?

I'm working on a software in which the client wants the admin to have all the rights to view and update the info of other employees. The admin is an employee itself so this is what I've come up with ...
0
votes
1answer
62 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 ...
0
votes
0answers
22 views

Design pattern that can be used for checking and handling a change in version number for incoming JSON message into data stream?

I have a Spark Streaming Job which processes messages coming from Kafka. My incoming json that I process sort of looks like {"sv" : 1.0, "field1" : "some data"} The only thing I do is put these in ...
1
vote
1answer
41 views

Front-end supporting multiple back-end versions - Maintaining backward compatibility

I know it's a broad question so I'll try to be as specific as possible. This question is probably as much an "organisational" question as a technical one. Our company is selling our software/platform ...
0
votes
2answers
100 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 ...
24
votes
5answers
26k views

Is it good practice to use entity objects as data transfer objects?

I am wondering because if it is, why does Entity Framework not offer logic to create a new object with the same properties to transfer data between layers? I use the entity objects that I generate ...
139
votes
8answers
21k views

Are bad programming practices typical within the software industry? [closed]

I just started my first job as a software developer over a month ago. Everything I have learned about OOP, SOLID, DRY, YAGNI, design patterns, SRP, etc. can be thrown out the window. They use C# .NET ...
1
vote
2answers
385 views

Agile development: where to include UI coding?

I've been doing agile planning for a long time, but always I get to the same question: where should I put the basic UI development tasks? I mean, for example, if we are developing a web app, we need ...
0
votes
3answers
137 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 ...
0
votes
1answer
50 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 ...