Questions tagged [design]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
43 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 ...
2 votes
1 answer
90 views

Design for deduplicating concurrent tasks in flight simultaneously

I have 1-20 agents that issue requests over time with roughly ~50 in total in flight at any given time. Many of these requests are identical. The tasks are idempotent, but if two identical requests ...
0 votes
1 answer
64 views

Handling/queueing a Windows-Service restart to apply new changes

I'm working on a project that has the purpose to execute tasks in intervals. The tasks and it's properties can be configured through the Configuration Website. The data is being stored in the ...
  • 11
3 votes
2 answers
434 views

How to manage data consistency between Bounded Contexts?

The typical example, the e-commerce system. Let's say the Order is in the Sales bounded context. Every Order contains many OrderLine, which stores the ProductId. The Product is in the Product Catalog ...
0 votes
1 answer
538 views

Mastering the usage of [PublicAPI] attributes?

Take the following class, without [PublicAPI] attribute, ReSharper says that all public members can be made private. using System; using JetBrains.Annotations; namespace ObjMtl { // [PublicAPI] ...
  • 727
-3 votes
1 answer
94 views

How would a stateless server handle events when the user disconnects?

I want to build a chat application with a stateless server as backend. Users have an online and offline status. When a user connects to the server, the server marks that user as online. Now imagine a ...
  • 103
1 vote
4 answers
219 views

Should we directly read environment variables when/where we need them?

Why most frameworks (at least in PHP. I suppose in other languages, too) use the environment variables to set a corresponding configuration parameter and then access the value through a config object/...
0 votes
1 answer
89 views

ViewModel as Observable, Views as Observers of it

Considering i have a Presenter that updates a ViewModel, and potentially multiple Views updatable from this ViewModel. What would you think about this way to proceed : Somewhere we register the Views ...
0 votes
1 answer
102 views

Stable abstraction principle

I'm studying design principles, and I have a doubt in package coupling principles. I know that the 'Stable Abstraction Principle' says that a package should be as abstract as stable, and it says that ...
  • 19
2 votes
0 answers
112 views

Cohesion and coupling possible combination in software

I know what we mean by cohesion and coupling in software. And generally the best practice is to achieve high cohesion with low coupling. It seems to me though that they are inter-related. I.e. you ...
  • 297
1 vote
1 answer
106 views

Do State diagrams Only Represent Individual Objects states?

On website uml-diagrams.org it is mentioned that state machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state transitions. To the best of ...
2 votes
0 answers
44 views

Software design for an Angular highlight&comment tool

We're building a new feature for an online editor that the user will not edit the document, but will be able to highlight & propose edits on the document. Very similar to google documents' ...
  • 133
0 votes
1 answer
64 views

Interface design for container that holds different instances derived from a common type

I'm currently designing an interface for a container that is supposed to store references of different instances that derived from a common supertype. An analogy of it would be as following: Suppose ...
4 votes
1 answer
122 views

Using Choice Node in State Machine Diagrams

In State Machine diagrams, in some online resources, the condition is merely drawn on the arrow (the left figure below) and in others similar to right figure, where a choice node is specifically used. ...
2 votes
1 answer
48 views

SQL: Analytics event value that can be string or number

I'm using a PostgreSQL database and I want to create an analytics table that has a many-to-one relationship with an analytics_type table where analytics_type_id is the foreign key. The table also has ...
  • 47
2 votes
2 answers
126 views

User stories - Different formats for different purposes?

To the best of my knowledge, user stories follow a format such as As a [role], I want to [do] such that [benefit] - (This takes 8 days to develop) Recently in the book Software Engineering by Ian ...
3 votes
1 answer
189 views

API Design for Error Handling

I'm working on a semi-complex web API, the high level design so far looks like this: |--------| |------------| |------------| | |--| | | | | core | | | | ...
  • 131
0 votes
1 answer
66 views

Integration with stripe, have a single source of truth or have info of the user status in our DB

So We're integrating our application with stripe and we have different products There are 2 options : Have stripe as a single source of truth, anytime we need to check the permissions of a user we ...
  • 123
2 votes
2 answers
139 views

Is nesting try-except sequence in try-else block bad form?

Ive got a boot sequence that needs to check some registry values, they may or may not be present, so each check needs to be wrapped in its own try-except. I try to avoid nesting as I think it can lead ...
  • 999
1 vote
1 answer
190 views

Avoiding coupling through code sharing

I have been working on an application which consists of several cohesive services, Customer, Invoice, PurchaseOrder, Highlight, the application is deployed within a mono repo and each service is ...
  • 113
0 votes
0 answers
90 views

Trade-off between usability and clean design

I have designed our in-house hardware testing framework. My goal is to ultimately release the framework into the public domain. Early on, my foremost design criterion was to provide a powerful yet ...
1 vote
4 answers
94 views

Class Diagram - Aggregating over a class that has physical presence or logical presence?

In the below figure, a CD shop has CD cupboards, and inside it has shelves. CDs could be rented, and class CD Copy represents the actual CDs that are rented. My question is, should I represent Shelves ...
  • 339
0 votes
1 answer
64 views

Ranking results from a Question and Answer game

I have a question and answer trivia game app which randomly picks questions from a database and prompts the user to answer the question correctly. The total number of correct answers, the total number ...
-1 votes
1 answer
90 views

CQRS Domain Driven Design and single save button

This may be a dumb question, but I don't know how to solve this. I am moving from CRUD to Domain-Driven Design with CQRS. I have seen many DDD examples like this. You could find many more on Github. ...
1 vote
1 answer
91 views

What to improve/change and how to move forward with my Event Storming session?

I'm doing alone session with Event Storming for my application that I plan to build with DDD approach later on. Event Storming session is for learning purposes. My application domain logic is rather ...
5 votes
3 answers
531 views

Non Functional Requirements and Use Case Diagrams

My software provides two functional requirements, and I represent them as Do A and Do B in the figure 1 below. At the same time, my software has a non-functional requirement to provide the interface ...
  • 213
2 votes
1 answer
176 views

How could Vulkan pNext design be implemented in a "safer" way?

Vulkan introduces a member .pNext of type void* in all its core structs allowing to create handles. This member purpose is to allow to extend the structure by passing a pointer another one. This is ...
  • 129
0 votes
0 answers
137 views

Dealing with third party api rate limit when using multiple services

I have 1 api key that has a rate limit 1000req/1min. I would like to somehow use 50% of that limit in service 1 and 50% of that limit in service 2. Let's say they're just 2 separate processes using ...
  • 1,441
1 vote
2 answers
81 views

Naming for a Class that performs one or more set operations

I'm designing a class that takes: 1 - An initial set of items (a simple collection/list) 2 - 1 or more Filter objects, that take the initial set of items and return a new set. Each Filter object may ...
  • 21
2 votes
2 answers
79 views

Actors and their representation in the system

I am trying to understand the relationship between actors and their representation in the system. Please see the below figure In the figure on left, I have an abstract representation of my system. In ...
0 votes
2 answers
151 views

How best to deal with growing polymorphic interfaces?

Consider the following scenario in an object-oriented environment. Sample code is in C++, but it could be any OO language. A software must control an external device, say a TV. From the start you know ...
1 vote
1 answer
74 views

DDD - Many-to-many between aggregates

I have 2 aggregates: Occupation and WorkActivity. An Occupation can have multiple WorkActivity. A WorkActivity can also belong to many Occupation. The aggregate is a basic element of transfer of data ...
0 votes
1 answer
181 views

Bank actors in Use case diagrams

In a use-case diagram, use cases (bubbles) provide a functionality to an actor. For example, ecommerce site, actor "shopper" could use bubble "browse catalog" or "make payment&...
3 votes
4 answers
424 views

Is it a bad practice to have an interface method to tell whether it can handle an object?

interface Resolver { boolean canResolve(SomeInput input); SomeOutput resolve(SomeInput input); } public static void main(String[] args) { List<Resolver> resolvers = ...; ...
1 vote
2 answers
97 views

Use case scenario based on a use case using "uses" or "extends"

In a use case diagram, use case A "uses" use case B. I need to write the scenario based on steps of use case A. Since A "uses" B, I just wanted to confirm that I need to include ...
1 vote
5 answers
105 views

Actors participating in use case diagram

Suppose a customer needs to approach a staff member to register her. To model this, I have drawn the image below. However, I am not sure if what I have drawn, actually means both of them can register ...
  • 339
1 vote
4 answers
400 views

Are static classes/methods good for pure business logic?

I have a service class that performs some operations. One of the operations is a piece of code long enough to warrant extracting to a new class and unit test it in isolation: @Service public class ...
0 votes
0 answers
80 views

Load balancing the load balancers

Currently I have a system where I have installed HAProxy on one machine and my other 3 machines serves the webapps and the fourth machine for the database. Now I need to add another load balancer in ...
1 vote
1 answer
94 views

Difference between Sequence Diagrams at Conceptual and Design

Recently I learned that sequence diagrams can be used at both requirements specification and design level. My search so far shows the boxes on top of the sequence diagrams used for design consist of ...
  • 339
0 votes
0 answers
221 views

How to structure a global config that needs to be available at import time? (Python)

I've got a Python application (imagine a Flask app, but this question is not specific to Flask). I have an App object and a Config class that I instantiate with values from a file. Normally in the ...
  • 119
0 votes
0 answers
61 views

State Pattern: Changing object behavior based on more than one field and consistency between their values and state value

I'm Trying to learn about State Pattern. In most of State Pattern examples that I have seen, methods of class change their behavior based on just one field (I mean before applying State Pattern and I'...
1 vote
2 answers
322 views

Defining Bounded Contexts using Business Capabilities or Domains?

I am new to Domain-Driven Design. When I was trying to define the bounded contexts of the software, I don't know where to start. After some searching on the Internet, I am totally confused. Some ...
0 votes
1 answer
139 views

Ideal REST API for long stateless computation?

We have to compute a schedule for a set of students and teachers in a school. The program takes a large amount of data. The time it takes to compute a schedule for a given input cannot be determined. ...
  • 103
0 votes
0 answers
130 views

Blazor server side or client side, towards backend DB

I'm wondering, although as I think both options are possible. Currently, there are two versions for Blazor projects in visual studio 2019. If you want to connect to a backend DB then there are two ...
  • 137
-2 votes
1 answer
42 views

Should I wrap Azure AD B2C for authentication?

I want to implement an authentication system. The purpose of the system is to centralize account management and handle the complexity of account security. Internally, I don't want to implement the ...
0 votes
1 answer
404 views

FCA and PCA vs. Requirements

I was thinking that a Functional Configuration Audit (FCA) point to the Functional Requirements while the Physical Configuration Audit (PCA) is more related to the non Functional Requirements is this ...
1 vote
1 answer
304 views

Is usage of "global" types in typescript considered bad practice?

I'm fairly new to strongly typed languages, coming from the "jungle" world of JS and PHP. In my current Typescript project(React-Typescript), i'm struggling with a very fundamental question: ...
  • 115
1 vote
2 answers
301 views

Relationship between System Requirements and Software Requirements

i'm trying to learn about requirements in software engineering. At the moment i have a example problem i'm running through, where i'm trying to develop a system that allows calculations. The goal of ...
0 votes
1 answer
149 views

Designing functions with separation of concern in mind

Is there a name related to the pattern shown in the code that follows? Or is there writing/thinking on the [design of] code shown that suggests it is an anti-pattern? In general, I'm curious if this ...
0 votes
0 answers
72 views

Single Page Application with possibly multiple database served from the same API endpoint?

I'm developing a web application that has two main user roles : say role X and role Y. React will be used as the front-end interface, while Django will be used as the API endpoint. Say that it will be ...