All Questions

0
votes
1answer
21 views

Protobuf: compile specification once, use generated code everywhere?

Once written, a protobuf specification can be compiled using protoc to a variety of implementations in different languages (e.g. python, c++, go). That's great. But to compile that generated code, you ...
0
votes
0answers
7 views

How to split my product into multiple variants

I have a product which is a combination of mobile apps and webapi . I am working web API. The webapi part created earlier and it build with layered model. Even thought this does not have business ...
0
votes
1answer
20 views

Dependency injection - how can I design this situation with one composition root?

There is this article that says: A Composition Root is a (preferably) unique location in an application where modules are composed together. Only applications should have Composition Roots. ...
0
votes
2answers
74 views

How do you deal with comprehending abstraction in code?

When looking at a new codebase I like to start from a bottom-up approach. Where I comprehend one file and then move up to the next abstraction. But often times I find myself forgetting what the ...
0
votes
0answers
22 views

Extends for feature (aka mix-in) in Scala is bad practice, isn't it?

In Scala, sometimes class extends a trait to provide some methods to inside extending class. ScalaTest import org.scalatest._ class ExampleSpec extends FlatSpec with Matchers { ... Matchers trait ...
0
votes
1answer
35 views

Can a bounded context be made up of other bounded contexts?

I am arguing with co worker that a bounded context can be made of other bounded contexts. My example is: I am having a tour context made out of flight bounded context hotel bounded context visa ...
0
votes
2answers
249 views

How to make method calls more generic when dealing with multiple class types?

I have a loader class that executes data loading functions at boot-time for my application to give me test data. The idea is pretty simple, I'm reading in XML data, using JaxB to turn it into a POJO ...
0
votes
0answers
7 views

Using the adapter design pattern for a news application microservice

I am currently developing the backend for a news application, which fetches news from various aggregators (e.g. Feedly). I thought this qualified as a good use case for the adapter design pattern, so ...
1
vote
2answers
82 views

The best practice for writing of examples

I have written some projects. I try to annotate or comment all possible (hard to say if correctly toward clean explaining). I would like to write documentation for it, but I have problem with ...
4
votes
7answers
137 views

Unit test which asserts that current thread is the main thread

The question is does it make sense to write a unit test which asserts that the current thread is the main thread? Pros/cons? Recently I've seen the unit test which asserts the current thread for the ...
-2
votes
1answer
16 views

How to organize my test functions?

I'm writing a software application of a few thousand lines of code (in Python), and in order to keep the whole thing together, slowly but certainly the need for unit tests (and later, other types of ...
4
votes
1answer
360 views

Why do we imlpement the Command design pattern like this?

I trying to learn the Command design pattern, I already know how it works and where it is used, but I'm a little bit confused about the implementation. So I know we need to set the context by ...
0
votes
1answer
202 views

`set-then-get` vs `get-then-set` in context of race condition?

I have recently came across approaches to set-then-get and get-then-set in context of race condition in multithreading. My understanding :- set-then-get is the same approached in java concurrent ...
0
votes
1answer
148 views

Organizing reducers in Redux

I will use the following popular todo list example for demonstration. Let's say I wanted to create a very basic todo list with this structure as the app state: { todos: { todoKey1: { ...
1
vote
3answers
57 views

How to validate command before executing on aggregate when validation needs to query data?

In a DDD designed application with CQRS principle how do we handle the case when a command needs to be validated before it is executed on an aggregate and the validation needs to query the existing ...
1
vote
3answers
50 views

Class methods that are never called and everything handled by the internals of the class itself

I have a class in my code and I'm not sure if the design I've implemented is correct or if there is a better way to do it. The class I have created have important useful methods that is used by each ...
1
vote
1answer
274 views

Would onpushstate be an anti-pattern?

In Single Page Applications, it's common to update the URL when navigating, and re-render based on the new URL. This can happen when the user hits the back and forward button, clicks on an anchor tag, ...
1
vote
1answer
32 views

how to maintain settings across different repositories

So I have .eslint and .settings (VSCode) files that I would like to be consistent across projects. How would I do this? Currently, I am thinking that I should put them into a repository, which then I ...
6
votes
3answers
3k views

Nearest color algorithm using Hex Triplet

Wikipedia has a list of colors that I am using for a basis of color names. I want to find the nearest named color given an arbitrary RGB value. For example #5D8AA8 hex triplet is "Air Force Blue". ...
0
votes
3answers
187 views

Development Of Scriptable Webpage Served As XML And Parsed As HTML

In short, this question is about the cross-browser-compatibility-ness of a way to serve a HTML page as XML. I am interested in serving a web page as XML to be interpreted as HTML for increased CSS ...
0
votes
0answers
13 views

Dictionary Coding for OLAP

Let's say we have a generic table like below: id, name, price, quantity 20 product_x 5,00 100 20 product_y 5,00 100 20 ...
15
votes
1answer
689 views

Why prefer sizeof(element) over sizeof(TYPE) for calculating the number of elements in an array?

I'm reading "King K.N's C programming" and found the following statement: We discussed using the expression sizeof(a)/sizeof(a[0]) to calculate the number of elements in an array. The expression ...
5
votes
1answer
8k views

What does it mean for an algorithm to converge?

I keep coming across this term when reading about reinforcement learning, for example in this sentence: If the problem is modelled with care, some Reinforcement Learning algorithms can converge to ...
0
votes
1answer
25 views

Where to apply multi-tenant logic (ASP.Net Core)?

I'm developing a multi-teant SaaS application in ASP.NET core mvc and I was wondering what the general approach is to applying tenant logic in a shared database scenario (TenantId for each entity). ...
3
votes
2answers
570 views

Best way to structure many-to-one allocation of users to projects in NoSQL

I apologise if this is a bit of a stupid or broad question, but I'd like some general feedback please! Say I have this DB structure for users (in Mongo/JS, but really it's all pseudocode- and the IDs ...
1
vote
1answer
69 views

Data Integration Design Using Microsoft SSIS

I am working on a data integration project, where I need to extract data from oracle source and load it to XML file. The requirement is to get the list of customers and foreach customer create an xml ...
-3
votes
0answers
13 views

Sharing a ReactJS component privately with others in the same Team

I just created a ReactJS component which consists basically of 2 files: /path/to/components/FancyTextInput/FancyTextInput.js /path/to/components/FancyTextInput/FancyTextInput.scss FancyTextInput.js ...
0
votes
1answer
72 views

RabbitMQ: how to achieve scalable one-to-one communication?

I'm trying to use RabbitMQ for two-way one-to-one communication between clients and servers. So, Client 1 should be able to communicate only with Server 1, and vice versa: The servers stay always ...
38
votes
18answers
22k views

What should be the maximum length of a function? [closed]

What should be the maximum length of a function? And are there cases which are an exception to this?
0
votes
0answers
14 views

Separate bounded context or not? Employee will have an Account

In Vaugh Vernon's book "Implementing Domain Driven Design", the team separated the Identity and Access from Collaboration context because the team realized they are being stuck on the "role-based" ...
2
votes
4answers
89 views

Putting extra code review burden on team because of refactoring

I am reading Refactoring by Martin Fowler, and working in the patterns suggested into my coding. This has caused me to put up two code reviews for my service which are significantly lengthy, which are ...
1
vote
1answer
65 views

How to test customer journey with mostly the same structure

I often hear that a test should contain only one assertion (Disregarding testing attributes of a class) and where the whole pre-conditions for the test should be setup before the assertion. In our ...
0
votes
2answers
29 views

Logic to create/update values while maintaining their uniqueness (in a multi-threaded environment)

Assume I have a dumb repository which stores numbers (for sake of this example). It is dumb because it may only create new record, update specified record and list all the existing records - no other ...
0
votes
2answers
57 views

How to scale horizontally a microservice that holds a database

Imagine a 'User' microservice that holds all user's related logic, and this microservice holds a database. How could you scale this microservice horizontally and keep consistency ? In fact, if you ...
1
vote
1answer
17 views

Listing all sub-resources without parent scope

Let's say I have User resource which has Address sub-resource (let's forget about why this is a resource instead of attribute). To get a user's address, I can do GET /users/{id}/address Now I want to ...
1
vote
3answers
162 views

