All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
93 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
5 votes
5 answers
390 views

Should an optional boolean function argument rather default to true or false?

In many cases I can formulate some boolean parameter equally well positively as negatively, e.g. isOn or isOff. Which one should I pick then, in case I want the argument to have a default value? Is ...
  • 1,386
0 votes
1 answer
62 views

Middleware with parameters and dependencies

I'm trying to use the middleware pattern to avoid repeating same code over and over again. In my application I work with user data a lot, therefore there are a lot of checks here and there. The ...
  • 3
0 votes
2 answers
86 views

Inheritance/Composition VS "Direct Injection Construction"

my following example seems to go into the direction Inheritance VS Composition. But that's not, what i want to ask. I see the concept Inheritance and Composition on one side and the alternative, which ...
0 votes
2 answers
83 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 ...
0 votes
4 answers
201 views

Is API exactly the same as header file?

I am trying to understand the difference between an Application Programming Interface and a Library and I stumbled upon this question: https://stackoverflow.com/questions/3678665/is-there-still-a-...
  • 149
20 votes
4 answers
4k views

How do non-RAII languages free resources during stack unwinding?

C++ features deterministic order of calling destructors up the call stack until the exception is handled somewhere. To my knowledge, neither Java nor (object oriented) Python provide this. In those ...
  • 6,955
0 votes
0 answers
30 views

Is it preferable to embed ".qm" translation files with Qt Resource System or bundling it with PyInstaller?

