All Questions

Filter by
Sorted by
Tagged with
-2
votes
2answers
95 views

Best practices around writing testable extension methods

I’m currently working in C# and I’d like to write and extension method against a type. There is a small amount of repeated logic between classes surrounding JSON deserialization, using the ...
1
vote
2answers
74 views

determine correct relations in ERD - Customer Orders use case

The below ERD is taken from a professional architecture reference, however I have a concern in the relation between Customer and Invoice, I believe that relation between Customer to Order , and Order ...
1
vote
1answer
179 views

MVC-like architecture: Model-Controller communication of results/status

I'm struggling on designing a solid architecture for my project. In particular, I don't know how to handle the communication between the models and the controllers. My goals are: Following the ...
2
votes
2answers
114 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 ...
-2
votes
2answers
76 views

Should application state be tested when testing Api?

I am trying to adpot a TDD process. I am a bit confused when it comes to testing an Api. I know for sure that the status and the response should be tested. But I am thinking if whether or not I should ...
-1
votes
2answers
79 views

Nightly build, GitFlow and PR [closed]

My customer decided to have an automatic nightly build based on develop branch. We usually make a feature branch (and if it is necessary we provide a release compiled manually on that branch) and when ...
2
votes
4answers
178 views

How to refactor a lot of Functions that can be run in two different modes

