2022 Developer Survey is open! Take survey.

Questions tagged [design]

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

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

Can a socket be connected to many balls in a component diagram?

I have to draw a component diagram that depicts the architecture of my system with its subsystem decomposition and its dependencies. My system has a 3 tier architecture: The top layer just acts as a ...
user avatar
  • 299
2 votes
2 answers
302 views

How to handle duplicate null checks

I'm working with a legacy codebase that has a lot of functions with a nullcheck on the same object. Example: std::vector<SessionNode*> * SessionManager::SessionMap; Session * getSession(int ...
user avatar
1 vote
0 answers
45 views

Create Views depending on the dynamic type of an object returned by the model in MVP

In my MVP app, my model (a service) returns a collection of ISession pointers. Each pointer points to an object of a derived type HttpSession or HttpsSession. The model (the service) knows nothing ...
user avatar
  • 111
-1 votes
1 answer
119 views

Would you put your Microservice doing ETL (Batch Processing)? [closed]

I am creating a Risk Microservice (Long lived application) which exposes some APIs. The Risk Microservice can CRUD, for example CalculateRiskScore which is an operation exposed via REST. As we have ...
user avatar
-1 votes
1 answer
71 views

Where should my element invoked function be defined, and why?

I have a button element on index.html that invokes a function signIn: <button onclick="signIn()">Sign-in</button> I have a few basic options on where this function can be ...
user avatar
-1 votes
1 answer
106 views

How to write tests for a class that talks to a server without revealing connection implementation

I'm writing a class that acts as the interface to a server. The interface exposes a way to send messages to the server and pass messages back to the client through a callback. Implementations should ...
user avatar
2 votes
1 answer
175 views

What is a Reactive User Interface? Where did the term come from?

I heard about Reactive User Interfaces in a React course. I would like to understand the concept, but was unable to find reliable sources. Best I could find is that they are some sort of declarative ...
user avatar
-1 votes
2 answers
59 views

Methods to model mutations performed by functions

Given a set of interfaces, objects implementing those interfaces, and functions that use those objects, what methods exist to model mutations performed by the functions? For example, given: A Pet ...
user avatar
1 vote
2 answers
129 views

Should I add functionality by adding a new method to a class - or should I "register" the new functionality into a data structure?

I have one large class that computes ~50 different metrics (each metric has no side effects). My code is similar to this: class ReportingMetrics: def __init__(self, data:pd.DataFrame, config:dict)...
user avatar
  • 195
0 votes
1 answer
60 views

term for errors which occur when running code with new data, when older data was used to develop/test the code [closed]

I'm writing code to clean and process a large number of transcript text files. My code will be re-used in the future to process additional files which do not yet exist. Future files will take on the ...
user avatar
  • 117
1 vote
1 answer
34 views

Register a collection of tested object and get one configuraton out of it

I have a yml configuration file that list multiple application. Each application can contain multiple configuration. And of course each configuration can contain multiple mode apps: - name: foo ...
user avatar
  • 149
2 votes
4 answers
229 views

What is the middle ground between understanding basic OOP concepts (inheritance, composition, aggregation) and design/architectural patterns?

I've been coding in python for about 6 years now. I am proficient enough to understand a good amount of the language features. When I look into source code for a number of libraries such as pandas or ...
user avatar
  • 213
0 votes
1 answer
127 views

Prevent Data Leak from Implicit Caching in Multi-Tenant Cloud Application

Goal Allow single web service instance to serve different tenants on a per request basis. Design In order to allow a single web service instance to handle requests for multiple tenants there exists a ...
user avatar
  • 117
0 votes
0 answers
63 views

Bi-directional messaging using Zero MQ pub sub pattern

I am trying to design a system that can be safely used to share messages between processes on the same system using ZeroMQ. I have chosen to use a central broker that binds to a particular port. All ...
user avatar
0 votes
2 answers
104 views

Make date range generator interface stateful or stateless?

An app has a feature that's much like any calendar application (like the Outlook calendar for example). Consequently, I need to do a lot of date logic. I wrote a class with date calculation methods ...
user avatar
1 vote
1 answer
87 views

Constructor initializer list too bloated?

I noticed that my Member initializer list is not really readable. My main.cpp files looks like this: #include "Application.hpp" using Pathfinding::Core::Application; int main() { ...
user avatar
  • 161
2 votes
1 answer
129 views

