All Questions
61,136
questions
0
votes
0
answers
8
views
In an "Always On" architecture, how are duplicate concurrent transactions handled?
Imagine a scenario where a gift card has been purchased with cash, the gift card is duplicated, and each card is used to purchase an iPad at a self-service counter at exactly the same time.
What are ...
0
votes
0
answers
22
views
Linux C: Using mmap and inotify: I think I'm doing something wrong
Background
I'm making some database software. This database requires several client processes to talk to the database process. This database has a feature to which the client can invoke a function ...
0
votes
0
answers
22
views
How to design a system that imports data into the system from a large amount of files
A lot of our clients migrate from their existing system to our web application. they bring in approximately 150,000 excel files which I have to first load in my database and then perform some ...
-2
votes
0
answers
25
views
When to save complex html/css/js as an image and load that instead?
I am working on building a site and have a fairly complex layout consisting of many html elements is inside of one large button. I imagine that I could just save this layout as an image and load the ...
0
votes
1
answer
38
views
How to keep attribution in version control (git) when one author moves another author's code?
Sometimes code will need to be moved. A common example is some logic that exists in a controller needs to get moved to a helper class so it can be called from outside of that controller. So someone ...
0
votes
0
answers
30
views
Are Microservices Architecture and a Single Customer View able to co-exist?
Given the microservices pattern is the decomposition of software by business capability with ownership of state, and a single customer view is an aggregated, central, "single" data store of ...
0
votes
0
answers
12
views
Best Practices to Deploy Docker on DigitalOcean using Terraform
I'm wondering if there are some best practices to deploy Docker images to Digital Ocean using Terraform.
Because I don't expect much load and don't need failover features etc. I'm not aiming to deploy ...
-4
votes
0
answers
25
views
Apply this popup feature for infinite users [closed]
I made a popup feature, which shows the phone number of a user. I was able to apply this feature to one instance. A single user.
Normally, each user has a unique phone number.
But then, I thought, ...
-1
votes
0
answers
13
views
When and how can I use an Entity created in a use case X' sequence inside another use case Y' sequence? [closed]
I have a use case X' sequence in which I create an Entity Z.
I have another use case Y' sequence where I want to use the SAME already created Entity Z.
How to do that? Do I have to specify it in some ...
-3
votes
2
answers
62
views
Which HTTP status to return if a downstream service I depend on returned 500 error
My service B is part of a chain of services and calls a downstream service C.
A --> B --> C
Service C is returning HTTP 500 errors for any error it faced, including bad requests or input ...
0
votes
3
answers
135
views
Could a language allow for persistent allocations without heap?
Is it possible in theory to have a programming language that allows for object lifetimes that exist beyond the current scope but without using heap?
As a little background, in embedded development it ...
0
votes
2
answers
113
views
Would Injecting dependencies in C# as default parameters be a bad practice?
Given the (old) debate over whether Singletons are overused/abused/are worth it - would it be a bad idea to inject the dependencies as default parameters? In this way, we could get rid of defining ...
0
votes
1
answer
82
views
Side effect as a common object seems like a bad pattern
Given an auction system, there are several ways to apply a discount to the transaction's final amount, e.g.
Special discount for a given seller
discount for a given buyer
Discount for a specific ...
2
votes
2
answers
111
views
Are there typo-tolerance algorithms (as opposed to string similarity)? [closed]
I want to build a search with basic typo tolerance.
There are quite a few string similarity algorithms (and implementations for almost all languages I guess).
However, humans tend to make some typos ...
-1
votes
0
answers
35
views
Better long-term configuration maintainability [closed]
As an experienced IT professional familiar with systems of different levels of complexity, it is relatively normal to maintain system configurations in configuration files. For installations and ...
0
votes
1
answer
77
views
How to model a ternary relationship in a graph-based paradigm?
Consider a context where we have Users saving Questions and adding personal Tags to them.
In a graph-based paradigm, a first approach could be something like:
(User)-[SAVES {tags}]->(Question)
...
1
vote
0
answers
86
views
Best way to store key-value pairs of different types in c++?
I'm reading values from a (PE) binary file. The values have a known length and position in the file and are stored with no padding (right next to each other). They store various types (int, long, ...
-1
votes
2
answers
54
views
How do I properly write these functions? [duplicate]
So far my weakest side has been proper code structuring and organization. I wanted to know how I can properly apply separation of concerns to the following code to make it more organized.
I have a ...
7
votes
2
answers
2k
views
Why is having bloated interfaces an anti pattern?
[I'm using the term interface here with C#'s interface in mind. I won't tag the question with a C# tag because it really isn't a C# question.]
In my work we do unit and integration tests but we don't ...
-3
votes
1
answer
61
views
Using two different languages where one would suffice for the task (microservices)
I previously asked this on StackOverflow, but doesn't fit there and I was suggested to move it here.
I was thinking about using two seperate backend languages for seperating concerns in a project of ...
-4
votes
0
answers
29
views
Microservices - should we avoid too much dependency between services? [closed]
When should communication between services be used to exchange information between them? Let's say we have a situation where the client sends a request to the api-gateway to create a new project in ...
0
votes
1
answer
83
views
How to establish communication between devices on separate local networks?
There is a number of devices with Internet access but they are on LANs and have no public IPs. As time goes by more devices will be added.
I need to be able to communicate with each device on demand (...
-3
votes
1
answer
83
views
How would a SRP `class Car` look like? [closed]
SRP insists that a class should have only a single a reason to change. Please guide me through the following example.
class Car
{
drive_forward();
embark();
disembark();
fuel_up();
}
...
1
vote
1
answer
51
views
PyPI Package Names Governance
The Python Package Index (PyPI) is a public repository, and it seems that anyone can upload packages to it using a tool like twine. The openness of the system raises some questions:
Say, a person/...
0
votes
2
answers
48
views
Design pattern for persistent data storage - load and save arbitrary file, database, api etc
I have the following problem - I write the code for object data manager, and one of requirements is being able to save/load data into some persistent data storage. I want to make it as the following:
...
-3
votes
0
answers
30
views
Question on Data Structure [closed]
How to construct a Binary Search Tree from an In-order traversal of a Binary tree?
For example the numbers below
2,11,20,24,33,56,80.
My problem is to determine which of the numbers should be the root ...
0
votes
2
answers
109
views
What does "legacy signature" mean?
I see the term legacy signature a lot in the documentation of programming languages. For example in the php documentation :
Passing the separator after the array (i.e. using the legacy signature) ...
0
votes
2
answers
66
views
What is the best practice for BDD?
The web application I am working on is currently (partially) tested automatically.
All scenarios are hardcoded in custom code in this way :
WebElement bt = findButtonWithLabel("foo")
bt....
0
votes
0
answers
34
views
Is splitting Android activities/classes into many Kotlin extension functions a good or bad practise?
I have been working on an Android application for some time, and ever since the beginning I've developed a practice of splitting my class's (mostly activity/fragment) code up into multiple files.
This ...
-3
votes
1
answer
57
views
Technical Debt in frontend development [closed]
I have recently joined in a new company as a frontend developer and I got access to their current repository which is made in ReactJS. I can see that current team is not very experienced in reactJS ...
0
votes
0
answers
13
views
What is the right way to update claims in identity-server 4 from Angular
I have a multitenant application where a user can belong to multiple tenants. I'm using Identity-Server 4 for the authentication.
I have two applications Angular and API. When a user is not ...
0
votes
2
answers
34
views
Use case diagram question confusion
For this question we got for a mock test we did and I have put the correct options in bold
Consider the following use case diagram, is it correct to state that:
a. Customer directly interacts with ...
-1
votes
0
answers
32
views
Alternative design pattern to a method containing a lot of methods? [duplicate]
I have a method in a class that takes in some variables and then runs a series of other methods in a pre-defined sequence. Below is a simplistic example:
class MyClass:
def ...
-1
votes
0
answers
30
views
Licensing scenario question
Problem:
I have an API that lives in my organizations tenant. We use scopes and roles through Azure AD to authorize our API endpoints. These scopes and roles are assigned in our clients app ...
0
votes
1
answer
58
views
is there a two-way (bidirectional) observer pattern?
I have two classes. "System" and "Bluetooth". I want to have a really loose coherency between these two classes as they should be able to exist or not without depending on each ...
0
votes
0
answers
24
views
Validation in both controller and my service classes?
I use the Laravel framework.
I've got controllers, like CustomerActivityController, and I've got a service layer with services like CustomerActivityService.
Say I want to create a new customer ...
0
votes
2
answers
82
views
Why should I use an ORM like Entity Framework Core?
I have taken over the maintenance and development of a mature .NET Framework ASP.NET MVC application which uses an Entity Framework repository pattern. Several developers have worked on it before me ...
-1
votes
0
answers
61
views
What is the origin of #pragma once? [closed]
Although not part of the C/C++ standard, #pragma once is widely used in place of include guards. I personally find it to be a great feature (for how it prevents nasty copy-paste errors between headers,...
11
votes
4
answers
2k
views
Should we abandon the "if not null" pattern?
I've seen that with the Dictionary API now has methods with bool TryGetValue<TKey, TValue>(TKey key, out TValue value) and I like this kind of methods because they're signaling to the other devs ...
0
votes
1
answer
61
views
In a microservice architecture, can individual microservices contain any configuration file? Is keeping a small config a good practice?
I thought, In a microservice architecture, only the "Configuration Server" will be responsible for providing configuration to individual microservices even if it's a small config. So that we ...
-4
votes
0
answers
25
views
How does algolia work? [closed]
Algolia is a full text search engine and Saas provider with a pay as you go pricing model.
I have used a lot of databases before and one of the main challenges with databases are how to create indexes:...
-2
votes
1
answer
70
views
Best way of handling concurrent requests
I am working on an Authentication system (java based) that will authenticate users and create a session for them. This session is valid for 5 hours. I do not want the same user to have multiple ...
-4
votes
0
answers
39
views
How do you manage "technical users" in your software/platform?
I tried to look for some tips regarding my question but couldn't find anything so decided to post it here :)
In my product I currently have 2 types of users:
end-users who are humans using the ...
-3
votes
0
answers
46
views
How do services validate incoming emails [closed]
I am setting up and programming an email service which can both send and receive emails; except I am wondering what steps I should take in order to validate incoming emails. As many of you probably ...
0
votes
0
answers
8
views
Keycloak duplicate registration page
I have a case where I need to separate the users by type in Keycloak.Basiacally the entire application is separated by two user types. For the purposes of the example let's say a seller and a buyer. ...
-2
votes
0
answers
28
views
What's the best way to aggregate data in a micro service architecture?
Imagine you have something like a BFF (Backend for frontend) that holds many entities coming from different microservices. Those entities don't have any foreign key constraints because each entity is ...
-1
votes
1
answer
32
views
How to handle config/env vars in a library project
I am building a new Python library project to be consumed by several of my application projects. The existing code consumes environment variables for various configuration settings. Should my ...
-3
votes
2
answers
59
views
best practice to recover or handle a request that is half completed or partially failed [closed]
Assume I have a request:
app.post('/order', ()=>{
// task 1
// task 2
// task 3
})
and task1 and task2 is completed but task3 failed.
for example a user paid order successfully but saving order ...
-1
votes
0
answers
25
views
Software testing single node B-TREE [closed]
I am trying to solve this question about testing in software systems, can anybody help? Thanks.:
And this is control flow graph for B-TREE:
B-Tree algorithm of flow graph:
1
vote
2
answers
63
views
Calculate operation time and setuptime or costprice based on a variable set of parameters - Design Pattern?
I work in a production company where my colleagues calculate costprices based on 3D models and their respective operations. Apart from workactivities where a user has to insert an operation time and ...