What are the risks of having a release branch?

Currently we manage our source code in a Microsoft Team Foundation Server project. We have the following branches: Development Feature 1 Feature 2 Etc. Test The process is that development is ...
2
votes
1answer
47 views

Why doesn't Python3 optimise variables assignments

I just read this SE question about parameter optimisation. I wondered if Python3 bytecode compilation does the same optimisation and this appeared not to be the case: >>> def f(a): return 2*...
1
vote
3answers
48 views

Is it a good idea to share repositories across microservices in Spring Boot Application?

We are migrating a desktop application into web based Spring Boot micro services application with a client imposed mandate of using their existing MySQL database, so all micro services share a common ...
0
votes
1answer
40 views

Pseudo-Factory Abstract Class

So I have a requirement for something like this: The client shouldn't be aware of how the actual classes are implemented or constructed. The classes implement a common interface So I used Factory ...
-5
votes
0answers
15 views

User management for a web portal with few applications

My company provides our clients a web portal where some applications are gathered. For now we just include applications developped by us, but we are in the process of including some other tools (third ...
28
votes
10answers
4k views

Simple vs Complex (but performance efficient) solution - which one to choose and when?

I have been programming for a couple of years and have often found myself at a dilemma. There are two solutions - one is simple one i.e. simple approach, easier to understand and maintain. It ...
-2
votes
1answer
13 views

Filtering the Data and summing on one field Should I do in JAVA or write query with aggregate query with filter clause?

I have one table in which there would be millions of records. The requirement is to the records based on the condition and then total on one of the fields. Selectivity would be around approx 50. ...
2
votes
2answers
127 views

Finding an efficient data structure and/or algorithm

I am tasked with an animated graph based on a timeline, and I am having trouble finding a suitable data structure and/or algorithm that's reasonably efficient. I have a working system suffering from ...
1
vote
3answers
347 views

As a scrum master, what am I to my team?

This is a question about terminology. If I say "I'm a developer, and the team I'm a part of does foo" then you'd understand my position. If I'm a scrum master (who is a scrum master for two teams), ...
2
votes
3answers
90 views

Convention for labelling coordinate axes in 3d graphics

When I recently started doing some 3d graphics, I carefully (tried to be careful, anyway) decided to use the conventional mathematical standard for labelling axes, which was much more convenient for "...
6
votes
1answer
489 views

What is the best way to store and manage client <> server <> server and back session information and authorisation?

I have scenario, where I have javascript front-end connected using AJAX communicating with Django-Rest-Framework backend. Users authenticate using JWT tokens. Backend is acting as chatbot and ...
3
votes
2answers
65 views

Custom messages to UI from DAL?

I have an Asp.net MVC application and sometimes I want to give a descriptive error message to the user, but the condition of it is discovered at the Data Access Layer (DAL). So for example, I have a ...
4
votes
2answers
178 views

When are component teams a better choice than feature teams in agile development?

When it comes to organizational structure in an agile context, many people claim that feature teams are generally a better choice than component teams. This at least is what I find when discussing ...
2
votes
3answers
298 views

What is a good place, in OO, to store a string that is used many places?

I have a string that is used in a few places. string portalLoginPath = $"{Request.Scheme}{Uri.SchemeDelimiter}{Request.Host}/Account/Login"; I was thinking of creating a static class with a string ...
0
votes
1answer
32 views

Design decision for a cross-platform text editor that optimized for speed

On designing a cross-platform text editor that optimized for speed - I heard atom.io uses node.js, would it be slow? I heard sublime text uses C++, would it lots of effort to be cross platform and ...

15 30 50 per page