Delegating whole class bad practice?

Suppose I have the following struct: struct Dimension { void setDimension(Vector2i dim); Vector2i getDimension() const; bool canShowInformation(); } And this struct uses the Dimension ...
user avatar
  • 161
-1 votes
3 answers
86 views

What is the proper term for separating code into their own files? [closed]

Just curious on how to better explain this with the right terminology. For instance in React, this would kind of be like breaking down a large component into multiple smaller components. But that is ...
user avatar
2 votes
2 answers
71 views

Replacing service implementation based on environment variables

I have previously asked a question on this forum linked here. In short, I wanted to not call 3rd party APIs when developing locally. Based on the wonderful answers received I have opted for the ...
user avatar
  • 151
0 votes
1 answer
127 views

Can cache be shared among services via Redis/Hazelcast?

Can cache be shared among services via Redis/Hazelcast? I have a few microservices A, B, C etc. The Microservice C is mainly for helping other services. Service C periodically updates cache - so that ...
user avatar
-2 votes
1 answer
114 views

What is the right approach for dynamically creation of SQL-queries?

The problem: I have a application where the data comes from SQL tables. The design of the tables differs a bit from client to client. Example: ClientA sells thermometers and the product has features ...
user avatar
-1 votes
1 answer
27 views

Options to maintain queue of resources that will be uniquely returned

I need to maintain a queue of resources in a cache such that when multiple clients try to pop elements from the queue concurrently, each element would be uniquely returned to only one of the clients. ...
user avatar
2 votes
2 answers
205 views

How could I extend these methods that use flexible arguments?

Context Let's say I have a Shape class (I'll use C# for the code snippets) that represents a 2D shape, like a triangle or a circle. These shapes have an area, so I'll include a method for calculating ...
user avatar
3 votes
1 answer
87 views

Designing shared subtype functionality with correct type annotations in Python

To illustrate the problem, I'm defining a PositiveNumber class that is a subclass of a Number class. As Python doesn't support type casting, I'm defining the from_number as a convenience method I can ...
user avatar
  • 41
2 votes
1 answer
89 views

Modelling multi-device manufacture machinery software

We are building a multi-device (different vendors, different types) manufacture machinery where these device work together orchestrated by our software and operated by a human being to create various ...
user avatar
3 votes
3 answers
320 views

Is it good practice to use try catch for data validation [duplicate]

