Questions tagged [design]

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

Filter by
Sorted by
Tagged with
2 votes
2 answers
332 views

Is it good design to have a repository update multiple entities?

I'm building a web application using Laravel. I use the repository pattern as my data layer. Imagine there's some entity like Product and a product can be assigned to a ProductCategory. The Product ...
2 votes
2 answers
123 views

physical simulation: design thoughts

I'm an applied physics student and currently working on a simulation of the magnetic interactions of multiple protons within a protein. Me having only little experience with programming and almost ...
  • 17
0 votes
1 answer
75 views

In DDD, must a Value Object turn into an Entity when some limited idenifiablity is required?

I have an Entity type, let's say Car for example. There is a Value Object type Tire for it. Each car has a set of tires with certain properties. Sometimes tires are replaced, which is communicated by ...
0 votes
2 answers
118 views

Attribute Driven Design

From Wikipedia: Attribute-driven design (also called ADD or Attribute-driven design method) is a methodology to create software architectures that takes into account the quality attributes of the ...
1 vote
0 answers
40 views

Hosting/Imbedding Angular Application in ASP.NET MVC Application

Currently, I am working on an existing project, my team creates a new Angular-based application with the usage of some Angular modules that are developed in the company, in addition, there are some js ...
  • 124
10 votes
4 answers
4k views

How to store a fixed length array in a database

I have a mysql database in which I have drafts, each of which contains exactly 24 players the order of which matters. I am conflicted between having a drafts table with 24 extra columns for each ...
  • 101
4 votes
4 answers
594 views

Giving multiple components access to a single database

This is in context of a distributed computing. There is a Service A which owns a database and hosts APIs for updating an entities in this database. As time went by, the service has evolved and we are ...
1 vote
0 answers
34 views

If I have Object b of Class B inside Object a of Class A, which class should contain methods relating to manipulating data in Object b? [duplicate]

I have written some code that contains the class Game and the class Draft. Inside of Game I have a private member, instance of Draft draft. When a user requests through the UI, a game must return some ...
  • 101
-1 votes
1 answer
62 views

Pattern for flexible promotions/badges [closed]

Let’s imagine system like Garmin connect, you run, record your workout and then once you finish workout is uploaded to the system and being analyzed. Based on analysis you can receive badge: for 5 km ...
  • 111
0 votes
2 answers
140 views

What if a Repository needs to apply Business Logic to load an Aggregate?

I have an aggregate User and the user has a Score. The Score of a user is calculated by queriying a bunch of different tables and running through (often very large) result sets applying some business ...
  • 153
2 votes
0 answers
45 views

How to have only one consumer handle a long running task at a given point?

I need to design an application which makes requests to an external API. External API has a hierarchy of entities: User which contains ListOfItemss which contain Items. I need to get data on all Items ...
  • 155
1 vote
0 answers
39 views

How to map translated variable names for column names, so I can export them?

In short story, I want to make some universal generators for different formats (CSV, XLS, XLSX and JSON for now). Just to be clear, I will make different classes for all formats. I have different ...
  • 109
7 votes
4 answers
2k views

The meaning of "function blocks of limited size of coding" in ISO 13849-1

Section 4.6.3 of ISO 13849-1 concerning "safety-related application software" has following provisions: c) Software design shall feature: semi-formal methods to describe data and control ...
1 vote
0 answers
52 views

What's a suitable pattern for handling multiple versions of PDF layouts?

I have a class responsible for generating a PDF. The class takes an existing PDF template and builds multiple pages. Each page has various elements that are inserted/manipulated. I now need to handle ...
0 votes
0 answers
27 views

Double get child data from database?

I have object with children. Children has bool attribute "active". The REST controller accepts parent and child data. By default, I call service (ParentService) in the controller and in it, ...
0 votes
0 answers
60 views

We are aware of Service Discovery- is "Object" Discovery a thing?