I'm learning PyInstaller for deploying Python applications, more specifically, applications developed with PyQt5. As far as I understand, it's possible to bundle application data (or "resources&...
6 votes
2 answers
447 views

How do I choose a versioning scheme when Semantic Versioning (SemVer) isn't appropriate?

All too often, I see people people pointing out flaws in Semantic Versioning (SemVer), or pointing out that it doesn't apply to huge categories of software. (See quotes below). In particular, SemVer ...
  • 1,342
2 votes
2 answers
119 views

the actual notion of an integration and end to end testing

I want to know how rigid do we have to stick to the notion of end to end testing, please consider the following explanation: Basically, when we talk about end to end test we send a request and expect ...
  • 37
-2 votes
0 answers
26 views

Considerations when invoking CLI to process web requests

What are the ramifications of invoking a CLI command on a server to process a HTTP restful web request, and sending back the results from stdout as the response? Are there any scalability and security ...
  • 107
2 votes
2 answers
113 views

Git flow for multiservice monorepo

My project is a monorepo where the top level directory contains build infrastructure and a set of project directories for different services. Each service has its own branch of development. The ...
0 votes
3 answers
112 views

Is it possible to instantiate a template class at runtime?

Suppose I have two abstract classes called Color and Animal And I can create classes Green/Red/Blue derived from Color and classes Dog/Cat/Pig derived from Animal at runtime using factory pattern. ...
0 votes
1 answer
68 views

How to design an ever evolving entity while offering backward compatibility

I have a website which lists expenses filtered by year and allows for editing. Over the years, the expense entity evolved. Some properties were removed and some properties were added. If you go back ...
  • 109
0 votes
0 answers
24 views

Long polling and resource use

I've been looking at various techniques for pushing data from a server to a Flutter Web app, and Websockets and SSE (Server-Sent Events) are unfortunately out of the question. So, I thought about ...
  • 405
4 votes
5 answers
191 views

When mocking a class in a unit test, how should I handle dependency classes that have multiple similar get methods?

Let's say there's a class that processes text, and it gets that text from another class as a buffer. If this buffer class has multiple get methods, like readLine(), readChar(), readCharCode(), how ...
  • 41
8 votes
9 answers
698 views

Can you have too much unit test coverage?

Google tells me that the ideal unit test coverage is 70 - 80% (although Google's source for that doesn't look especially credible). This old post suggests that in fact it depends on what gives you ...
2 votes
2 answers
126 views

To maintain SOLID, should data preparation, conversion, and pre-computation for purposes of saving an object, be separate from data persistence layer?

I am facing a common situation where I am saving some values into database from a business object. I am using a relational database and usually I only need to save a few items that are part of the ...
  • 8,059
0 votes
3 answers
131 views

Java Library - How to do Pure Dependency Injection When State is a Factor?

To set the stage, I am trying to do pure dependency injection for a Java Library I am creating to make it more testable. As it is a library, I want to do pure dependency injection without creating a ...
0 votes
3 answers
169 views

Optimizing a string to enum converter [closed]

I have built a string to enum converter, which converts a known set of strings that it receives into enum, in order to satisfy a function pointer. Some of you may recognize some elements of this ...
0 votes
0 answers
54 views

What is the best way to design endpoints for a restful application?

I am a backend developer and I am writing a restful application. I have a question about how best to design the endpoints. I have a database table that stores values (I just provided an example) |id (...
0 votes
1 answer
62 views

Data backup/slave node with replicated data, to be writeable while master is offline

I'm developing and designing a system which runs mostly on intranet of client companies. The system consists of one main database which is MariDB, for now one web-application as system management and ...
  • 11
14 votes
5 answers
5k views

How can I efficiently diff a CSV file against a database?

I have an inventory of products stored in Postgres. I need to be able to take a CSV file and get a list of changes—the things in the CSV file that are different to what is in the database. The CSV ...
  • 610
0 votes
0 answers
53 views

How to store multiple-users authorization tokens from a single service if I can't use a persistent storage?

I'm new to "web development" so I don't know much about ways to store data. I'm trying to build a web app using Python-Django which accesses private data from multiple accounts. The data ...
0 votes
0 answers
38 views

microservice separate data server auth server an website

I have an API server related to users and employees data with database. There is another API server for users authentication. The last one is website client UI with social providers to authenticate ...
3 votes
5 answers
2k views

Alternatives to if-else on data reading

I have some code on Arduino (so, written in C++) that receives a String through the UART terminal, reads the String, then decides what String to print back and how many things to print depending on ...
-5 votes
1 answer
72 views

What is the lib/ or library/ directory for? [closed]

I'm considering having a lib/ directory in my source code. From what I understand it's basically a junk draw where all the code lives which isn't view related? It seems like a very generic name to me. ...
0 votes
2 answers
157 views

Why session should be a param when you write a query function?

I read a lot of examples where I read code like this: def get_user_by_id(session, id) ... and the function that calls that function needs to create or get the DB session a pass to the function. the ...
  • 387
0 votes
3 answers
214 views

Design pattern for feature toggling

To simplify the domain let's say we have a system that takes in orders from customers. There's an API endpoint that validates the input, and if valid pushes the order onto a messaging queue to be ...
  • 129
0 votes
1 answer
177 views

Branch management when you cannot merge due to holidays

I’m working on a small project with two other developers. Our work is on Gitlab. Our general workflow is that we create feature branches by branching off development which get merged back into ...
4 votes
3 answers
304 views

What to name a POST endpoint that behaves like GET?

My app has an API endpoint GET /sessions/{id} which gets info about a session. This endpoint returns a lot of data, so we allow passing JSON in the request body to filter what fields etc. are ...
  • 53
0 votes
1 answer
46 views

Is there a standard for describing information about Java Beans (Bean Introspections)

In many situations we need access to meta information about Java Beans. The Java Reflection API itsself does not work for projects were performance matters so the bigger Frameworks like Spring or ...
  • 207
0 votes
1 answer
75 views

am I understanding MVVM correctly? [duplicate]

ViewModel has Two-way data binding with UI which means UI can access the data from ViewModel and can update the view models data. The Model has one-way data binding and is only supposed to respond ...
  • 9
2 votes
2 answers
131 views

How would I use TDD / BDD when my webapp interacts with an external REST API?

I'm following roughly the TDD style as explained in the "Obey the Testing Goat" book: You have a functional test for your (Django, in my case) web app that tests the observable behaviour via ...
  • 516
0 votes
1 answer
125 views

Correct IHttpClientFactory implementation with dependency injection?

In Microsoft's documentation, in the Named Clients example, they retrieve an HttpClient from the IoC container: var httpClient = _httpClientFactory.CreateClient("GitHub"); In the Typed ...
0 votes
1 answer
59 views

API Routes: Get App by User or Get User's App

We have a .Net WebApi 2 we've been working on for quite some time. As we refactor code, we started thinking of what might be a better practice: a) "to get an app by userid", or b) "to ...
  • 119
8 votes
4 answers
768 views

How do I handle malformed compressed input data, which crashes external library?

I have a java application, which recieves compressed files as input. The application then reads the header information of said files and passes the compressed bytes to an external native library for ...
  • 219
0 votes
0 answers
33 views

Restricting access to resources by source and destination IP

Forgive me if this is the wrong place to ask such questions - I am still extremely new to this field and am not even sure where the most appropriate place to look for answers is. Question: Assume I ...
0 votes
3 answers
166 views

Is It Considered Good Practice to Use Dependency Injection with Strategies from a NuGet Package?

I am developing a NuGet package which contains shared code for various ASP.NET Core projects. I am planning to use the strategy pattern to solve the same problem in a few different ways. So there will ...
  • 151
-3 votes
2 answers
78 views

Coding style for a micro-service across organisation [closed]

Background/Context: A big organisation has several departments, those departments have several business units and those business units are divided into domain teams. Assuming domain teams are atomic ...
0 votes
1 answer
75 views

Approaches to 'promoting' release candidates in Java projects

Is there a standard procedure for producing some jars, having them tested downstream, and then promoting these jars to the actual release? By promotion I really mean taking already publish artefacts ...
-1 votes
2 answers
69 views

Rapid rate of merging new code with minimal testing [closed]

In some companies, code is merged at a rapid rate by multiple teams with minimal testing and somehow the number of bugs is kept to a minimum. In other companies, this leads to chaos and terrible ...
  • 7
-4 votes
2 answers
83 views

Does Jenkins essentially function like a package manager for your software product?

I'm a relatively new IT Ops guy in a software (web) development company. Recently I deployed a virtual machine on OpenStack, because some developer needs it, and then I installed their application (...
  • 149
5 votes
3 answers
251 views

How does a JIT compiler actually emit and then call the emitted native code?

Assuming that a VM runs a JIT compiler on otherwise "interpreted" code, such as a line by line interpreter or some form of bytecode/IL code and determines that it can create optimised native ...
  • 1,277
3 votes
1 answer
76 views

High level abstraction of file scanning service in domain driven design, and the implementations

My domain requires that a Resource (ubiquitous language for a singular unit of data to be moved - commonly a file or folder) can only be moved if it has been Scanned to ensure it does not contain any ...
0 votes
1 answer
39 views

Spring Boot - How to return mocked data based on spring profile

I have a Spring Boot REST API application that uses different profiles like dev, test, prod, etc It also makes a call to another API to retrieve some data like: Client ---> MYAPI ---> ...
  • 119
0 votes
1 answer
127 views

SQL databases - what will happen if dozen of users edit the same record at the same time?

I know that we have the functionality to lock records or setting isolation level, but this is not my question. By default if dozen/hundred of users edit the same record at the exact same time what ...
42 votes
5 answers
8k views

What is the significance of reaching major version 1.0.0?

I have seen many open source projects being labelled as "not production ready" because they have not reached a major version e.g. 1.0.0 using semver. What is the significance of reaching ...
  • 555
3 votes
4 answers
136 views

Composite ID in hierarchical REST API

Suppose the following: Building has 0...n Rooms, Room has 0...n Seats. I am implementing a REST API which accepts data from different companies, with the caveat that the companies must be able ...
  • 147
-1 votes
4 answers
199 views

Best practice for knowing the link between binaries (*.exe and *.dll) and their source code?

I'm working in a company, where we work with a kind of plug-and-play system: An executable is put inside a central directory, and there is a Modules directory, where DLL files can be inserted, which ...
  • 1,683

15 30 50 per page