In my current development task, I want to validate whether a string is in JSON format or not. When I checked for solutions from resources like StackOverflow I saw many of answers are as below, try{ ...
user avatar
-3 votes
1 answer
48 views

Is it possible to add a unique identifier to the shared Data via bittorrent (P2P)?

I know that P2P sharing is copying the exact content between the peers. Everyone has the same data. Let's assume the content is very important and I don't want anyone to distribute outside the group. ...
user avatar
  • 1
-3 votes
1 answer
72 views

Combining Strategies (Design Patterns) [closed]

If I have two boolean variables B1 and B2 whose value combinations cover four independent behavior functions (MFF, MFT, MTF, MTT), then how many concrete strategy (design pattern) classes should I ...
user avatar
2 votes
2 answers
117 views

Procedural configuration code to object oriented code

Lets say we have an Webserver-Framework and a Database-Framework, and now i want to configure that Webserver and the Database, then it could look like the following class Start { public static ...
user avatar
0 votes
2 answers
137 views

Adding item to list process in domain driven design?

I will describe the problem in a typical example Todo Application. The user can have many TodoList. A TodoList could have many Todo. The use case is "Add Todo to the TodoList". In this case, ...
user avatar
0 votes
1 answer
90 views

Reconstitute value objects from database

I am using Domain-Driven Design with Railway-oriented programming as an exception handling method. Every value object will not throw an Error, but return a Result type to indicate if it failed or ...
user avatar
0 votes
2 answers
195 views

Should a client / server share error codes?

I am in two minds about sharing client / server errors codes. We are writing both ends of the system, if our API was external this would not be possible, but that requirement is very unlikely. So an ...
user avatar
  • 151
1 vote
3 answers
243 views

Value object depends on other value object

As I understand, most of the business logic is stored in the value objects as constraints, like the price cannot be less than 0. But I have a problem where the value object depends on another value ...
user avatar
0 votes
0 answers
55 views

What's the best pattern for querying metadata on objects?

If I have an instance of an aggregate, and that aggregate has, for example, different related contacts, then I should be asking the aggregate who its contacts are. Pretty standard. That pattern can be ...
user avatar
0 votes
0 answers
16 views

How should I design a web application that will show outputs and issue commands on devices using MQTT?

I'll be developing web application (most probably an Express.js REST API) that will include user management, device management by users. There will be users which will sign in and log in to the system....
user avatar
1 vote
1 answer
111 views

How to create an object requires multiple bounded contexts?

I will describe my problem with a very typical example, an e-commerce application. Says we have to manage Products, and we have 2 bounded contexts Sales, and Warehouse that store the product ...
user avatar
5 votes
1 answer
422 views

Is changing the exception a method throws a breaking change for a library?

I have a library that I am distributing on maven in the new version I will be changing the exceptions some methods are throwing. Is this considered a breaking change? If this is the only change in the ...
user avatar
0 votes
2 answers
170 views

Sharing logic / services across modules in "clean" architecture [closed]

I am trying to implement a layered architecture consisting of; Controller, Service, Repository, Entity. Each module has at least some of the above layers. I am often finding that modules need to share ...
user avatar
  • 151
-1 votes
1 answer
118 views

How to use external validation libraries for entities in a "clean" architecture?

I would like to make use of a external library to parse the core domain entities. Doing this in a naive way it would look like the following: import { z } from 'zod'; const Audience = z.object({ ...
user avatar
  • 151
-1 votes
2 answers
118 views

How to measure how "changy" something is? [closed]

I need to think of a way to model how one thing is more "changy" than another. Say I need to index a news website's different news sections with some web crawler. I want to prioritise ...
user avatar
-1 votes
3 answers
74 views

Improving APIs that call 3rd party APIs [closed]

So I'm designing the backend of a platform that often calls other 3rd party APIs. The issues I've noticed were latency issues (sometimes the calls were fast, others a bit slow >15s) and I'm ...
user avatar
  • 109
-2 votes
1 answer
64 views

Do I need to write Scenarios if I use Event Storming? [closed]

Event Storming is a great method to understand the business processes. Scenario (Use Case Specification) also describes the business process. They both do one thing. But when documenting, the Event ...
user avatar
0 votes
1 answer
66 views

How to Properly Design an API Prefetch System

I'm creating an API for a web service. There are a couple of endpoints in this API that require some time (lets say +5min) to compute, so I'm creating a prefetch system that will call in the ...
user avatar
  • 131
0 votes
2 answers
151 views

Explicit Modeling Aggregate Root to avoid State Pattern

In the book Patterns, Principles, and Practices of Domain-Driven Design, chapter 16, entities, Avoid the State Pattern; Use Explicit Modeling has brought the great idea of domain modeling to my life. ...
user avatar
1 vote
1 answer
146 views

How to integrate Third-party Service in Domain Driven Design?

I will use the typical e-commerce system as an example of my problem here. The e-commerce system has bounded contexts like Sales, Shipping, Identity and Access. The Sales could be a core bounded ...
user avatar
-1 votes
1 answer
295 views

Where should the user access bounded context stands in DDD and Clean Architecture?

I have seen some Bounded Context examples to learn DDD. In those examples, the User Access bounded context (register, login, authorization...) is considered a generic bounded context and could be a ...
user avatar
0 votes
1 answer
81 views

How should you structure the front-end/client to interact with a web app microservice?

I've been grappling with this for a while and figured I would post here to get input. I am a full stack engineer. I work on both front end and back end apps, where sometimes I have to create new ...
user avatar
  • 329
-2 votes
3 answers
79 views

Design consideration-To add or not to add a related variable in a class

I need something clarified. I have been having a discussion with someone and we have conflicting arguments. Hence, I came here to ask looking for your insights. Say we have to implement our own stack ...
user avatar
0 votes
1 answer
41 views

Design approach where to persist autocompletion suggestions

I am currently planning a movie recommendation application. Within this context, the user can fill out a form including different information (e.g. title, description, etc.). The new entry gets then ...
user avatar
-3 votes
1 answer
99 views

Best way of organizing and storing this data in an explicit way? [closed]

I'm developing a free app to help people know how long to wait for their next bus in a specific itinerary of my country. I'm inclined to use Python and Kivy to deploy the app on multiple platforms. I ...
user avatar
  • 95

1
2
3 4 5
99