I have some code and in it there are functions which can be run in one of two modes (in my case server mode and local mode). For example, most functions look something like this: def path_join(...
1
vote
0answers
81 views

(How) should I handle a consistent but unwanted aggregate state?

It's clear that an entity should never be in an inconsistent state; if a change would violate an invariant, a domain object should reject the change. But what if it's left in a valid, but ...
-3
votes
1answer
56 views

What are some best practices for team structure around Mobile and Desktop apps? [closed]

We're currently developing a product which will have a Web version and a Mobile version. At the moment, the plan is to have identical features on both of these. From a tech perspective, there is an ...
0
votes
3answers
113 views

UpCasting DownCasting vs HighLevel modules/LowLevel modules

I am confused with wording used to describe UpCasting/DownCasting compared to wording used to describe level of modules. Imagine two classes: public class Human { } public class Doctor : Human { } ...
34
votes
3answers
4k views

What is the point of repeatedly executing the same test?

I have recently learned about the not-well-known and not-widely-used annotation @RepeatedTest that, as the name implies, repeats the very same test n-times. Baeldung provides a short guide to this ...
0
votes
2answers
88 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, ...
0
votes
1answer
75 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 ...
-1
votes
1answer
125 views

Is it viable to use imprecise analog computers to simulate equally artificial intelligence?

I was searching about simulation of artificial intelligence, machine learning and subjects alike and saw the news that some startups around of the world are using analog computers to simulate ...
0
votes
1answer
52 views

Mixing server and client code in monorepo

To date, we have implemented a multi-repo approach in which each project, or for larger projects, each tier, has its own repo. Code is written in Typescript, Javascript, C#, PowerShell and T-SQL. ...
0
votes
2answers
175 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 ...
1
vote
3answers
173 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 ...
0
votes
0answers
101 views

MVC Vs Layered VS Client-Server

On this book (Ian Sommerville, Software Architecture, 10th Edition, ISBN: 9781292096131), the following architectural patterns are presented (Chapter 6, 6.3, p175): MVC Layered Client-server ...
-1
votes
1answer
99 views

How to reconcile CD with major architectural changes?

(This question is inspired by the SO blog entry Fulfilling the promise of CI/CD and this old question of mine: Why is it wrong to comment out code and then gradually remove it to keep track of what I'...
0
votes
4answers
247 views

HOWTO: Full-text search over an encrypted database?

I want to adhere to the best practices and obviously encrypt the data sent to me by user. And I also want to provide the full-text search feature to the user (user can only search their own data, if ...
2
votes
3answers
194 views

Is calling a completion handler synchronously an anti-pattern?

I have a function that performs a task which can either be performed immediately and without any blocking or it can only be performed after some delay. The caller of that function shouldn't need to ...
1
vote
2answers
160 views

Unit testing of classes with functions as parameters in C++

Let's say I have a function in a class with the following signature: int fun(int x, int y,std::function<int(int, int)> funArg) The output depends on the operations done in funArg. My question ...
0
votes
0answers
54 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 ...
1
vote
2answers
165 views

How to bump version (SemVer conform) after updating underlying database

I have a service that uses a package which is basically just a wrapper around an ElasticSearch index. I had to update the index as new data is added on a yearly basis. The source of the data needs to ...
3
votes
0answers
63 views

OAuth2 access_token for resource server in case of external identity provider

I would like to ask a question about OAuth2 with an external identity provider. Assume a scenario with the following roles: Client A, Resource Server B, Identity Provider C. Furthermore assume that ...
0
votes
2answers
50 views

What BPMN symbol should I use when a service outside wants a BPMS to run a workflow?

I want to specify in a BMPN model that a workflow starts whenever a specific service outside tells me to. What standard BPMN symbol shall I use for this? Think of it as a company wants to start a ...
0
votes
0answers
64 views

Improving performance of 'Weighted/prioritized left shuffle algorithm'

I wrote a prioritized/weighted left shuffle algorithm (the code is copied from my open source C# project Fluent Random Picker). What does that mean? You've got some values and each of them has a ...
1
vote
1answer
65 views

Who should validate the request data, controller or useCase?

I use the controller to extract data from a request and Use Cases/Interactors to validate the data. But can I use the controller to extract and validate the request data?
0
votes
0answers
14 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....
0
votes
1answer
76 views

C++ class design with shared pointers methods [closed]

I dont exactly know, how to handle the problem, where one class uses shared pointers but I want to call its method from inside other class via this pointer. class Bar { public: Bar() = default; ~...
1
vote
2answers
270 views

How to practice TDD when I constantly need to ditch my current test?

I'm learning and trying TDD recently, and I constantly encounter a situation when I need to ditch my current test because it's too broad. I don't know how to deal with it. To be more specific, let's ...
0
votes
2answers
77 views

What happens when one thread is waiting to be executed while another is waiting for input?

Suppose I have two threads, A and B. A is waiting for input, while B is waiting to be executed. All other CPU cores are busy with CPU-bound tasks. What will happen to A?
2
votes
3answers
134 views

Enforce correspondence between enum and lookup table

I have seen a common design pattern where there will be a "lookup table" in the database like this: Color ColorId ColorName 1 Blue 2 Red 3 Green with a foreign key constraint on other ...
0
votes
1answer
39 views

ER Diagram - How to display relationships between Entities that are a type of another

I face a problem in understanding how this situation can be traduced to an ER diagram. So I have an entity, let's call it car, and then, there are another entities, that are a type of car. For example,...
1
vote
1answer
100 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 ...
4
votes
1answer
126 views

One producer - multiple consumers queue, best way to guard against rare duplicates?

I have a classical one producer - multiple consumers queue, each item can be processed independently. On rare occasions (<1%) there can be multiple queue items related to the same object the ...
0
votes
0answers
26 views

Django Model Design

I am in the design phase of a project and I am having some trouble finding a solution that can perform queries efficiently with PostgreSQL backend Say, there exists an item and each item has fields ...
2
votes
1answer
67 views

Should small overhead count towards an upper memory bound or rather be ignored?

I have a memory pool class that manages memory objects of fixed sizes, a bit like a primitive malloc() that can only return memory blocks of a few predefined sizes and unlike malloc() is guaranteed to ...
1
vote
1answer
52 views

Storing large data shared between microservices running in containers at AWS

I'm dealing with an application that does the following: we have a microservice running on EKS called by jobs that pull XML data off an external system. The data volume can be fairly large (700MB-1GB ...
1
vote
1answer
89 views

How to implement visitor if not all functions are supported for each Element?

I have two Visitor classes in my code Visitor1 and Visitor2 that execute functions on the classes ElementA and ElementB (both implement the interface Visitable that defines accept(Visitor)). I do not ...
0
votes
0answers
12 views

Managing user session state with Google Sign In

I need some help with my authentication design. Happy to share any code as needed... Overview I have implemented the Google Sign-in (new web implementation here) button in my client web application. ...
0
votes
2answers
182 views

Java - Is this a good use case of Java object optimization?

I recently joined a new project that is written in java. The project has been worked on for a few years by different developers, so there are many different code styles across different classes, and ...
0
votes
1answer
38 views

Plugin system design core component access: Common practice?

I wonder how to design a good plugin architecture in C++/Qt. The main concern I have is about dependency injection vs globals when it comes to the core components. Plugins should have access to ...
-1
votes
1answer
83 views

Building a function call tree at runtime

Edit #1 I believe that I misrepresented my intent when writing this question by focusing too much on the issues that have arisen from our misuse/misunderstanding of locks. I am making this edit to try ...
0
votes
0answers
28 views

Handling logging through a java class and its dependencies

I have a method that depends on object creation from a different class, as well as some helper methods that come from a third class. The specific needs of this project mean that the logger is required ...
0
votes
0answers
50 views

Terse finite state machines in Haskell

I'm writing a parser for a markup language in haskell, and a finite state machine fell out of my ideal API. I have code that looks a bit like this: Token = BoldWord String | Word String | ...
0
votes
0answers
36 views

design for the order processing system

We have REST endpoint that that works like this Retrieve payload from request Generated unique id for payload and order_status and enrichment_status to PENDING Store payload in Redis Perform request ...
-3
votes
1answer
114 views

Most efficient way to get average data for thousands of records from the database [closed]

I have a database that keeps a temperature readouts, which are being added - let's say - every minute: +----+---------------------+-------------+-----------+ | id | timestamp | temperature | ...
0
votes
1answer
43 views

NextJs Explanation on Ecommerce and Other Project Implementation [closed]

I'm attempting to create a project to increase and enhance my coding skills, and I've lately migrated React to Nextjs. I've noticed that NextJs' main point or strength is rendering; Could someone ...
0
votes
2answers
219 views

Is there a reason to not use a guard check using params instead of singular checks?

I've been refactoring guard statements for my project to simply use a custom Ensure class with 2 methods. Some methods require multiple null checks and I implemented a guard method that simply accepts ...

15 30 50 per page
1
3 4
5
6 7
1214