All Questions

Filter by
Sorted by
Tagged with
8
votes
5answers
1k views

When should we use dependency injection (C#) [closed]

I would like to be sure I understand the concept of dependency injection (DI). Well, I actually understand the concept, DI is not complicated: you create an interface then you pass the implementation ...
1
vote
4answers
160 views

Dependency injection / testability - would this logic be appropriate?

In a testability perspective, would this logic be appropriate? public class Foo { public List<SomeClass> Elements {get; set;} public Foo(IServiceInterface service) { this....
-1
votes
3answers
169 views

Is it ok to have a class contain a list of its parent object?

I'm working on a software in which the client wants the admin to have all the rights to view and update the info of other employees. The admin is an employee itself so this is what I've come up with ...
1
vote
1answer
121 views

Do complex return types in interfaces exist in programming?

I believe, for PHP, that I've found the worst culprit when it comes to bad code: not being able to declare (return) implementation details through interfaces. This makes it unpredictable to see what ...
3
votes
2answers
161 views

When to use an associative table instead of 1 foreign key?

There are plenty of examples of both associative table and one foreign key designs out there, but I can't find clear any explanation of when should each of them be preferred. For example let's assume ...
0
votes
1answer
77 views

Branching strategy with GitHub releases

I am working on the project where currently we have following three fixed branches Develop - The code is deployed to development environment. It's a base branch for anyone who want to add new ...
0
votes
0answers
33 views

Would it be reasonable to use the HTML Canvas as a render solution for a app on mobile?

This is my first post on this community, so let me know if I need to elaborate. I am making a motion graphics app on mobile (think After Effects for iOS), and was wondering if it would be viable to ...
4
votes
2answers
175 views

CQRS sequential numbering of business documents

I am currently building a microservice-based system to learn CQRS/ES, Docker, AMQP and all the other goodies that goes with it. I have never asked a question online before as I am usually pretty good ...
-1
votes
2answers
108 views

What does a proper server response look like? [closed]

tl;dr Which is the best server response for an endpoint to get a user's age? 30 or {"age":30} or {"metadata":{"time":1561919615,"status":200},"age":30} or something else? I am writing a server using ...
-1
votes
1answer
44 views

Buffer Overflows and Out-of-bounds Writes [closed]

What is the difference between buffer overflows and out-of-bounds writes? Are buffer overflows a kind of out-of-bounds writes?
0
votes
0answers
22 views

Building an API for long distance customers with IOS App, single or multiple calls?

I am in the process of building an API in Laravel and my server is currently stored in the UK. Now I have read some of the posts relating to this topic on Stack but I am still a little unsure as to ...
-3
votes
1answer
145 views

What is the O of this operation?

Say for a given positive integer number n, you have to find a level k so that 1 + 2 + 3 + ... + k = S is below or equals n but S + k + 1 is above n. For example in python: def find_level(n): ...
1
vote
2answers
144 views

What is the word for when an object/function/module has too many dependents? [closed]

Suppose I have a function (or object or module) that is imported by 100 files, and that making a change in the function will affect all these 100 things that depends on it, possibly breaking them. ...
1
vote
3answers
341 views

Why shouldn't I create a class for every property?

In a particular program I had written, I noticed I had a few classes with this pattern: class IdObject: '''Objects with generated id properties''' def __init__(self, id_generator): ...
5
votes
4answers
405 views

When building time takes so long, how to improve engineer's efficiency?

The project is using C++ and the code takes around half an hour to build on a 32 core box. That time can be longer, e.g. 1 hour+ on a developer's local machine. I notice the efficiency is low when ...
0
votes
3answers
178 views

Dependecy Injection vs Singleton Pattern

I just read documentation and tutorial about dependency injection (DI) and the singleton pattern (SP). Everybody seems to says DP is bad and DI is the way to do it. Tutorials about dependency ...
0
votes
0answers
56 views

Business logic in a stateless backend when frontend already has all the data

I have a frontend application, that only knows about and communicates with a single backend service. This backend service serves only this frontend app and no-one else. Backend is completely stateless,...
0
votes
1answer
50 views

How to handle inherited roles in user stories?

I'm having struggles how dealing with inherited roles. Here is an example : As an admin, I want to do something 1 As an admin, I want to do something 2 As a super admin, I want to do something 3 So ...
0
votes
0answers
13 views

how to work with variable data structures and templates

I need users to be able to create an organization which will have some preset fields such as Name, Address, and Type. But depending on the type, the organization can have type-specific fields such as ...
0
votes
0answers
11 views

Separate Azure B2C for each App

On azure, I use resource group to consolidate an app resources. So I have multiple resource groups containing what are necessary to run an app. When creating a new Azure AD B2C, it starts fresh with ...
1
vote
1answer
26 views

How to categorize configuration changes in semantic commit messages

I am trying to switch to semantic commit messages for project. While the idea is good, sometimes I find it is difficult to properly categorize changes like a configuration value change. If I commit a ...
0
votes
0answers
21 views

Put a federation account system or account credential synchronization

We want to put in place a regional saling system for a chain store. A local independant store already have a saling website in place. One of our problem is to identify a user with his already known ...
3
votes
2answers
76 views

Why create CSS classes named to match one specific style? (non-semantic class names)

There are a number of CSS frameworks that have a one-to-one correspondence between many of the classes and a single style. For example, in basscss ".inline-block" is defined as "display: inline-block;...
1
vote
3answers
159 views

Should business logic be in the app or in the backend?

I've recently started applying the Clean Architecture while developing an Android application. And so I divided my application in 4 different parts. Data layer Contains the implementation of ...
0
votes
0answers
22 views

Design pattern that can be used for checking and handling a change in version number for incoming JSON message into data stream?

I have a Spark Streaming Job which processes messages coming from Kafka. My incoming json that I process sort of looks like {"sv" : 1.0, "field1" : "some data"} The only thing I do is put these in ...
0
votes
0answers
40 views

Jenkins Docker image, to use bind mounts or not?

I am reading through this bit of the Jenkins Docker README and there seems to be a section that contradicts itself from my current understanding. https://github.com/jenkinsci/docker/blob/master/README....
0
votes
0answers
37 views

How do you expose the field that caused the error?

Context: field errors Given an input in the form: { "list": [ { "username": null }, { "username": "test" }, { "username": "" } ] } Some APIs expose errors in the ...
0
votes
3answers
71 views

Unit Tests vs System Tests

I've always know Unit Tests to be something you do in code. You write functions to test other functions. Our team has been working with the same project manager for a while now and he's always ...
0
votes
0answers
26 views

How to hanlde changing plans in a SaaS

I am working on a SaaS product that I intend to have multiple plans for, I will have a limit of 50 of item A example and then a per user cust where I will have a base plan of 3 users. I'm building ...
1
vote
7answers
422 views

Is the sum or subtraction of two positive machine numbers exact?

If you have two positive numbers that can be represented exactly by the finite arithmetic of your computer, that is, two machine numbers, if you perform their sum or subtraction with perfect ...
1
vote
1answer
67 views

How to handle API token(s) that expires after time

I'm currently building a facade that's supposed to be in front of a system we are currently using. This system has its own API, but we have decided to simplfy things, and therefore the facade. ...
1
vote
1answer
133 views

Where to commit small, miscellaneous changes

Let's assume that I am working on a small project that uses feature branches to organize tasks. For example, feature/login would be for working on the login functionality and feature/create-new-post ...
0
votes
2answers
116 views

SRP violation confusion based on examples

I am trying to gain better understanding on SRP and when I was checking out a Pluralsight video by Scott Allen, I saw code like this: https://github.com/OdeToCode/cs-fundamentals/blob/master/src/...
-1
votes
0answers
71 views

ASP.NET Web API map a custome exception to a HTTP error code [migrated]

This question is about software development methods and good practices and architecture I'm working on a Web API in C# using Web API MVC. Here is a sample of one of my controller: public class ...
0
votes
2answers
94 views

Ensure unicity of a 10 characters alphanumeric String

I have a requirement of developing a service that must generate each day few millions of random and unique alphanumeric String of length 10 (I can't increase this length, this is a customer ...
1
vote
1answer
41 views

Front-end supporting multiple back-end versions - Maintaining backward compatibility

I know it's a broad question so I'll try to be as specific as possible. This question is probably as much an "organisational" question as a technical one. Our company is selling our software/platform ...
0
votes
0answers
7 views

Azure Service Bus Topics - Is Orchestration Needed?

We have a business process that does classic shopping/ordering. It's tightly coupled right now and does things like this: A person can view inventory. A person can create an order. An order needs to ...
-1
votes
1answer
16 views

Adding resources to subresource REST API

I'm trying to build an web API that closely represents a library of books. I currently have the following routes. GET /api/books GET /api/books/:bookID GET /api/libraries POST /api/libraries This ...
0
votes
0answers
32 views

Which components of an HTML Element, can I assume will be static over the course of its lifetime?

This is a question for people who are familiar with how HTML typically is built and behaves on webpages. Backstory and requirements I am building an HTML tracker with a C++/Qt backend. I am trying ...
0
votes
1answer
46 views

How can an event subscriber catch up with missed events?

At a conceptual level, what ways can a subscriber catch up with events it has potentially missed but needs to know about at a later time. For example, a service is running and subscribes to events on ...
0
votes
1answer
69 views

Creation of aggregate root that contains references to other aggregate roots

I would like to model the following entities: "Person", "Company" and the aggregate that ties the two together "Membership". I have identified that Person and Company are aggregate roots. Thus, "...
1
vote
1answer
81 views

Classes with lots of injected dependencies [closed]

I'm often finding that my classes end up with many (10-15) dependencies being injected. I realise there is no hard and fast rule, but someone once told me that more than 4 or 5 can be a code smell. ...
0
votes
1answer
93 views

Avoid too much dependencies for a Use Case in a Clean Architecture app

Context I'm currently developing an application following the Clean Architecture principles (at least I'm trying really hard to follow these). All my Dependency Injections are done manually, without ...
2
votes
3answers
97 views

Doubt about package-by-feature and circular dependencies

I am implementing a library that: Takes some input data (I put data structures and classes in the parsing package) Stores the data in a structure (I put data structures and classes in the storage ...
0
votes
0answers
37 views

How should the interaction between the MIS instances of a large system happen?

Overall situations: The plan was to build a large system (Management Information System or MIS type) to be used throughout the country, by say 100,000 users daily. The team decided to split that into ...
1
vote
0answers
86 views

SOLID Principles and writing clean code. Am I wrong? [duplicate]

I really need some advice as I've recently come into a conflict over a difference of opinion on the SOLID principles and writing clean code. One of our, relatively new developers but senior, does not ...
0
votes
0answers
28 views

Recommendation for user synchronization between organization and external website

We are building a small social media platform for collaboration among a group of similar (but disparate) organizations. Each organization will have a small group of users who will be able to post ...
0
votes
1answer
177 views

Dependency injection: Is there a better way than new A(new B(new C ()))? [closed]

I'm just learning about dependency injection. Unfortunately, I don't have the luxury and time to learn a DI framework right now so I am attempting to do DI through some simple means. Say I have an ...
0
votes
1answer
63 views

Parsing and validation of a csv file

I am trying to create a library where I need to validate and parse a file in a CSV-like format and then use this data to generate a Tree data structure. At the moment I split the process into two ...
-2
votes
2answers
70 views

How do I model all the different states of a widget for testing?

Say I am a QA person so I have no control over the complexity of the code in the following example. I have a datatable widget with many different filtering and searching options. All the columns on ...

15 30 50 per page