instruction stringlengths 34 36.1k |
|---|
If you have a big legacy application (big ball of mud), lets call it MudApp.
If you then create a new application to make us of new technology and to make a new good looking frontend because that was impossible in the MudApp. This new application is supposed to the fresh one and with only the most important features of... |
Given a curi like [auth:password_reset_confirm], what do you call the part before the colon and what do you call the part after the colon?
I have a json payload with come CURIs that look like this:
...
"_links": {
"curis": [
{
"name": "auth",
"href": "http://<IP>/documentation/auth/... |
I would like to know what best practices exists out there with regard to micro services, CI/CD, testing and Git workflow, especially the way of working given the constraints that
a) nothing should block a prodfix, and
b) some commits/features need manual testing.
c) PR process
A little more detail.
a) Given the need to... |
Let's suppose i have a viemwodel which requires a lot of different children viewmodels.
An example could be a settings menu: the main viewmodel should be able to load large number of children viewmodels (in the example image there are 3, but they could be an arbitrary number, even up to ~20)
All of the viewmodels are s... |
I have been developing a control software in C++. From the high perspective the control task can be basically divided into several subtasks
calculate unmeasurable physical quantity based on dynamic model of the controlled system (MachineModel)
based on calculated quantity from previous step and reference value of the ... |
I have been reading about inversion of control and dependency injection and I was wondering the following.
Is there a good way to tell when it is okay to initialise an object inside a method body of a class and when it's better to pass it as a constructor dependency?
For instance I was doing refactoring after finishing... |
I was reading an old text book "Beginning C# Object oriented programming" from 2011. The author in one case employs the "use case" to identify classes and then goes to draw a class diagram. In another case he goes through a textual description of a user scenario belonging to a "use case" to do the same thing.
This made... |
within the sequence diagram it is possible to return a value, with return of a method edge, however this is usually done with a simple numeric or string value. Is it possible to return a whole object? For example, I have the task to create a coffee and put 3 sugars in it.
Classes: initiator-Customer, Coffee and Sugar.
... |
My project comprises of serveral bounded context which communicate with each other with RabbitMQ
The front end of the project is written in C# and the backend is in Java.
The RabbitMQ communication happens with JSON payload. The backend of the application defines these payloads as JSON-schema files that are used to aut... |
I am wondering how to deal with nested resources in a REST API. I've seen other questions on the subject here, but I didn't find one that answered my question. More specifically, should POSTing/PUTting of the parent resource should POST/PUT/DELETE the nested resources?
For example, I have a REST API with Persons and th... |
At work there is a given task where a python application is currently running on a server, this application is using a enviorment file, which has username and password information. The current ask is to encrypt the username and password string such that only application is able to decrypt the username/password and use... |
I am newbie to programming and I am confused how to design an entity objects/classes.
For example I wanted to create an animal kingdom in my application.
Do I need to create a single Base Class (animal) for all the entities or should I create a single class and add a property which describes what the object is.
Example... |
I recall a principle that a professor talked about while I was in school (back in the mists of time) that went something along the lines of "A method/function should either orchestrate other functions, or perform small, a specific task", but I can't for the life of me remember what the formal name of that principle is,... |
I have AggregateEntity
class AggregateEntity {
private Enum enitityStatus;
private EntityA entityA;
private EntityB entityB;
private EntityC entityC;
//.. more here
public final void assertThatPolicyIsFulfilled(AgregatePolicy policy) {
List<Violation> result = policy.checkEntityA(entityA... |
I have an interesting and problem I'm facing. I'm trying to maintain a set of metrics independently based off of a time frequency.
Note: This is a simplification of the problem I've omitted pieces of the code the remain brief
I have a simple architecture which looks like so:
public interface INode<TIn, TOut> : IBaseNo... |
I have no idea how to structure this use case... Basically the requirement is that we want to handle tasks.
Let's say we have a class Task with the following fields and functions:
PlannedStartDate of type DateTime
PlannedEndDate of type DateTime
PlannedEffortInSeconds of type Integer
GetPlannedDurationInSeconds() that... |
Is it an anti-pattern or code smell to put "general use" functions (examples below) into a catch-all file named "helpers" or "utils"?
It's a pattern I've seen quite a lot in the JavaScript world, which I've also seen with other languages.
By "general use" functions, I mean functions which abstract away some common, sha... |
How would you engineer this:
You have a legacy application that is a big ball of mud and a monolith. This application is "impossible" to change to look good on mobile devices.
The management is pushing to make it mobile friendly and more graphical appealing and to modernize it. Therefore a new frontend is needed that l... |
I find myself applying a certain pattern again and again and I assume I am not the first one. I am looking for a name.
In the environment I find myself in we get updates to values via an external interface. Based on those updates, we have to produce certain effects. Practically, our effects not only depend on the curre... |
I'm trying to come up with a better way to organize my C# projects on SVN. The .NET solution for my main GUI has about 28 class library projects. These libraries fall into two categories. Some of them are general and could be used in many other places, and others are specific to the project our company is currently wor... |
Assume a rather simplistic model:
class Person{
static List<Person> LivingPersons
String Name
List<Person> Dependents
}
From this it can (hopefully) be seen that a single Person object can be both within the LivingPersons list and within the Dependents list of another Person object. Similarly, if there w... |
We are talking about implementing Domain-Driven Design at my company, which sounds like a great step forward for us. That being said, I am left with a few questions after a couple of days of research. For reference, we are using a model that has: data, business logic, API, UI.
The biggest gap in my understanding is how... |
[I am preparing to solicit proposals for database/project management software design. I know that the quality of the final product will depend on how clearly and completely I can organize and explain the needs of my dept. to perspective consultants.]
What I've done: Started trial accounts with a few free project tracki... |
Let's say our web application handles "orders". An order can be displayed in several different pages of our web app, on each one, in a very different way.
For example: in page A, it shows just very basic information about the order (like it's date and total value). In page B, it shows also information about the user re... |
I'm creating a multi window gui program, in c++ with Qt Widgets. I do have many custom gui elements, which usually are c++ classes inherited from QWidget or other Qt elements. When foo is the main window, it often looks like this:
Foo = new Foo();
Bar1 *widget1(foo);
Bar2 *widget2(widget1);
Bar3 *widget3(widget2);
Bar... |
I am looking for an elegant way to manage workflows and rollback when needed but the system is depending on various external services most steps of these workflows are triggering by external sources (like webhooks).
An example scenario for a subscription system:
User sends a subscription request
The subscription creat... |
Is it a good practice to hit actual database for Integrations test(Not prod but pre prod DB) for Jenkins Night builds?
The reason I am asking this is because our DAO uses procedures to perform simple CRUD operations so it is almost impossible to test operation like INSERTS/UPDATES/DELETE even against in memory H2 d... |
I'm wondering if there is a widely accepted convention for naming base classed in OOP. Does marking a parent class with "Base" indicate that it's abstract or that it's just an extended class? Or in other words, is it better to mark abstract class with the word "base" or classes that have multiple extensions?
For exampl... |
I'm using event driven architecture, to perform realtime signal proccessing and to provide independent metrics.
I decided to use a redis cluster to act a cache and a message bus.
I'm a bit confused on the best route for the architecture. Each node has other nodes which subscribe to it's values. Some of the nodes the ... |
I have a program that uses OMR to scan a photo of a "scoresheet", and give a result. Its functionality is:
Scan one photo
Compare with database for which "template" to use, identify the coordinates for blocks, etc., "correct" and "incorrect" answers (both for which one(s) are correct/incorrect, and the values assigned... |
What is considered good practice for application security wise when returning errors from a backend API?
I have inherited a project with a lot of technical debt, which I intend to improve.
One noticeable problem is that error codes are not informative at all. Sometimes it gives a 500 "error", with no further. Sometimes... |
Backstory
In an effort to store partial and full downloads to file in a clean manner, I had utilized QSettings which stores its key value pairs in the INI format in a single file.
https://doc.qt.io/qt-5/qsettings.html#Format-enum
After a short while of storing the downloaded file's byte array, the INI grew to over a gi... |
TL;DR: What would you look for in a collection of documentation when taking over an app to be run a larger scale than originally designed for?
I've been tasked with writing documentation for an application I've never worked on. It's legacy code that was written by an intern some years ago so it's not very well architec... |
I've run into the following situation multiple times, and in every case have struggled with the naming.
I want a class to force its children to implement a method, but I want the parent class to be able to override this behaviour if needed. For example:
public abstract class ParentClass {
public bool debugOverride... |
I'm a software engineer that primarily writes C code but now and then makes .Net applications for fun. This is a question about the fun part. Over a duration of about 15 years, I have used and expanded my own framework and now I am stuck. I would love feedback from someone who has experience in writing complex applicat... |
Let's have many rows in the SQL database where every record has an image property that holds the path to file in the filesystem. Many database libraries have the ability to set-up hooks that are called right after the row is removed.
Which one of the following patterns is better?
Call hook for every removed row (even ... |
I would like to know what is a more appropriate way to code in Java. Is it generally better to pass entire objects in the method's parameters or just using the fields from the class?
Using the field:
public class Dictionary {
ArrayList<Definition> list;
public Dictionary() {
this.list = new ArrayList... |
A while ago I read an article stating that overhead of an async/await call was around 50ms. More recently I read an article that it was around 5ms. I was having a discussion about whether we should standardize async operations for all DB access and decided to take a crack at measuring it myself. And I ended up adding t... |
I've seen method references in PRs and comments and documentation but it's unclear what the specific symbology means.
E.g. ClassName#myMethod or ClassName::myMethod or what about ClassName::CONSTANT
Is there a distinction in the # and :: notation, does it say whether one method is an instance method, a static method, a... |
Context
While writing a bash script I would like to test every command I write. To do so I create a separate function per command that executes the function. In addition I want to log the output of each command to be able to inspect the results later on. My doubt is about whether I should test the output of the command... |
Context
Let's say I have the API endpoints /api, /api/accounts and /api/accounts/{id}.
As far as I understand, the idea is that a call to /api gives me a list of "base" API calls, among which is /api/accounts. Calling that will give me a list of entities, with each providing a follow-up link to the respective /api/acco... |
I am planning to develop a mobile app. But I don't want my developer team to have copies of my code in their local system (like in the case of git where you can clone the repo to your local system).
What I need
I need the code to be on a remote server.
The developers log in to the server and develop there (So they wil... |
I want to write react native app. The main functionality of the app is location based - I fetch some locations from Yelp api, but how do I tackle new businesses?
My current solution: I fetch location places with this yelp api. I can search for "bars", or "pizza". Then I have some results, coming in the following format... |
tl;dr: correct way to add git to existing website project with dev subdomain on same shared hosting server?
I have some side project websites. They're all on shared hosting. I've never used version control on my side projects, instead I just created a subdomain for development (like dev.myproject.com) and copied update... |
My SmsRecipientDetails class constructor accepts String value as recipient phone number.
I would like to accept number with spaces:
assertDoesNotThrow(() -> new SmsRecipientDetails("123456789 "));
assertDoesNotThrow(() -> new SmsRecipientDetails(" 123456789 "));
assertDoesNotThrow(() -> new SmsRecipientDetails(" 123456... |
I have a legacy service written in a procedural style which I am rewriting. I
want to improve the maintainability first and foremost; the code gets tweaked
often as the business rules change over time. Hence, I want to decouple a lot of
things, encapsulate as much of the logic in their own objects as possible, and
make... |
I need to design a way to notify my user the SPA has updated if they don't refresh their browsers, i.e. if no requests to get index.html is made after the initial load, how do I notify users the javascript or css files have updated on the server? Note, it is not the REST api that my SPA communicate with updates but the... |
I've built an RSVP web application with a React front end, Node.js backend, NGINX webserver, SQL database and hosted on a DigitalOcean Droplet with Ubuntu. The issue is, every time I want to launch the application with different content (i.e. different events, locations, dates, etc.), I need to manually duplicate the c... |
I'm currently in a situation where I have multiple derived class types(just one is shown in the example below) that need to apply some logic before and/or after calling a method implemented in a common base class. I have two scenarios below and was wondering what would be a downside and upside for each approach in this... |
Is it viable to leverage both a graph db and a relational db at the same time for the same data sets? Does it even make sense to approach the solution this way?
Thinking is i use nodes and relationships to demonstrate the connections between entities, and relational db to store the deeper detail about the entity.
For e... |
Some classes have methods that don't match up with procedural data abstraction. Here is an example of a problem hierarchy, the Render() method doesn't seem to be part of an procedural data abstraction (required for ADT) at all.
My question is should the Render() function be inside the class anyway and why?
#include <So... |
I have recently come across a concept of transactions. Seems like they are a crucial feature for production applications, yet I have never heard about them except once in a university. I can't remember a single tutorial on youtube / udemy that actually manipulated with db using transactions.
Maybe if so few people talk... |
Here is the situation. System A sends the notification as it completes the work items to System B. System A does not know how many items the project consists of. It's just a pass-through system. System B knows the number of items. Once sys B receives the notification for the last item, it has to wait for the final auth... |
I was reading some C++ object-oriented programming notes that mentioned that we should avoid wrapping functions in classes if it is not required, since wrapping 'things' in classes would reduce efficiency.
Is it true that wrapping functions in classes reduces efficiency? What other 'things' could reduce efficiency when... |
After we have developed new features in a sprint the users must be trained for using these features. How does this happen in Scrum? Which role should give the training and how should it be reflected in the backlog?
Is it a developer (team) task or is it a product owner task or someone else's task?
Is it a story in the... |
I'm looking for design patterns to model (java) objects that are partially stored in a database and partially stored some other external source. In my case the external data is a whole lot of files which are read into memory and parsed into objects at application startup. The database contains the part of the data tha... |
I have some projects that share code.
This is my folder structure:
Workspace
+-- Libs
+-- Project_A
+-- Project_B
+-- Project_C
Project_A, Project_B and Project_C use code from directory Libs. I'm trying to find a way to put them into a repository, here is my options:
Put Workspace into one repository.
Make one repos... |
In the company I work with, we have a 3-layer architecture in our micro-services and the flow is like this:
Repository/DAO (entity) => Service (entity) => Controller (dto)
At the Controller level we map our entities to DTOs,
Now I am working on a search feature, and I need to perform a query with Spring Data JPA / Que... |
Context
I've been searching the internet to see if I could find any other information or posts about what I'm trying to achieve, but I had no luck. I don't know if there's a specific term or whatever for my problem, so I'm going to try my best to explain it below. I'm sorry if it all sounds pretty vague, it probably is... |
I have a simple class which looks like this:
class SpecialList {
private List<Integer> varList;
SpecialList() {
varList = new ArrayList<>();
}
void addVar(int i) {
varList.add(i);
}
boolean isVarListSizeFive() {
if (varList.length() == 5) {
return true;
... |
I would like to get some experienced advice about the handling of helper objects. Consider the following situation where we want to build a connector to a third party system. The connector shall translate business objects/entities of our domain into entities of that system and transfer them via HTTP:
abstract class Bas... |
I have a question regarding software design/architecture.
Are there any best practices or design patterns regarding the usage of classes with the same purpose from different libraries?
Let's imagine this simple project P which uses two libraries A and B. A and B both have a class to deal with 3D-Positions (this questio... |
I have question regarding Linux kernel , as far as I understand, to make Linux compatible with different machines and hardware , different device driver is added to the Linux .
I want to ask how much feasible is to add tons of device driver to Linux kernel , suppose after 30 -40 years the size of Linux kernel will be ... |
I have an SQL database in Azure that is ~4.5 TB / 150 million rows worth of data. Users will need to query this database for large sets of data. Right now, I am having users submit their requests through a web application hosted on an Azure VM.
How can I serve the rows pulled from the Azure SQL database directly to the... |
The environment is like this. An attendant is sitting on a chair operating a computer with a piece of software. She can type some text on this piece of software, so that a panel far away speaks that text.
An attendant that type in her terminal some random text so that a panel can "speaks" that random text. Who is the ... |
I need to create a program with the purpose of cross-referencing personal info from a spreadsheet(s), to check for conflicts of interest between clients of 3 different law firms. All of this client data will originate from 3 different spreadsheets using the same template for naming/columns.
I plan to write this in Pyth... |
I need clarification on something from someone more experienced to see if I am on right course with this.
Following Microsoft's eShopOnContainers microservices approach I got interested in building some small exercise microservices oriented system. But everywhere I look I see same examples using Customers, Products, Or... |
I need to add a priority column to an orders database to sort them, which will vary depending on what has already been done (actions taken). The other catch is: there are two different roles that will have both shared and exclusive actions so the priority changes depending on who is viewing the order list.
Profile 1
Ap... |
I've read various posts that polymorphism should be used instead of isinstance, and I agree that makes sense when the use of isinstance is checking the subtypes of a class to determine what to do. However, is the use of isinstance acceptable when checking the type of an object in order to do something unrelated to the ... |
Our codebase is old and very large. Over the years, many developers have worked on the code and frequently refered to the same concept inconsistently.
For example, we have a "number that uniquely identifies the study" or "Study ID". This is refered to as studyNum, examId, Exam, StudyNo, StudyID, the odd StudyUID or jus... |
From my understanding a facade is a class with the sole purpose of simplifying the use of a specific system/module behavior (its methods). It should not contain any relevant logic of the underlying system, just centralize and simplify its use.
My questions is: how to create a facade (ie. simplify and centralize) of a s... |
I have a small doubt regarding the software versioning, I know that there are many ways to do it, but the most common is with numbers and with a length of 3 to 4 digits, I know what each of the numbers mean in this method, my doubts are two but they go hand in hand (I clarify so that I do not cross out the question of ... |
I am implementing quora like application in which I have Post(question, answers, comments, likes/dislikes) as one microservice and User details as another microservice. I need user details in the post microservice. I need to relate user details with questions, answers, comments and also likes and dislikes? How can I do... |
I have a Java application that needs to generate mathematically-defined 3D shapes for a voxel world (Minecraft specifically, but that's not important to the discussion). These include sphere, ovoid, ellipsoid, cone, capsule, and others, and there are two distinct applications that I have for them. Currently I have a ... |
Suppose I have a program.c that needs element_123 to do some operations, and element_123 can be accessed by including agent.h
/*program.c*/
#include "agent.h"
uint32_t element_123 = 0;
agent_get_element_123(&element_123);
uint32_t data = element_123 + some_data;
/*do operations...*/
element_123 may be implemented b... |
I'm working on a project that has two separate versions of the API, v1, and v2 because they wanted to migrate from Javascript to Typescript. Both versions use the same database.
Recently I'm having some trouble as one part of the migrations are in the v1, and the most recent updates are on version v2. I would like to h... |
I use GitFlow as a workflow for versionning for less than 1 month. I've just finished to develop a feature branch which has been merged to develop/. Now, I'm starting a release branch from develop. The release branch will be tested. If tests show bugs, fix will be implemented in the release branch. At the end of that t... |
I have 1000 lines in a text file. I want to read them into some data structure[DS].
After reading them, I will be randomly picking 50 lines from the DS (using a Random Number Generator). Next time 50 more & 50 more the time after that. Each time I use 50 lines from the DS, I want to delete them from the DS. So after th... |
We know one of the philosophy behind the microservice architecture is availability. So suppose we have a project that has 6 services working together. One of them is an authentication service that responsible for creating users and giving tokens and validating them. So other microservices have to communicate with auth_... |
I am reading the book The Pragmatic Programmer and read about the Tracer Code and Prototyping, but I don't understood when to use Tracer Code instead of Prototyping.
As I understood about Tracer Code, I try to hit the target implementing a code that the customer can test in practice and provide me feedback in real time... |
After working through several tutorials and reading various responses on this site, I believe the Abstract Factory pattern would work well for a current project. I am seeking the opinions of those wiser than I to see if I am understanding the pattern correctly.
For my example I'll use a car as the concrete product. I u... |
I'm learning OOP so I decided to start a new project, a chess tournament manager.
Here you can read about chess tournaments https://en.m.wikipedia.org/wiki/Chess_tournament
Basically the user will be able to add players to the tournament, remove them, register the results of the games, change them, pair new rounds, so ... |
I am curious if the following example of testing a class with protected methods is fine.
For example, say you have the following class Foo that has method a() of return type Bar:
class Foo {
protected Bar a() { ... }
// ... other stuff
}
And the following test class TestFoo (using JUnit):
// Question: is... |
I'm building a pipeline that scrapes data on entities, to keep things generic, let's call them Widgets. Data on Widgets is currently unorganized and spread across various sources, including source code, spreadsheets, and issue/project tracking software like JIRA. The pipeline will run at some cadence and regularly upda... |
I am trying to do a computer program that can distinguish the functional and non-functional requirements written in Arabic languages from the Linguistic structure, so I am I look for the things that distinguish each of them in terms of writing. I wouldn't rely entirely on the structure difference, but it will be suppor... |
Pretty much all documentation on microservices I came across explain just one tiny part of some complex system. I am trying to understand big picture. So my question is: Has anyone expirienced in practice multi level AMQP Event Buses across solution when using microservices? Something like shown in the picture?
Or is ... |
TLDR: project scope has crept beyond my capabilities and I need an early exit strategy (in both parties' best interest)
Early last year I took on a gig to develop a web application for a financial advisor. The client had built a mega Excel spreadsheet over a decade of consulting. The client had a vision to automate as ... |
The problem is the following, suppose we have this functions:
from PIL import Image
from magiclibrary import perform_some_operation, stack_images
def load_image(path: str):
if isfile(path):
img = Image.open(path)
perform_some_operation(img)
return img
else:
throw FileNotFoundEx... |
A few days ago I had a conversation with a Civil Engineer with a background in Pascal and BASIC, and we talked about programming in Python. When I was talking, I used the term "code" to refer to a Python program, and he told me that he didn't know what "code" was, that the correct term was "algorithm", and that "code" ... |
It could sound trivial, maybe it is.
I have a new feature branch (say newfeaturebranch, branched from develop), but during the development a new bug is found and fixed in develop.
The bug is found to affect the development of the new feature. How to deal with this situation?
I assumed it would be bad practice to merge ... |
Some parts in our project's codebase implement the repository pattern in a different way from
what we usually do
Here's the example
public class Repository : IRepository
{
public Repository(AppDbContext dbContext, Mapper mapper)
{
_dbContext = dbContext;
_mapper = mapper;
}
public IQueryable<... |
I have a requirement where I need to add some rate-limiting functionality to an existing web application. The application reads transactions from a queue (TXN queue) and processes them in realtime. Each transaction has a unique id, a group id (a certain number of transactions belong to a particular group id), and the t... |
There are plenty of tutorials on the internet on how to build a server that handles its clients through the creation of separate threads, but there is no tutorials (at least I couldn't find any) on how to build a client that receives data from a separate thread and processes it on the main thread.
I have tried the foll... |
I would like to know how manage a type of pull requests. One of my reviewers ask me for a lot and a lot of changes (3 or 4 days doing changes), all related with possible improvements in the code that I thought it is too much and it ends up in a "perfect" and "smart" code. It is difficult to discuss with a person who tr... |
I'm studying DDD at the same time that I'm reading some Khalil Stemmler posts and I'm a little confused about who should initialize the VO: the entity it is related to or the useCase that uses that entity. A simple example:
Let's assume that we are developing an internal purchase system for a company that has suppliers... |
I found in the catalog of Refactoring by Martin Fowler, with Kent Beck book that they mention Extract Function refactoring.
It is a good practice to wrap your related code into local functions to make easy the readability and maintenance of code?
I always thought that local functions were created to avoid writing mult... |
I am trying to build a static program analyzer for a proprietary progamming language for a school project, and am currently trying to implement the parser from scratch.
I was wondering, what are the pros and cons of
Parsing in 2 passses (tokenization followed by parsing to create an AST) VS
Parsing in 1 pass (tokeniza... |
We have a project that loads metric data from various etls and services into an AWS SQS queue, where that data is processed and inserted into a metrics database, also running on AWS RDS.
When we initially designed the database schema, we chose postgres and enforced things like referential integrity via foreign keys. We... |
I've created two separate binary tree classes, with some shared functions/variables and some that are not shared. So I have tried to abstract away the similarities in a base BinaryTree class.
class BinaryTree{
public:
BinaryTree(std::vector<int> &vec);
BinaryTree *left;
BinaryTree *right;
std::vector<int> dataVector;
... |
We have a few developers who are slower than the typical agile expectation. They get fewer tickets completed in a given sprint. But on the upside, their work is more correct and higher quality.
Is this expected in an agile team, where you always get a few that is slower?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.