instruction stringlengths 34 36.1k |
|---|
I'm modelling a scheduling application and wonder how it could be avoided to update multiple aggregate roots (AR) in one transaction. I understand the fundamental problem of changing multiple ARs in one transaction, since it could cause a lot of conflicts. However, I don't see an alternative in my case.
The schedule lo... |
Outline of the current architecture of our web app outlining the issue I'm seeing
Client-side app is React, talking to a server running the Play! framework via an API.
On the page is a table that allows a user to select 0 to many rows via checkboxes. There are buttons above the table that allow the user to take bulk ac... |
Thinking in the classic example of orders and lines.
I would like to use the domain classes in the presentation layer, so as to check if an action or a property is correct, the main code is in the domain classes and I only need to adapt the specific aspects for the UI, for example, nulls, that in the domain it common d... |
I have a lot of classes that have numeric values that are configurable by the customer during runtime and should be clamped between a min and a maximum value. The value changes should also be logged. An example of this is given below:
public class MyClass
{
public double AMin { get; set; }
public double AMax {... |
I'm creating a language parser on a microprocessor in C++. For the tables of keywords and commands, rather than maintaining a single curated file (alphabetically sorted, etc), I'd prefer to declare them in the header files for each set of functions (ie, unsorted). Then, I can have the makefile run a program to scan t... |
So this is a topic I have never really tackled, so bare with me as I try to describe my issue and the scenario.
I have an API endpoint in my service that sends emails to a bunch of users. The set of users selected is based on the criteria in the payload in API request. It works well so far. There are new use cases that... |
We all know that in a layered backend architecture we have the Controller (or view) > Service > Repository (or Manager)
The Repository part is the part that retrieves and updates the DB.
But now that we have ORMs that are fairly advanced, does the manager/repository part still relevant ?
I know everywhere that it's the... |
As far as I understand, there is no certain boundaries for the RESTness of an API. However, I would like your help to understand how large and long (in terms of running time) a caching or state mechanism would be fine to use with a REST API goal in mind.
I read about stateless being no short lived state. The database p... |
Apologies if this is answered elsewhere here but this specific question is somewhat hard to search for as you might see. I'm writing a script currently that essentially has a simple if-then within a for-loop like so:
for(i = 0; i < length; i++)
{
if (a < b)
{ ... }
}
However I want to re... |
RefactoringGuru's example Singleton in Python has an _instances dictionary field
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
... |
I welcome everyone. I'm trying to understand microservice architecture.
The task such: is 2 services. The first - for example, books rooms in a hotel. The second is something like a console interface that sends a booking task to the first and waits for a response from him, saying that the room is booked or not.
For thi... |
At work, we're using Scrum with Azure DevOps (specifically using the Scrum process to manage our items) to run our sprints.
My question is, does the Scrum process within Azure Boards or Scrum in general prescribe product backlog item (PBI) statuses. Specifically that they must be marked as Committed when brought into a... |
I'm not conversant with this topic, and therefore I watched a tutorial about a one-page dynamic PHP website (quite educational in my opinion) in which the creator designed the following pages.
For each and every ADD, DELETE and EDIT page, there are two additional files to create, making two per page. In other words, (... |
In university, we were introduced to the two terms "verification" and "validation". The definitions can be summarized as follows:
Validation checks that the specifications and requirements that were defined fulfill the customer's actual needs. (Do we build the right product?)
Verification checks that the software that... |
I am working on a project to stand up a central database to replace a current massive file-sharing/syncing system of physical log files and text configurations for the primary application I work on.
The app I help develop runs on around 40 computers, each of which can generate hundreds of records per minute while activ... |
My team and I publish a client app as part of our solution. It includes a CLI but there are other components as well. Currently most of us develop locally on MacOS, and as part of our CI/CD we have a suite of system tests that run end-to-end workloads, including the client application and our cloud service.
Until now w... |
At an architectural section of an interview I was asked to produce hardware requirements for a certain system I designed. It was a microservice-based system which runs in Kubernetes, Openshift or any other virtual env.
Basically the question can be rephrased as: how much CPU, RAM and storage will every instance of micr... |
We've been utilizing pair programming (or something like it) for a few years. As a senior engineer on the team - I find that pairing actually negatively impacts the team's throughput.
The common pattern is that more senior devs generally end up handholding more junior devs throughout the whole process - basically codi... |
To better context see Rich Authorization Requests for OAuth2
As u can read here there are some common data field types like actions, locations etc.
So I have created C# entity for EF as below:
public class AuthorizationDetails
{
public int Id { get; set; }
public string Type { get; set; }
public bool Always... |
I have one bounded conext, offers, that has Offers as root aggregate and Items as child entity.
I have another bounded context, products, which has Products as root aggregate, Providers as another root entity... but for the example Products is the entity that I need.
Product has a price property, that is the reference ... |
Let's consider the following test.
[Fact]
public void MyTest()
{
// Arrange Code
var sut = new SystemWeTest();
// Act Code
var response = sut.Request();
// Assert
response.Should().NotBeNull();
response.ResponseCode.Should().Be("1");
response.Errors.Should().BeEmpty();
}
I hav... |
Background: At work I was tasked with developing a new demo web client to replace our Windows Form application in the future. Our back-end is developed in Java and works stateless as REST services. The demo client should be based on Angular as we want to try out some things first. Both I and other developers already ha... |
In a distributred system that uses parallel processing to complete tasks and I want to determine when all sub tasks have been completed, what design method or principals can i apply ?
I am using RabbitMQ to consume messages that are generated from a single process, each consumer can generate multiple messages to other ... |
I have a set of complex data, which I use on various subdomains of my project. Data are static most of the time, it changes few times per year.
Currently, it's hardcoded in every project which needs it, but I am looking for a way how to make one "source of truth".
Of course, I can build another api.example.com service ... |
An issue I find myself having with code layout in my React components is that I end up having to define too many handlers.
I generally write only functional components with hooks, but within the body of the component function I find myself having to define a bunch of child functions, e.g. for a SignInDialog~
const onSi... |
We are storing our configuration files in S3. Each file is a JSON file. When config changes, the old file is backed up and a new file replaces it. These happen behind a service, where it also maintains optimistic locks to deal with concurrent writes. We store changes as audit logs, along with the author and timestamp.
... |
I'm trying to break down my dockerized monolith into a few services that can be deployed independently.
Right now, I have a development environment, a staging environment and a production environment. I'm not sure how it's supposed to work for microservices, especially for the staging environment. Is every service supp... |
Some decades ago working with IRC, I remember a paragraph of some RFC and now I'm looking for it. I don't remember it by memory, only a concept:
When it comes to communication between two services, the server issuing the information must be gentle upon receiving the request, so that it can accept the sender's query wi... |
Currently I want to create a SQL database effectively and "logically". Lately I read a lot about the issues that it is (mostly) not a good idea to define primary keys that can be seen from "outside" as autoincrement. And for my applications it would be a problem too/risk.
As a solution I used UUIDs for this. However, I... |
Is there a term that describes the property of being synchronous vs asynchronous?
The term that most naturally comes to mind is "synchronicity", however I only see this term being use in psychology. I would like to use this term as a property label on APIs that I am documenting, however I want to see if there is alread... |
Does it violating any conventions? Is it acceptable by MVVM? I have to separate the local data repository and online repository, but for login I have to use multiple repositories for getting response from API and saving credentials if they are correct
I have implemented it just by editing the ViewModelFactory as follow... |
I am building a .Net Core Blazor Server application. The application creates records of a Project class which move through a workflow with various phases of review and acceptance/rejection before completion.
I am trying to determine the best place to incorporate various business rules around who can modify the Project'... |
Whenever possible I have been requiring an understanding of the requirements and architecture for the next scope of work before starting to code.
Sometimes due to schedule pressure on larger projects I have to start coding before I know everything I need to know for that scope of work, but in that case I make it a prio... |
Let's suppose I want to follow TDD (Test driven development) and I want to implement a class that is supposed to return a considerable object.
It starts to get really complex in my opinion and doesn't seem like a great design.
Let me give a concrete example I'm working on, a class that contains some methods, and one of... |
I was wondering if I have a microservice called, for example, Weather, and only certain people can update certain properties around the weather such as Temperature, Precipitation, and Wind.
These certain users are mapped to the weather event, e.g.:
User1 => Temperature
User2 => Wind
User3 => Temperature
User3 => Precip... |
I am facing this problem and would like to review my approach to it here.
A Client sends an HTTP request to Service A and is expecting an answer.
Service A is connected to DB A. When it receives a request from Client, it should save it in DB A and forward it to Service B. If it already exists, it should return a fail... |
currently I am working on a kind of "Chat" Application.
The app consists of "threads". Each of this threads consist of "subthreads" in wich a user can send a message (like a group).
But there also should be an option to send private messages.
Firstly I have to say that I have basically no knowlege about NoSQL-Databases... |
My employer has a significant number of company-internal strings which require format validation. For instance, order number AAA-BBB-CCC, stock number AB-123456 or factory ABC1 - Regex with extras (think checksum, number range).
Having re-implemented functions for every project I have been on, I wanted to publish a rob... |
I am developing an API backend in NestJS, now for some specific routes (or controllers) I am loading in a configuration from the database to handle an incoming request. This fetching of the configuration is done inside my service (business logic), but I was wondering that perhaps this can be separated using middleware.... |
I am working on making changes to an existing Web API that exposes information about orders for specific customers.
As a developer, I am used to seeing "more or less" RESTful APIs, and I would expect the URL for getting customer's orders to look like this:
https://domain/orders-service/orders?customerId=<ID>
However, ... |
The main application loads plugins, list them and when user selects one it is initialized and displayed. Each plugin is a complex class library which contains several views/viewmodels/repositories/etc..
Is it a good idea in such a case to have in each plugin some kind of a bootstrapper and use dependency injection dire... |
I'm creating a multiplayer game and have been having some trouble creating a good architecture for the server side.
So far on the server we store a list of player which are the actively connected players, the main way they interact with each other is by shooting each other with guns. To facilitate this I decided that a... |
Let's say I've a sendMessage endpoint. This endpoint looks at configured message destinations and then puts 1..N messages into a queue (e.g. {userId: 3, type: SMS, trackingID: X} and {userId: 3, type: EMAIL, trackingID: X}) and returns the trackingId.
Now I want to expose /status/x, which will display an overall status... |
I am looking at the List<T>.AsReadOnly() method.
Since List<T> itself is a IReadOnlyCollection<T>. (It implements IReadOnlyList<T> and IReadOnlyList<T> implements IReadOnlyCollection<T>) the implementation of AsReadOnly() could technically be return this; which has no allocations.
Instead this does return new ReadOnlyC... |
Suppose there is a third-party application which offers GRPC services with authentication. You want to use these services in your web application. So you will basically use that service behind the curtains with just a few simple conversions (e.g. time is denoted in seconds in third-party, but you want hours on your sid... |
I was going through an old, largely untouched part in my company’s codebase and found one API. It does the following things.
A POST API with path host/entities/trigger which fetches a list of entity IDs from the database. For each of these entity IDs, it’s making another POST call to the below API in the same service (... |
Over the years I've many times seen folks enumerate error codes for exceptions in Java. I generally have felt this leads to more tedious code and does not provide value.
For example, there will be an enum like this ErrorType, often times with a numeric errorCode, which I find additionally egregious.
package so.example;... |
Our team is working on software that does a lot of calculations, inputs are quite immense structures and outputs are calculated data for the GUI (around 10 tables, warnings, and other messages produced deep in the code). I think neither the input data structures can be smaller, nor the outputs. The generated output to ... |
I have these lines in multiple test methods. Now, trying to create a private method to clean up but not sure how to do it. Any suggestion or pointer would be really helpful. Thanks.
var actualValiationString = string.Empty;
void messageBuilder(string validationString)
=> actualValiationString = validati... |
I am trying to build ERP application using React frontend and I have not found decisive answer whether to use object graphs in React state?
E.g. I would like to build Invoice view and I have the following domain model (provided here partially):
Invoice
Person
DeliveryAdsressArray
DeliveryAddress
Wa... |
I have the following pattern repeating itself in multiple places:
abstract class Database {
void connect() {
this.setStatus( CONNECTING )
try {
await this.realConnect()
}
catch (error) {
this.setStatus( ERROR )
throw error
}
this.setStatus( CONNECTED )
}
abstract void re... |
I'm adventuring myself in the world of ES and CQRS and I've been reading a lot about it. Unfortunately, most materials don't go beyond the basics and when you start trying to apply it to real-world examples you start stumbling into stuff not covered in the examples.
My question is regarding related entities. Imagine we... |
I am creating a distributed chat system with a microservice architecture where a user can log in and chat with another user. The services that I identified is a conversation service that handles chat-related logic. Message service which handles and saves the messages and a user service that just has a simple authentica... |
I'm just starting to build a web app using React.js, Next.js, Prisma, & PostgreSQL. In this web app, users can create "projects", which are represented by 10-15 rows in the database. When users make changes to the project on the client-side, what is the best method to synchronize the database?
Here's what I've consider... |
I am new to microservice.
While learning about them, I was wondering what is the basic rules (the minimum) that make a microservice a microservice.
I have found some rules/characteristics along the way:
Required:
Loose-coupling, independent and scalable web services.
Doesn't have to be the same technologies, but must ... |
I have read this example:https://auth0.com/blog/securing-grpc-microservices-dotnet-core/
In this example it explains how to implement authorization in a gRPC service.
It says that the client request a token that let the client call the service. For that, it is needed to include in the json file the public and private d... |
I have an algorithm that runs a search through every combination of a 5x5 grid where each cell can have 3 values, looking to see which combinations meet certain conditions. This gives 3^25 naive combinations.
However, rotating the grid 90 degrees doesn't change whether or not it satisfies the search conditions, nor doe... |
Backend: Django / Django Rest Framework, would be hosted at GCP k8s
Frontend: Angular, would be hosted at some CDN e.g Vercel
Authentication: JWT (https://github.com/jazzband/djangorestframework-simplejwt)
The frontend and backend would have different domains. (could be on same domain but different sub-domains)
My fl... |
Cross-posted from stats stackexchange
Say I have a logging utility in my application that I use for recording timestamped diagnostic log messages. I want to add tracking of some performance metrics to this log. Moreover, I want to do this intelligently, so as not to explode the size of the log files.
A convenient way t... |
I have a monolith implementing what is basically an ETL process, receive data from external system, orchestrate the processing of it, and then pass the results back to an external system. (The monolith does not perform the actual processing, that is handled by external services This monolith is deployed on-premise to o... |
I am creating a unique "key" object type for a tree, we will call this object type a TreeCoordinate.
A tree in this case is a fairly standard mapping of nodes from parent to children where each child holds a reference to the parent. The parent holds a list of children based on their index. A node can have zero to N num... |
I am the newest programmer on a very small team of 6 developers, 3 of which are offsite. By "newest" I mean both in years of experience (drastically) and familiarity with the code. I've been with the company for a couple years, though only recently shifted towards programming. I have no formal education on programming ... |
Background
We have a number of backend api's that do work; some connect to equipment, some store data, etc. The original setup was each service was a native c# asp.net 6 minimal api running on a windows server 2022. I was able to convince the right people we should be using docker, but as a compromise, I had to write a... |
Assume we have a single large JVM project (the example is in Kotlin), containing code. As part of a refactoring effort, we are decoupling pieces of the code by splitting the code into multiple modules, and using a build tool such as Gradle/Maven to build deploy applications with only a small set of the modules.
Some mo... |
I’m starting at numerical methods and I am introducing to the machine epsilon and succesor. I have this question, which is the succesor of .13579x10^2 at a floating point system of (10,5,-2,6). My intuiton is that it must be $.1358x10^2$,but then, I know that $.13579x10^2 + \epsilon$, where $\epsilon$ is the roundoff u... |
Background: I'm a scientist working with a small team on data analytics. No one on our team has any experience with software engineering, though I'm trying to change that.
Suppose I have an array A that constitutes some measurements. I have a script that transforms A-->B. I also have 3 separate scripts that transform a... |
I'm playing around with DDD, and in particular in cases that involve remote service calls. I'm building a system where the user records are actually backed by Cognito, so I've got to work with the Cognito IdentityProvider SDK instead of a local database.
In terms of just loading and saving data, that's pretty easy. I'v... |
Currently, I'm designing the Project based on Clean Architecture composing with 4 layers:
Domain
Application
Infrastructure
Presentation
Since the project is pretty huge, I'm now considering to separate the Application Layer into Multiple Module Layers. For e.g. Application.BackOffice, Application.FrontOffice, Applic... |
I've seen such a convention. Whenever a public method is declared, two classes are also defined that enclose its return value and parameters like this:
public MethodNameReturnDTO MethodName(MethodNameParametersDTO parameters)
{
// method body
}
public class MethodNameParametersDTO
{
// blah
}
public class Met... |
In my company's codebase, we hardcode sql queries without using an ORM.
Here's an example of a query we would run:
UPDATE client SET status="active" WHERE client_id=123
Since the query is hardcoded and the parameters are passed in, the code would look like this (Python):
'UPDATE client SET status="{}" WHERE client_id=... |
We have a requirement to store key value pairs (KVP) in Kubernetes and looking for possible options here. The requirements are as below:
KVP are small sized - 200 characters together.
KVP are short lived - 5 mins max, we don't need it beyond and thus clean it up.
KVP written from one node, retrieved on a different one... |
I'm sure this has been touched upon by a number of questions, but I'm struggling on drawing the boundaries between code, data and configuration versions when working with a large DAG (think airflow or Dagster).
There are a few things that change over time:
The source data (data always changes over time)
The code (code... |
I'm relatively new to OOP. Let's say I have three different objects/classes defined, like:
Public Class Part
Private m_Name As String = ""
Public Property Name() As String
Get
Return m_Name
End Get
End Property
something...
End Class
Public Class Assembly
Private m_Nam... |
My scenario is fairly typical, but I can't figure out a good solution. I have a DB table (in reality several unrelated tables, but let's focus on one) where there is a fair deal of activity going on. In the table:
Records are rarely inserted
Records are often updated (I expect multiple records to be updated every minu... |
Suppose that I have a class named CharStream
Additionally, there are a large number of functions which convert their function input into a CharStream
def funky_the_function(_input):
input = CharStream(_input)
# do some processing
return output
There is no need to convert a CharStream into a CharStream if... |
This question is about how to be a good citizen in an open source community, and do my part to effectively participate, to advance the project/not harass people.
I am building a medium-sized C++ project at work. My toolchain is the Clang with LLVM 15.0.7 on 64-bit Windows (the most recent LLVM release for Windows on th... |
We are working on a suite of Python 'services' each of which is basically an application that does some calculations based on a domain (data) model and returns the results. These services are designed to be called individually by only providing a domain model. We also have one large "main" service, MainService, that or... |
Im currently working on a college project on the simulation of magnetic interactions of particles, see physical simulation: design thoughts.
Right now im starting to code my system according to this design:
However, I'm realizing that I haven't thought the communication between my PhysicsWorld and my PhysicsSystems th... |
I have a C# application that needs to connect to either an Oracle database or a SQLite database. The databases can be considered "identical" - same schema - but users have the ability to "load" their own SQLite file for faster local access. I'm trying to design a data access layer for this need.
My problem is that the ... |
To best explain my context, imagine that I’m creating an alternative piece of software to google analytics (since my personal project’s principle is similar). Each unique user creates an account and needs to place a tracking script on their website so that their website visitor actions can be tracked. Something like th... |
Dilemma: I am working in microservices (MS) architecture for a product with shared (PostgreSQL) DB between MSes and DB Views exposed as Data Access API between SW Components, written and maintained by different teams in different languages (Java+Hibernate, C#, Python).
I have tables/views like root with columns id, nam... |
Using Typescript, if we imagine an entity like this:
interface Order {
id: string;
address: string;
}
Now I would like to design a system where we can process entities feeling confident that the address field won't leak by accident, e.g. if I were to log that entity. For example I can imagine a logger that runs al... |
I'm a Java developer and I'm try to separate my code to packages (modules, services, whatever the chosen unit of functionality is). Let's say I'm creating a system that tracks employees and the company laptops they are using (this is not a real example, I'm working in a bank).
I have an entity in my model called Employ... |
What exactly does Hosted-Application, Cloud-Enabled, Cloud-Native and Cloud-Agnostic mean? Pros, Cons, and when to use?
Unable to find a similar question on Stack Exchange.
|
I'm trying to use Kafka for my event handling, but I'm struggling a bit to understand what pattern I should use.
My use case is this:
One consumer waits for one type of event.
When that event is processed, the same consumer need to produce several different types of events to different topics using a subset of that in... |
In a library, there could exist three types of functions. The first are those which are visible to the user i.e. their declarations are installed in the library's include directory. The third are those which do the core work of the function by e.g. getting into the numerics in a highly detailed fashion. The second are ... |
Assume that an external library or framework not under our control exposes a Controller API:
abstract class Controller {
abstract fun call(): Result
}
Assume that we want to handle exceptions from all of our Controller implementations using the same exception handling logic:
abstract class ExceptionHandlingControl... |
I have an application with dependency injection that consumes a REST API. The API calls are abstracted into entity-specific repositories. Some of the repositories are: HttpNotebookRepository, HttpPageRepository, HttpBookmarkRepository, HttpUserRepository and their corresponding interfaces.
I have a NotebookHierarchyCon... |
We have research code that consists of Jupyter notebooks and large data files. At the same time, we also have production code that consists of Python source and CloudFormation templates. There is currently no overlap between the two - the directory structure is different and research code is rewritten into production c... |
I'm looking for the most proper way to design a modular application with ServiceLoader.
--MAIN IDEA--
module app.view | exports app.view.View interface that defines UI api
module app.engine | exports app.engine.Engine interface that defines Engine (core functionality) api
module app | (entry point) requires and uses a... |
Virtually all (imperative) languages offer the operators < <= >= > for lower, lower or equal, greater or equal and greater. But why no ternary range operator like (10 < x < 100) to test if x is between 10 and 100 or an inclusive one 10 <= x <= 100. Would this make parsing prohibitively complicated? Or is there even a l... |
I was taking the PluralSight course with the title “azure-devops-continuous-delivery-release-pipelines” and it makes a big deal out of (ie spends a lot of time talking about) separating the release and deployment concepts, and adding features behind feature flags.
Where Deployment = binaries in production; Released = ... |
I'm maintaining a library written in C++, which offers modern-C++ bindings for another API that's C-ish (it's this one, although I'm trying to make this question somewhat more general).
Now, when I started working on this library, it was 2017. The newest published standard version was 2014, and 2011 was already popular... |
I am refactoring an old application which has about 200 user permissions.
Based on access permissions for the user, menu items for webpages will be Enabled or not.
Permissions are also checked on the Load of a webpage to see if the particular user should have access or not.
At the moment there are a few "category" perm... |
This might be an opinionated question but I'm eager to hear your anecdotes as I'm at the beginning of designing a new API. Now I'm questioning whether I want this API to be a sink API or non-sink API. I call it that for the lack of better words (and I heard that somewhere so it might even be the right wording).
A sink... |
Scenario: Given a class with some internal state and methods to manipulate this state, I want to limit the exposed methods that are available to potential clients/users of my API.
TLDR: In the following, I present a simple example describing the problem and four alternatives I have considered. Answers should either poi... |
Do software developers actually use UML diagrams, and more specifically object models, domain models, system sequence diagrams and operation contracts? I am taking a computer science degrees, and we're spending a lot of time (significantly more than programming) learning about UML and different types of diagrams. But c... |
I'm currently using Azure AD as my identity provider and Keycloak as my intermediary/broker for my client applications. However, I need some user attributes (such as phone, email, picture, and officeLocation) that aren't provisioned from Azure to Keycloak by default.
I'm considering two options: fetching the additional... |
It seems that the RFC8259 and ECMA-404 definitions of JSON are unclear on the escaping of solidus, aka forward slash.
RFC8259 states:
Any character may be escaped.
All Unicode characters may be placed within the quotation marks,
except for the characters that MUST be escaped: quotation mark,
reverse solidus, a... |
When writing a tokenizer, what is the standard practice for handling aliased language keywords?
For example, notethat signed short int is a language keyword in C++ and several aliases might be allowed.
signed int
short int
signed
short
int
Do we map several different misspellings of a single language keyword to som... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.