Context My office is currently working on distributed (micro) services, as part of this we obviously have Service Discovery between these services so that they are aware of each others locations (when ...
  • 109
0 votes
3 answers
222 views

Proving program correctness under all possible cases

There are techniques of proving program correctness under all possible cases, but that is a more advanced topic, for a later subject in your curriculum. I always had this doubt: Is it possible to ...
  • 19
0 votes
3 answers
895 views

Why is recompilation of dependent code considered bad design?

I am reading a book C++ Software Design by Klaus Iglberger. In the book, the author asserts multiple times that recompilation effects of dependent code is extremely bad. For example, The heart of the ...
0 votes
0 answers
48 views

Authorization Code Flow or Client Credential Flow for One-Time Mail Configuration

Have an enterprise web application with a Web API 2 backend and other external backend processes. Both of these send mail with or without user interaction. I identified the client credential flow as ...
0 votes
1 answer
141 views

Good class design: dependency vs duplication? [closed]

Let's say we have a class( My_Func_Dec ) that models a 'function header declaration' as it might appear in a .h file. const std::string func1 ( const std::string& arg1_, const std::string& ...
  • 9
0 votes
1 answer
125 views

Best software architecture approach for a single core system

Objective: Designing a data intensive application(myApp) C++ on Linux/RTOS which runs on a single core cpu, there are also 150 other applications share the same core with high priority than myApp. How ...
  • 141
-1 votes
1 answer
71 views

Object Diagram help [closed]

I'm making an object diagram. This is based on a random time during a Cataract Surgery, which is when surgeon replace a lens in your eye. Students are observing the surgery through VR. The basis of ...
0 votes
3 answers
338 views

Is there a design reason why Git commits only store pointers to their parents, not children?

Git commits contain pointers to their parent commit(s). Is there a reason why they don't also contain pointers to their child commits? I get that there's a problem of data duplication, in that you'd ...
  • 336
4 votes
3 answers
347 views

How to think about system design questions methodically?

I'm working on my first big system design project at work for the first time in my career. In the past, while i've worked on large systems, I was always working with someone else, so I wasn't really ...
3 votes
2 answers
248 views

Process many types of work in parallel, but sequential for each type of work

Imagine there is a stream of requests for about 500 types of work. There can be say 5 workers in parallel. One type of work should be executed by at most one worker at the same time. The requests for ...
  • 89
-1 votes
1 answer
92 views

How to automatically calculate the norm for users in our time registration application?

I'm creating a time registration application for employees where they can register their hours. I want to show the users their "norm" (not sure if this is an actual word or just made up by ...
  • 99
0 votes
1 answer
244 views

Clean Architecture : Application State

Given the following design from clean architecture in which layer would you put overall application state? In each state a subset of use cases are allowed to be invoked. For example if application is ...
  • 9
-2 votes
1 answer
46 views

System design to present live query results over realtime data

Question What is a good storage layer, coding paradigm, and query language for computing over realtime data? Use-case For example, stock and options prices are (essentially) realtime data streams. I ...
1 vote
0 answers
78 views

How to handle Authorized & Non-Authorized Routes in Microservices with Tokens

Context Suppose there is a e-commerce microservice architecture with the format: In summary, a client will contact the Auth Service / Identity Service to receive a token. It passes the token to the ...
2 votes
1 answer
84 views

Reprocessing out of order events in a stateful stream

Say that you have a monitoring application that reports downtimes for a large number of remote systems (think IOT). A monitoring daemon polls the remote system and reports that status (on/off) via an ...
  • 746
0 votes
4 answers
267 views

Should clients send all required information to servers?

Should a service making a request send all the information another service requires from the requesting service to complete the requested service's job? Or should the requesting service send as little ...
  • 136
0 votes
0 answers
39 views

Auth0 Middleware Layer Abstraction

I am currently spearheading a project to rearchitect our authentication, and we've signed on with Auth0 as a vendor that will manage the authentication component (for the time being - authorization ...
  • 101
0 votes
1 answer
53 views

Resource Specific Permissions in Microservice architecture

While building microservice-based architecture I came across a dilemma on how to approach company level permissions for given range (or ids) of resources, i.e. allowing certain users to access subset ...
  • 9
0 votes
4 answers
304 views

Avoiding Synchronous Communication Between Microservices

Something that annoys me when reading about decoupling microservices is that the problem is often stated, with either poorly explained, bad, or no solutions provided, which seems to especially be the ...
0 votes
0 answers
34 views

Clarifications on application/server architecture in manufacturing context

Context : I am currently task with building a software to support operators in a manufacturing plant. Due to the nature of the plant, the computers all have fairly weak processing power (given that ...
2 votes
1 answer
160 views

What is the definition of 'Availability'?

In my research, I have found two conflicting definitions of 'availability' as it relates to software engineering and architecture. According to [1]: "The availability of a system can be ...
1 vote
3 answers
678 views

When Should I Use a Static Class and When Should I Just Use Functions?

I am currently building a C# application that gets JSON data then it calculates something then stores the results in a database, what is the proper way to design the application. This is how it's now ...
1 vote
1 answer
82 views

Best practices to link, associate, or abstract similar but different entities together

What are the best practices that I can follow that can simplify or help abstract out entity modeling when there are many similar but different entities? I have a large game system with different types ...
  • 111
1 vote
2 answers
93 views

Microservice Granularity: Should a service ever be broken into smaller services with a shared database?

I'm trying to understand the size of a micro service. Fake situation: Data is read 1,000,000 times for every write. So when you scale out you generally only care about scaling out for the 'GET' ...
  • 301
1 vote
0 answers
51 views

Design a push events service at code level

In a large monorepo containing multiple micro-services, I need to build a service to push various events to several of them. The event interface differs from service to service(one will have filed_5 ...
  • 101
1 vote
2 answers
118 views

Architecture for worker pool with different task complexities and sizes of boxes

I'm sorry if I'm using any wrong terminology here. I'm trying to design an architecture where there can be big and small tasks (e.g. processing big or small images). Big tasks can only be handled by ...
  • 301
0 votes
0 answers
39 views

How to handle maintenance to your queuing server (e.g. rabbitMQ)

I'm new to queuing and looking into options that could be done operationally. I'm sorry if I have any conceptual misunderstandings related to queuing. I watched this video where the presenter made a ...
  • 301
0 votes
2 answers
123 views

Where to save entity metadata in a Ports-And-Adapters Architecture

I’m using a hexagonal/clean/ports-and-adapter architecture. For the sake of simplicity, I’ll only talk about domain and infrastructure here, where the infrastructure has dependencies on the domain but ...
  • 621
0 votes
4 answers
199 views

Code for interface and the type erasure problem

As a design priciple I was taught: Programe para una interfaz, no para una implementación. Es decir, no se deben declarar las variables con el tipo de los herederos sino con el tipo de los supertipos....
2 votes
1 answer
206 views

Interface segregation principle

Let's say we have the following business requirements: We have a list of dishes. They have a name and a list of ingredients. The restaurant owner always wants to have a dish (and only one) marked as ...
1 vote
2 answers
286 views

What are the considerations between a class variable and a global variable

At first glance, these seem equivalent. If one has the right visibility, one can access a global variable or a class variable from anywhere in the program; There is only one, shared copy of them. So ...
2 votes
1 answer
62 views

Allow\disallow actions in one system based on the state of another

Subj - how could I allow\disallow actions in my system based on the state of another external system (I have access to it's state via the shared DB table)? I can get the state of another system almost ...
0 votes
2 answers
145 views

Refactor to object oriented style and use design patterns

I have an application that has been written in Python and it is used for generating various MIS reports for a specified month. It is now written without using the OOPs concepts or any kind of design ...
0 votes
1 answer
131 views

Where to create repository instances?

I've several repositories. To make them testable, I add the ORM session in the constructor. class Repository: def __init__(session): self.session = session def save(object): self.session()...
  • 143
1 vote
2 answers
122 views

Is it okay for a POST response to return resources other than those in the request?

Working on the API, I understood that the behavior for one of the endpoints might be a bit counter-intuitive, but I am not sure whether this violates any RESTful rules. Based on what I have read, it ...