instruction stringlengths 34 36.1k |
|---|
I have been preparing a test plan for every sprint even if I have a master test plan just to plan the test for the current sprint. I am including topics like:
Introduction
Purpose
Feature Overview
Inscope
Outscope
Assumptions and Risks
Approach
Test Deliverables
Testing Task and Proposed Schedule
Recently after disc... |
I have been using Template Design pattern in my code for implementing CRUD procedures for different resources.
There are some steps which are same for many resources and some which need some addition/overriding.
ResourceCommonProcedures as a base class and each Resource procedure inheriting the base class.
public class... |
Problem description:
Parent view displays a list of items. This view has button add a new item to list wich open modal for creating a new item.
Two approaches how to do that:
1) POST Request -> Insert from response body new list item to the parent view
2) POST Request -> Notify parent view that new item created -> Pare... |
I am asking advice from the SQL graybeards. Because my following proposition goes against everything I have practiced.
In this instance
Let's assume we are developing a phone app. A social network with hundreds of thousands of users. Our technology is java for the use on the android phone and will be open sourced. Furt... |
Long time ago I learned that text files are not like Random access Files, i. e., adding or updating info at the beginning of a text file involves moving all the rest of the file "forward" (or backwards if the size of the new info is smaller than the former info) in storage to let some space. This takes time and space i... |
I recently came across an MSDN article about branching and merging and SCM: Branching and Merging Primer - Chris Birmele.
In the article they say 'big bang merge' is a merging antipattern:
Big Bang Merge — deferring branch merging to the end of the
development effort and attempting to merge all branches
simultaneo... |
Why do languages demand catch blocks when they aren't needed?
The compiler or parser complains with this code:
try {
const utils = require("applicationutils");
}
But it is OK with this code:
try {
const utils = require("applicationutils");
} catch(e) {}
I don't need the catch block.
I'm using JavaScript if ... |
So our domain model drove our database and ORMs worked for DDD implementations.
Now the tables have been altered a lot and as a consequence ORM impedence is too much in our domain model to use hibernate tweaks. I am looking at persistence approaches for DDD entites.
Can Cross-reference tables be brought into domain ... |
I've developed a reading tracking app in Swift and for simplicity's sake I used arrays for my model. It stores some data about the books a user reads and a small image of the cover. I save them to disk periodically for persistence.
Now I'm wondering as people use the app, at what point would it be wise to convert my m... |
I'm currently taking over a project that has a common pattern of interfaces like this:
public interface EmailService {
void sendInvitationEmail(Payload payload);
void sendNotificationEmailToAdmin(Payload payload);
void sendPasswordResetEmailToUser(User user);
void sendValidationEmailToNewUser(User user);
}
The... |
I wrote a startup-pipeline where definitions are passed via environment variables and are used together with (unit-tested) methods to create suite of several publications (for subscriptions) by some lightweight factories and generators (also unit tested).
The startup-pipeline looks like this
Load the publication defin... |
I am the manager of a small team of software engineers.
I am looking for arguments in favor of automatic, mandatory code formatting.
For me it is natural, it goes with the Quality Assurance process and I do not question it too much ; commit cannot be accepted in our Python software if it does not passes through black. ... |
I'm currently developing a real-time application using .NET Core 2.2. Many IOT devices (could be up to 100) are concurrently sending messages via MQTT. These messages are parsed, elaborated to extract and validate the current position of each device based on some business rules and then persisted to a SQL Server DB usi... |
Context
I have a workflow that has an email form. The requirements are the following: A user completes the form that contains email fields and submits it.
If everything goes well then an email model object is created and stored in the database, and then the data are sent to a rabbit queue.
When the queue gets processed... |
Suppose I have a User entity with name and age attributes. A User can own Boxes. A Box has the name and color attributes. Business rules dictate that one User can own at most 5 boxes. So, in this case, the User can be the aggregate root and whenever a new Box is bought by a User, I can do
class User {
private boxes: ... |
I have a library for a lockscreen in Android, that includes diferent dilogs for fingerprints, texts and all that stuff. My question is: What the best practice to provide localization. Should I have instuments that provides developers eho use this library to set up localization outside of library, which means if develop... |
I am trying to polish my data-mapping library and struggle with my fluent API design as it feels clumsy in some basic use-cases.
The library focuses on defining mapping objects from one type into another in a fluent way, even for immutable objects. The immutable API works as follows: Every constructor parameter has its... |
I have a C# MVC application. One of the requirements of the application is to maintain an audit log of everything that happens to a particular 'entity' page. To make the example concrete, lets say there is a customer page, with sub entities like addresses and phone numbers.
I have an audit service that logs a particula... |
My team has recently decided to adopt the CQRS pattern similar to the one used in the famous Microsoft EShopsOnContainers repository. In this solution, the queries are made in Query classes using Dapper and Commands are done in command handlers using EF Core.
The queries that I am doing on my domain are quite complex ... |
A lot of articles online give very simple examples on Blue-Green deployments. However, how would data update be handled?
Say I have a column called Category with values (A, B, C, D). In my next release I want to consolidate values (B, C) -> (E) to handle a new logic. However something goes wrong and I need to rollback ... |
I'm building a news aggregation system that collects news articles from several websites, then classifies them into categories, tags them with keywords and saves them to a database. All actions are activated in the same sequence, begins with news scraping. Everything is put in a loop that runs every 5 minutes.
Trying t... |
I've been looking at examples of sequence diagrams for observer pattern but most implement push model where the subject updates the observers. In a pull model how would it be different because technically the subject updates the observers still when there is a change just that the observer triggers the data extraction?... |
I have to design the architecture of a system that processes messages in a distributed manner. If this were the only requirement, I would use a message queue like Kafka and distribute the work with Faust. This solution would be perfect for my use-case because the work that needs to be done for each message involves a l... |
Stack Exchange has some bits of what seems to be session state -- for example, whether you want to see 15, 30, or 50 questions per page when you view a list of questions.
You can click on the button at the bottom of the list to change the setting, that value is a URL query parameter, and thereafter the new setting is r... |
Important note: This is PHP (5.3+). PHP is stateless and everything you do dies when the request is over unless saved to a persistent storage, but if the answer provided gives me pseudo-code, I'd also be happy. Also, I can't use routing. I need something that deals solely with objects and parts of them.
My system right... |
I've been asked how to re-design a legacy system by a relative for a company that builds custom chairs. On their website you can customize your chair in about 30 permutations : chair type, material, if wood what kind, color, height, leg type, etc..
They have been working for years with a system that creates a ~40 chara... |
I have a standard application and in this case, it is an Accounting ASP Net MVC application. Now, I have a new client that has their own specific requirements like other fields and some custom behavior that doesn’t make sense to be included in the standard application.
The most straightforward thing that I could do is ... |
I am new to the formal idea of UML diagrams, but I have drawn and read system type diagrams for years. I wish to set a very simple exercise for the analysis stage of a project. I am considering the operation of a checkout till with a built-in scanner and weighing device. I can capture the interaction of the checkout op... |
I need to share some associative data between different parts of my application with two requirements:
immutability (so read-only)
safety against mispelling or unavailable index inside the data
mixed type
I have no need for behaviour, internal state, validation or other DDD related features, just simple read-only da... |
Let's say I have a stacked 2 layer app (High Layer (HL) and Low Layer (LL)) that is implemented in C.
HL defines a few #defines.
HL calls a LL function with a parameter that takes values of the #define.
LL wants to check these values and proceed accordingly.
Now my question is what is the best way to share these #defin... |
...I wanted to find the source before writing this Q, sadly I couldn't.
My mental model was that exceptions were thought as an alternative to returning error codes from a function, which is the C way to signalize failure. Returning error codes and managing them is error-prone, cumbersome and tedious; which is why a mo... |
There is often introduced a concept of using metadata in events.
I just would like to understand the difference between data (which is referred to as payload) and metadata. I've read what I could find on the web on it, still would like to hear some opinions.
Let's take some general case. Say there are some items (Item... |
I have a confusion. So, in OAuth2.0 there are 4 types of Grant (Authorization Code, Password, Client Credentials and Implicit). In my use case, I have two login scenario. The first one is using username and password. In this case it's clear that I should use Password grant type to give access and refresh token to the u... |
I would like to store the frequencies with which words co-occur with each other over a variety of contexts in a large (> 1 billion tokens) text corpus. I need to store the word pair, the type of co-occurrence (e.g. word1 in the same sentence as word2, word1 in the same paragraph as word2), and some metadata about the t... |
With 'global variables', I mean
Variables on namespace level
Static data members in classes
Static variables in functions
In a big C++ project I would like to have a mechanism (like a compiler option) to prevent such data in most parts. A compiler error or warning would be nice. Of course, at one point you have to in... |
I'm working on a text GUI library which comes with builders for UI components (Buttons, Panels, etc). I have a base class for these builders which I'd like to redesign so that meaningless component states can't be represented with the builder. Right now the API looks like this (over simplified):
interface ComponentBuil... |
Let's say I have three classes: A, B, and C. All of these classes are simple and they create a cohesive unit. In addition, B depends on C and C depends on A.
Most people would put these classes into one directory:
java
├── A.java
├── B.java
├── C.java
It's simple, but it's difficult to tell where the logic starts. You... |
I have seen a project which uses Maven submodules. The project itself is a spring boot application that exposes Restful API endpoints for a microservice ex: Customer Service (getCustomers, createCustomers etc); consisting of standard model classes, repository, service interface&implementations, controllers etc.
Is ther... |
I created a function to read floats (IEEE 754 binary 32-bit) from strings, for developers. I have everything finished and working perfectly, except i'm wondering if a user/or programmer enters a string such as "NaN" that does not specify QNaN or SNaN, what should it be considered? or should "NaN" be considered an inval... |
I have been going back and forth in a discussion about polymorphic enums to call different DAO methods depending on enum entry, and I haven't been able to get a common agreement on this subject.
Lets say you have an enum that controls your response style, (short and detailed), and then you override a method to get that... |
I am looking for some general architectural guidance about designing good cloud apps, primarily using AWS. For the sake of argument, lets say it's a single page app, written in JS, hitting a couple of services like S3 and maybe some Lambda functions that read/write to a DynamoDB.
Option 1 - Make calls directly using A... |
We are designing an architecture of a high availability distibuted system and we are considering server side vs client side service discovery. There is one problem, I need to solve - how is it possible to discover the Discovery Service (Eureka/Zookeeper/NGINX...)? Is there any way, how not to hardcode/hardconfigure the... |
Consider a web api exposing two kind of resources: Users and Teams with many-to-many relationship, typically a REST api will expose the following trivial endpoints to read data:
GET /users
GET /users/{id}
GET /users/{id}/teams
GET /teams
GET /teams/{id}
GET /teams/{id}/users
Now I am trying to design endpoints to mana... |
I'm going to share an example where I noticed this and would like to know if there is a known pattern of why one would do this.
I have two instances of rsyslog running on different machines. One acts as a receiving server, the other as the sending client.
While there is a connection the following is seen on the server:... |
As the sole developer in a startup, I had the luxury of being able to make a lot of decisions in the architecture and frameworks of our application.
Fast forward 4 years and an acquisition later, I have a team of 5 and a lot of times it feels like the wild west. People making whatever design decision pleases them: int... |
For simplicity, let's say I have the following C project structure:
src/
utils/
logger.c
logger.h
main.c
secondary_component.c
main.c starts with:
#include "utils/logger.h"
I would like to keep the code and its structure as-is, but stub out logger.c, logger.h and avoid compiling secondary_component.c ... |
I'm working on a bare-metal embedded system, with a class that can be compiled for different hardware versions. The class takes in a pointer to a device and uses it, or takes in NULL if the device is not present on that hardware.
When the device is not present, I want the device code to be left out of the compiled bina... |
I've recently "discovered" the IoC realm, and decided to refactor a project I'm working on to use such a container.
To be specific - I'm using autofac in C#, in a .NET Core console application.
The program reads some configuration at startup, doesn't really matter how, just that it's all wrapped nicely with interfaces,... |
I have a User entity, which may have a RefreshToken (for authentication).
Notes:
A refresh token doesn't have "identity", but is related to a single user - it is only valid for that user. In the db that means a foreign key to users table. In Entity Framework I can however model it as an "owned" type so that it's part ... |
I engineered an ERD diagram using Barker's notation.
The problem was to make a database for system of water pipes where one node is connected to another using a section (pipe), each node can have unlimited number of pipes connected, but the pipe must have only two nodes that it's connected to.
Each node that is situate... |
I have the following method in Java:
public method1() {
//does something that might throw an exception
}
And then another method that calls the method above like so:
public method2() {
method1();
}
What is the convention here in regards to try-catch : Should it be in method1() or in method2()?
|
I've been implementing an authentication flow for an app that I've been making that uses JWTs. When a user is initially logged in or when they register (which immediately logs them in), I provide an access token and a refresh token. Access token expires every t hours but the refresh token never expires. I want to revok... |
I have to process biological data input in the format of 96-well plates.
explainer for the non-biologists:
These plates are basically a 2D matrix of 8 rows x 12 columns of small cups called wells. Each well is used for different assay conditions. During an assay each plate iterates through several assay steps: coating... |
I am handling a file with 1 million records and my customer creates this file from his code. I might receive hundreds of these files. I have to read these records and ingest them into a database. It is possible that some of the records might be incorrectly formatted and lead to parse exceptions. What should be the exce... |
We're creating a new API to add new Jobs into a legacy system. The question deals with how to handle creating a Job's required parent entities when you don't know the IDs of those parent entities to assign to. The structure of when a Job is created is as such:
A Job must be assigned to a Project.
A Project must be ass... |
I also had a look at How do I deal with side effects in Event Sourcing? but the solution wasn't clear to me.
If I store "EmailSent" event in the event stream, I might issue the external request to send the email again, thinking the previous send timed out, moments before the confirmation of the first email being succes... |
Let's say I have branch-1 (branched off master (major update)) and branch-2 (also branched off master (minor update)).
What is the best approach to do when I need to create another branch, e.g. branch-3 and I need to continue the work from both branches while their PRs are still pending?
And what do I do once both the ... |
I have been working on a python project for sometime which has been structured in following manner:
We have a function like this:
def execute_cmd(cmd):
(out, err) = subprocess.Popen(cmd).communicate()
return (out, err)
and this function is used over and over to execute binaries of a third party library.
I did... |
Suppose I want this on my User entity:
user.createNewSecurityToken();
That means:
public void createNewSecurityToken() {
var buffer = new byte[32];
new RNGCryptoServiceProvider().GetBytes(buffer); // <--- here's the issue
this.Token = Convert.ToBase64String(buffer);
}
This is not a DI dependency, just a class ... |
I am currently building a distributed system that consists of two separated nodes, connected over wireless Lan.
The processes communicate over a bidirectional TCP Socket and JSON messages.
For the application, it is quite crucial that all transmitted messages arrive at the receiver consistent in the correct order. Besi... |
I'm designing an API and I ended up having a few pure abstract classes. Because of the nature of the problem that I'm solving, each derived class has to be initialized with different sets of parameters. My solution was to basically define their constructors and pass the appropriate parameters when I'm making each class... |
Many projects need a set of various utilities. There is some discussion about where to place them. But what happens if the utility becomes part of the standard?
For example, C++ kept adding to the standard many useful functions. For example, std::clamp, or the random number generators. Many projects needed that functio... |
For a method whose signature looks like this:
public T Add<T>(T first, T second) where T : struct, IEquatable<T>, IComparable<T>
which can work with all of the integral types, do I need to write tests for each of those, e.g.
public void Test_Add_Int()
{
Assert.That(Add<int>(10, 20), Is.EqualTo(30));
}
public void... |
A new feature is being developed.
I want to test this feature in different scenarios.
We have existing tests that correspond to this scenario (but they test other features).
Should I :
insert new assertions about the new feature in these existing tests ?
create new tests specifically about that new feature (this wou... |
I am looking at Versioning Micro Services solutions and got a little carried away with OO design. Using WebAPI, I got to the point where I can use OO design to choose the correct version to run with only a single endpoint. But is it good practice to reduce the endpoints like this?
I admire the SOLID-ness/OO-ness of hav... |
Current situation
I'm developing a test-framework in python for end-to-end tests for a large ERP application. The AUT (application under test = ERP system) is structured in modules and provides a lot of different forms (e.g. to place an order), which need to be tested. The test-framework provides a high level API to ex... |
I need some advice regarding repository pattern. Let's assume i have UserBal which stands for business logic which uses UserRepositoryDal where all database logic for that entity stands (queries to table T_Users because my repositories uses stored procedures.) In my database i have table T_Users and T_UserTypes. In T_U... |
I am working on a project where clients are able to create objects in a database. Each of these objects has a description string that describes the object. Let's assume we are looking at an object that represents a car:
A red car manufactured by BMW with 62000 miles
A pickup-truck manufactured by Dodge from 2010
A car... |
I have written this function which checks if a user already exists in the application:
async function ValidateUserExists(username, email){
if(!username || !email) throw new Error('Invalid number of args passed. Please pass username and email');
let taken_valid_username = null;
let taken_valid_email = null;... |
I find myself lately implementing the same concept twice, once at a low level and once at a higher level. Let me see if I can explain it...
For example, given the notion of a database, I have one interface (say IDatabase) with methods like
void AddCompany(Company company);
which is what I consider "low level".
However... |
I'm working on a framework which builds on .net core Identity. Let's say I wanted to extend the IdentityUser<TKey> class with a ParentUserId property while the developer should still be able to decide which type to use for the TKey primary key. This property would be a foreign key to another user, but could be null if ... |
I have two tables in a database: A users_table and a items_table. I need a way to be able to define which items each user gets access to. I thought to create a third table containing: 'user_id', 'item_id', and 'has_access' columns.
The problem I am having is that the users_table as well as the items_table have 'active'... |
Before I ask my question, I want to note that this is not my own code; it comes from the Refactoring Guru website:
I often find myself using the code on the left, and I have one primary motivation for doing so: in the code on the right, you are unnecessarily pushing and popping a stack frame for the same operation t... |
I'm trying to figure out how to apply composition over inheritance to a system I'm building, and tripping up when I try to apply it to my page objects.
The relevant objects are:
PageFactory
Page
Route
[Entity]Repository (multiple)
The system is pretty straight-forward. The PageFactory is used to build and retrieve Pa... |
I'm working on a program that takes in user input which often includes things like math.sqrt(), imaginary numbers, multiplication, division, and similar (basically, standard math plus imaginary numbers).
Currently, I'm using eval() (don't worry, this is not the sort of program that is used on public computers and I hav... |
In relation to DHT's (distributed hash tables), how do decentralised systems deal with all nodes disconnecting and thus having its routing meta data invalidated? i.e with the implementation of DHT's in torrent clients, what would happen if all nodes (including the root/parent) were to become inactive? Would it mean all... |
I've been doing some studying on the types of inheritance. From what I've learned:
Single inheritance refers to when a class inherits another class.
Multi-level inheritance refers to when a class inherits another class that inherits another class, etc.
Hierarchical inheritances refers to when a super-class that has ma... |
I have to build an app that manages orders between customers who submit the orders and riders who deliver them. Riders work in shifts, so when a customer submits an order, only the riders that are active in that particular shift should recieve a notification.
I chose Firebase as backend for my app, so I'd use cloud fir... |
I am creating an MVC inspired PHP framework, mainly for learning purposes. I basically have the framework created and am building an app on it and improving the framework as i go along.
I am still confused/not sure about certain aspects of this sort of architecture, and at the moment i am questioning my implementation ... |
I have a c# library that sends requests to a number of HTTP endpoints and then tries to de-serialize the result into the specified type. An indicative method is defined as:
public virtual async Task<(T, HttpStatusCode)> GetAsync<T>(string resource)
The issue I now have is that I would like to return more contextual in... |
I am currently learning agile with a focus on project planning. I am having some issues aligning the teachings to the real world.
With agile I have learned, that we need to get customer feedback in every iteration, and we should include this customer feedback into our backlog so it is address, and we give the customer ... |
I've noted that fibonacci sequence is quite popular in planning poker, but is it a reason for that particular sequence? Wouldn't for example powers of 2 work equally well?
Both sequences are more or less exponential while fibonacci uses a factor of the golden ratio (approximately 1.6) so fibonacci has somewhat higher r... |
Context
I am currently working on a user management applications (UMA) that manages a data warehouse security management (users, rights etc.).
The data warehouse has production databases (and production users) + pre-production (PP) databases (and PP users).
UMA like any other applications has its own PP and Prod enviro... |
I have written a turn based game (Dominoes) using Scala and Akka actors, where a Server manage all the game state and the clients (Players) receive the new state every time one of them plays a card.
I would like to implement a web version for this but I am having hard time figuring out if this kind of schema needs or ... |
I have to write server (.net core) that is going to read data from 30 different remote APIs. I suppose to run some sort of decision trees, if I find something in one API goes to another API, else some other and so on.
Goes something like that:
if apiA.response.data has 'some info' {
//read apiB
if apiB.response.dat... |
Say we consider two inherently coupled elements, using a real-life like example:
Body
PhysicalIllness
Note: the following code is pseudo-Java for the sole purpose of syntax-coloring, pure syntax doesn't really matter here.
Body is a class that holds several basic properties, such as stamina, focus, etc., plus an arra... |
C# web scaffolding has an async call for every member. Why?
For example: Async for a login call makes no sense. User has to wait for validation. What else would the app do until the application validated the user.
Thoughts?
|
In my experience, it is often said that in event sourcing "an event must belong to one aggregate" and also "an aggregate is your biggest transactional boundary".
Why is this?
What harm would come of events like this:
{
type: "BoblesSent"
aggregates: [1, 2],
from: 1,
to: 2,
amount: 420
}
Seems like it could b... |
I am mainly concerned about how to create concrete objects properly when implementing different interfaces.
I have a resource whose variants can support different interfaces. For example, say I have two types of cards, C1 and C2. C1 supports blocking and unblocking of cards. C2 does not support that but the rest of the... |
I have two panels, one for the admins and the other for partners. And there are two OrderController with Admin\OrderController and Partner\OrderController namespaces.
They both look very similar. What is the best way to avoid duplicate code in two controllers.
They have two parts, the first part in authorising and vali... |
Let's say I have a database with a table called "invoices".
Then I have a web application where users can manually create invoices against said table. I also have a desktop application that can create invoices programatically. I may have other software modules that can all create invoices.
To manage the operations agai... |
I have an application in C# where several users access it.
Each user will have a serial key associated with his username in a table users in a local MySQL database.
Example of the table users:
User 1: Alan Serial Key: AAA-AAA-AAA
User 2: Bart Serial Key: BBB-BBB-BBB
User 3: Mark Serial Key: CCC-CCC-CCC
These keys ar... |
Why does C# make you put in a dispatcher for a different thread to update the UI?
Example:
Dispatcher.Invoke(() =
{
lblerrorName.Content = "";
});
It always gives the 'running on different thread' exception, but if it knows I want to change a label which is on the UI thread, why isn't it automatic and behind the s... |
We have several systems that hold the same data in different databases. The requirement is to keep the data synced in as much reliable way as possible. Performance isn't a concern because we don't have lots of users.
Currently, we're using RabbitMQ to produce events on data changes so that consumers are able to track t... |
I have to map a legacy database with tables that have a lot of fields and relations.
For example (simplified code),
@Entity
@Table(name = "VISIT")
public class VisitEntity {
@Id
private Integer Id;
@ManyToOne
@JoinColumn(name = "CD_COMPANY")
private CompanyEntity company;
@ManyToOne
@JoinColumn(... |
I am looking to construct a program that takes, as input, 576 [x, y, z] points as well as 576 corresponding distance values.
I want to find the [x, y, z, radius] parameters of a sphere such that the distance from each of the input points to the surface of the sphere matches as closely as possible to the corresponding ... |
Note this question is about when there are multiple relationship types. This is not the same as this question, where there is only a single member relationship.
Say we have persons and organizations. There are two types of relationships between them. One is employment and the other is customer.
I'd like to be able to... |
I've been reading recently about Event First approach to microservices where Event Store is a Single Source of Truth for all the applications (https://dzone.com/articles/data-consistency-in-microservices-architecture).
This is very different from Change First approach were we:
Save item to microservice database (in t... |
Given that when is supported in try...catch blocks, does it make sense to create a single CustomApplicationException class, say, with an enum ApplicationExceptionReason Reason property to differentiate "reasons" instead of creating a new exception type for each reason (it could have Flags, if multiple reasons are neces... |
In writing a split function that breaks up a sentence into each individual word based upon punctuation i.e. splits on something like the character class [\s,.?!]+, though for the purposes of this question the implementation is not important, and the list of characters to split on should be considered to be of arbitrary... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.