instruction stringlengths 34 36.1k |
|---|
Where the application has the ability to mark dropdown items 'inactive' - this means to the user that particular item is no longer in use and should not be shown in dropdowns. However, it is used on existing files (has FK relation) and therefore cannot be 'deleted'.
When loading datasets for lookups, how to account fo... |
My research indicates that the ideal database design is:
Mobile App -> Local Database -> Syncing -> Remote Database
using something like PouchDB to do the data replication/syncing.
But wouldn't it work just as well, if not better, to simply skip the Local Database step?
Mobile App -> REST API -> Remote Database
Note ... |
I'm working on a feature where users can get data based on the if statement they write. The if statement looks something like the excel's conditionals.
Basic syntax:
IF ( lhs == rhs, ifTrue, ifFalse)
Examples:
IF ( (2 + 2 - (2 * 1)) == 2, "Equal!", 0)
IF ( "ABC" > "a", IF (1 == 1, 100, 200) , 0)
IF ( "hello world" == c... |
I'm building software with 3 layer architecture and asp.net core , as you know the Dependency Injection is Built Into Asp.net core
As i know the 3 layer architecture diagram is like this:
According to above diagram we don't have any direct connection between Data Access layer and UI layer
My project is:
My questio... |
In my project, I have two type of Service Class :
The simple one, they are interface that use the DAOs
The complicated one, are Rest Api Service
The Rest Service will make call to an API, and map the resulted JSON file as a mapped Object. Till here, there is no problem.
But, the thing is, that I had to make Unit Tes... |
Given a number of intervals:
-- (1, 3) a
- (2, 3) b
-- (2, 4) c
-- (3, 5) d
intervals = [(1, 3), (2, 3), (2, 4), (3, 5)]
I would like to generate the minimum number of groups so that in each group any 2 intervals overlap.
[a, b, c]
[c, d]
Please note that (1, 3) and (3, 5) are not considered overlapping int... |
Under orchestration it is pretty straightforward to return errors upstream (to the client).
Client <---> Orchestrator <---> Service A
" <---> Service B
" <---> Service C
The orchestrator can wait until all the responses from services A, B and C are received, before retur... |
There are plenty of resources that explain what unit and integration testing are and why they are important. That is not what I am asking here.
I am trying to understand how unit/integration tests are run and how they work.
I have a very tenuous grasp of how these tests work behind the scenes and I'd like some help in ... |
I find myself often looking up questions online, and many solutions include dictionaries. However, whenever I try to implement them, I get this horrible reek in my code. For example every time I want to use a value:
int x;
if (dict.TryGetValue("key", out x)) {
DoSomethingWith(x);
}
That's 4 lines of code to essent... |
I've been struggling with modeling something out correctly, the DDD way.
The use case is quite simple. You're a User, and you can be part of a Group. So we have a 1 - many between group and users ( both are aggregates ).
Now, a user should know about it's users , so it contains a list with user ids ( I'm not putting a ... |
What is the meaning of the words asynchronous and synchronous in computer science?
If you google the meaning of the words you will get the following:
Asynchronous: not existing or occurring at the same time.
Synchronous: existing or occurring at the same time.
But it seems like they are used to convey the opposite m... |
I'm working on an e-commerce solution and as part of this we have concepts of things like Stores, Currencies, Payment Methods, Shipping Methods to name a few. For each of these, we have an admin interface so developers can setup a new currency or payment method and configure it's settings. For example, for a currency t... |
I have a schema containing contracts, sub-contracts, services offered by each of those, and sub-services.
I also have an application that allows me to extend the duration of the contract and to modify data on the services and sub-services.
I've been thinking about the best way to keep track of the extension and I've fo... |
Consider this example system consisting of the following resources: Family, Person and Role. A Family and Person has a many-many relationship and each family member has a certain "role". For example, a family may consist of persons with the following roles: a mother, a father and two children, but the parents may thems... |
In Kotlin, specifying the return types of functions and the types of variables is usually optional but can be optionally included.
I've encountered a few benefits of including them:
It sometimes makes type errors more understandable as when types don't match it helps the compiler determine which is wrong and which is... |
We have two-week sprints and our PO organizes grooming activity when it's needed looking after that it should not exceed more than 10% of the development time.
Question is:
- Should refinement activity be ''locked'' in the calendar?
- Must all of the members in the Scrum team participate in it?
My concerns:
- If all... |
I have a simple service that fetches an article from the repository. If it finds it then it returns it otherwise throws an exception. In short the function is totally dependent on the database interactions.
public class ArticleService {
private ArticleRepository articleRepo;
public Article getArticle(Long art... |
This is the case:
A new team which consists of 6 people. They are a new team so there is no velocity that can be used for further sprint planning.
A problem:
The project manager wants to know when the project will be finished. We have the user stories stacked in the product backlog and now we need to estimate them.... |
We have a big angular project that works with several APIs provided by other projects. This project has a common part that is shared by all. It includes smaller sections dedicated to different teams and back end APIs.
My question is "How to divide these sections into different teams through the git so that each team ha... |
I'm working on a console extender project and I'm getting to a point where I feel I need some refactoring.
The only public class in the project is called ExConsole, and to make it just as easy to use as the standard Console class, it's also a static class - however, I'm starting to think that's not such a great idea ... |
Recently I've been trying to explain pointers in a visual way, as flashcards.
Question 001: This is the drawing of a location in computer memory. Is it
true that its address is 0x23452? Why?
Answer: Yes, because 0x23452 describes where the computer can find this location.
Question 002: Is it true that the charac... |
We have a use case where an AWS Lambda function is called from AWS API Gateway on user request from the browser, it fetches data from the database and returns back to the client.
The amount of time taken to retrieve the data or the amount of data depends on what filters the user has selected. Do you think the Lambda fu... |
Definition of Done and Definition of Ready may be very helpful in the organizations that are new to Agile methodology and Scrum framework.
Must all teams share the same DoD and DoR or it can be adaptable?
|
I have two models Permission and Role, now in roles/create, I need to show all the available permissions to allow admin to select the permission and create a role, now should I import both PermissionRepository and RoleRepository in RoleController and pass to roles.create view or I should retrieve all the permissions in... |
There is an increasing interest toward GraphQL and Falcor across the Web. Each time I see an article or discussion about those, I get reminded about SQL, at least its DQL part.
Obviously, sending raw SQL queries over the wire gives the client too much power; however, with the most recent versions of DB—Postgres could b... |
We have an off shore group that is responsible for a SOAP service.
The service has a method that returns a key as a string, when everything goes correctly. When it doesn't the key is an error string. A short pseudo-code demonstration:
var key = soapService.GetKey(username, password, moreFields);
var assignments = soa... |
I get a database every month with the prior month's data in it. There are three types of data: flag settings, demographic and transactional. I need to import the data into my standing database.
My original plan was to just add a date field to every table and populate my standing database with the new data. As ... |
I'm creating a new project usin Nestjs, which I'm really starting to like. I cannot figure out though, what the right way is for separating Business layer and Application layer.
Following the tutorials on the official Nestjs docs logic is usually separated into modules. This is approach feels natural, except the same ... |
I'm currently working on a C++ project in Visual Studio and can't make up my mind on how I should be organizing my files. As of currently, my file directory looks similar to the following.
->source
-> game
->file1.cpp
->file1.h
->file2.cpp
->file2.h
->...
-> libraries // ... |
I am working on a machine learning project at the moment which requires me to transfer the data from an old Java app(which is also the custodian of the data in current paradigm) to a python service which will do all the machine learning related stuff. So, I have data to the tune of a few GBs that needs to flow through ... |
I'm learning DDD and I'm wondering if it's ok to invoke domain model logic from inside the repository layer? I don't mean that the business logic exists as part of the repository, merely that the repository calls the business logic of the domain model.
I've been reading a lot about DDD and it seems that the Service lay... |
I am working on introducing unit testing to a class in my project which is responsible for verifying customers according to a specific criteria. For clarity, let's say one of the methods in my class is shown below:
public static MyCustomStatus IsCustomerVerified(int OrderId, int customerId)
{
MyCustomStatus result = ... |
I have a group of classes (let's say B,C,D,E) that basically represent specific operations a user can execute. I would like to have a single point of access for creating these object and launch their executions.
My first idea to accomplish that is to create another class (let's say class A) which will hide the complexi... |
Let's say I'm maintaining a piece of software that I version following the semver spec. I am also maintaining a docker image for said software, tagged with version tags.
What do I do if I need to publish an updated docker image even though the underlying software hasn't change? Maybe there is a security issue in the ba... |
In our solution we have a couple of projects, a project for data layer, service layer, business layer. etc.
Inside the business layer, we use models to transfer data from classes to classes. Is it good practice to make these models and all their properties, methods and constructors internal?
I just realised, if a class... |
This question relates to a somewhat more specific case than the one discussed in How can I create a RESTful calculator?
It should be assumed that the values to be calculated are not simple integers, but large and complex puzzles. Such a puzzle can also contain several subpuzzles. Both can be stored/read as resources on... |
I have an angular 8 application, with a Python + MongoDB API on the backend.
At present, I have 4 collections, namely: Users, Tasks, Companies and Groups.
All of these resource types are retrievable via the API on their own routes.
In all collections except from groups, the objects reference at least one object in anot... |
The gateway uses Rabbitmq with Masstreansit to send commands to services. Some of services require event sourcing in their internal architecture. Since I need my aggregate states available, and the system requires speed, The actor model seems to be a good fit, but require to deal with a couple of issues:
The actors sh... |
In my current project, I am trying to implement an environment to perform simulations of different workflows in a range of programs, websites, and mobile applications. These simulation subjects can run in different environments, such as inside a docker container, inside a virtual machine, or on a remote physical node, ... |
Lets say I have the following interfaces
// used by generators and other read only systems
interface IRealmProvider
{
Tile GetTile(int x, int y);
}
// used by interactive realms that can be modified
interface IRealm : IRealmProvider
{
bool SetTile(int x, int y, Tile tile);
}
// used by realms that have a fixe... |
I am currently making a game project that will have players play together. And i am basically planning to do it by only sending player inputs and have each client run the simulation on the pretence that the math will be fixed point throughout.
I am wondering if algorithms like A* path finding needs fixed point or are ... |
When everything seems to be a collection, how do you enforce rules for members of said collection without the use of an interface?
As far as I am aware, in languages that don't fully support OOP features (like JS) you cannot control that each member must either be of certain type / return a certain type / structure. It... |
In a Service Oriented Architecture, is it a violation of its general philosophy to have a service that is responding to a request put another request on the service bus to fulfill said request? Or should the original request have the dependency provided so that the service can handle the request without putting another... |
If I want a function to be idempotent, is there any framework, language or extension which can allow me to just mark the function as idempotent and the rest will be taken care of behind the scenes without me actually manually making it idempotent?
I believe it could get quite tricky to accomplish a general solution lik... |
I am using the fetch api in my handleSubmit function in a React component to post data like this:
handleSubmit(event) {
event.preventDefault();
var error = false;
var { username, password } = this.state
var mailFormat = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{... |
Consider a table of m columns where columns represents some smooth functions with potentially some minor noise. Each function is given for the same set of argument values. However, the rows in the table are ordered from smallest values to largest as opposed to each smooth function being in its separate column. For exam... |
For a project I'm working on that will help people learn Spanish, I would like to create a standalone service to handle the retrieval of data about words. For this, I've captured and codified data for a few thousand words from Wiktionary. Currently, this is in JSON format, but I intend to put it into a PostgreSQL db.... |
I am working on a Typescript library (to be used by many users within my org, possibly open-sourced) which provides access to some remote storage. I am contemplating between several variants for the main methods. Let's take the "query" method as an example. Here are several alternatives for its signature:
// alternati... |
Problem domain:
There are different types of financial products and I am trying to simulate them in different scenarios. Each of the product types requires different input data. Suppose the input data are organized with a database table, then the input data for a certain product may have its own total number of column... |
we are tackling the domain of https://en.wikipedia.org/wiki/Factoring_(finance)[factoring][1]:
Factoring is a financial transaction and a type of debtor finance in which a business sells its accounts receivable (i.e., invoices) to a third party (called a factor) at a discount.
we are facing a major re-engineering of ... |
I'm reading a book in Design Patterns, and below is some code example used by the author. The author tries to build a html builder as (code in C#):
public class HtmlElement
{
public string Name, Text;
public List<HtmlElement> Elements = new List<HtmlElement>();
public HtmlElement() { }
public HtmlEleme... |
I am new to UML and I have a best practices question. I would like to model separately:
logical architecture: logically interconnected software components;
physical architecture: physical installations of operating systems with possibility of physical interconnections like Ethernet;
mapping of one to another, modelled... |
I am confronted to a question regarding synchronisation between threads having shared data. This is a stripped down versino of my class :
class Foo
{
private:
boost::mutex m_mutex;
std:vector<float> m_data;
public:
void update()
{
boost::mutex::scoped_try_lock tryLock( m_mutex );
if( fal... |
We are a software development company with less than 10 employees. Each employee may be a part of multiple projects. Also, the project manager may look after multiple projects as well. We use Azure DevOps to keep track of work items in each project.
The problems we face are
Because we don't work on only one project, ... |
I'll come straight to the point. I'm trying to create a Recursive Descent Parser in C++ for a hobby project which involves creating my own minimalist programming language.
One thing that puzzles me, though, is a dilemma about global variables. Clearly recursive descent requires me to implement multiple functions for ea... |
I did a couple of simple projects following Anemic Domain Model . Now I am trying to do the similar type of projects in Rich Domain Model. But I am confused in implementations.
Previously , I used to have a domain model, entity and all of its logic used to reside in Services and persistence was made through repository... |
Say I have BusinessService & domain logic as part of MyProj.MiddleTier csproj which connects to MyProj.DAL DataRepository via interface IDataRepository.
I am using IOC unity container to build my dependency object graph. Composition root and BusinessService are all part of MyProj.MiddleTier (BusinessService is WCF base... |
I'm considering refactoring some Java code that passes around objects that implement the interface Map<String, Object>. The strings are all (as far as I know) from some fixed list of string literals. But as I said, I don't know which particular strings are used. I think it would be better if the Maps used an enum for t... |
The problem that I am chewing on comes from parsing, i.e. constructing objects in a sequential manner. The grammar is not prefix free, that is, there are more than one syntactical elements sharing the same sequence of terminals at the beginning. To condense it to a simple example, lets say we have
foo = "bar" ";"
fo... |
It is a common approach to use specialized exception types to indicate exceptional results of a method. These exception types are not considered to indicate a programming flaw, but, as I pointed out, are intendend to return exceptional results.
Let's assume the following base class:
public class MyCollection
{
privat... |
We are planning to move into Microservices. Currently on the design talks stage.
Thinking of how to versioning the releases?
Let's say we will start with 10 microservices. We want to develop them and deploy separately. Possibly every microservice in different point in time.
Then, when tested, each of them will become r... |
I know the question is a bit broad, but will give it a try.
I newly joined a backend team in our company that is about to release an app to external users, I noticed we don't have an operational plan, just basic monitoring and alerting, but I don't know how to come up with that plan.
I have some ideas but I am sure the... |
I am trying to get some preliminary insight into the pros and cons of using either a hybrid model (jsonb document-relational) or an all jsonb document store model for customer data in PostgreSQL. Both models would key to non-changing relational tables for non-customer specific information.
I am new to database design, ... |
I recently found Googles pytruth package. I am very used to pytest and I am wondering what the value of the way less commonly used pytruth is. The only reason why I didn't directly discard it, is that it comes from Google.
From the README, it seems to be mainly (only?) that you have the following ways to write assertio... |
I found this question about sub systems & UseCases, just I lack understanding / mapping to my specific situation.
I want to model which sub component fulfills which UseCase realized by my system component10.
(I use sub component and sub system simultanously - mistake?)
my pov
I show first my component diagram:
there ... |
I am working on a project in which I am following clean Architecture from Google ... and for making code testable I am following an approach in which,I am creating a new
ViewModel Class
ViewModel Factory
Dagger Component
Dagger Scope
for every single screen which makes it independent from all other classes which is G... |
I have an Azure SQL database with 20 million + records that i need to manipulate (including joining other tables, etc) before inserting into Azure Search.
The procedure needs to be reproducible in case i need to rebuild the Azure search index.
Some of the data in the search is quite complex i.e. a json model.
The routi... |
Back in the 2000s a colleague of mine told me that it is an anti-pattern to make public methods virtual or abstract.
For example, he considered a class like this not well designed:
public abstract class PublicAbstractOrVirtual
{
public abstract void Method1(string argument);
public virtual void Method2(string argu... |
I'm working on a website using server-side rendering approach. I'm using React and Redux for this. Redux handles the state of the application and provides API to change the state. All asynchronous data fetching is done via Redux.
The problem is that a URL may be like example.com/news/:param where param is some dynamic ... |
In our environment, we often have to import CSV files into a database, where each line represents a record. Though there is no actual business use case for storing the original line numbers inside the record, I noticed that storing them helps for debugging or tracking back certain records.
So does it make sense to make... |
I am new to the concept of DDD (with CQRS) so please, bare with me for this moment.
I understand what are Aggregates, Entities, Domain Events and Commands but I really have a terrible time comprehending the relationships between them.
My questions are:
Does a Command, well, command an Aggregate to do something? Or does... |
When a major data structure has been changed in an app, what is the best way to handle such kind of errors in the front-end side so that the app doesn’t break?
For example, we have a list of users that used to have this structure:
user: {
firstname: “John”,
lastname: “Doe”,
// … some other properties
}... |
I have these concepts for a database application: Session, Subsession and File
A session can have multiple files
A session can have multiple subsessions
A subsession can have multiple files
A session and subsession are completely different concepts, they don't have much in common so they cannot be merged into one tabl... |
I have a REST API where authorised users sometimes need to make changes to data about their company. For the most important information (e.g. IBAN details might fall under this category), we need to implement additional security checks before actually allowing a change to occur. The aim here is to ensure that changes a... |
This question is different from What are best practices for testing programs with stochastic behavior? be cause it's particular to Regression testing.
We are building a chat bot, and for regression testing, we are planning to run the new system through all the conversational data that we have received till date. Then ... |
I am fairly new to database design and now trying to build my own forum-based application. The app will have nested categories as
countries > systems > levels > subjects
In every subject category, user access the same type of data e.g. user can post and answer a thread, can reply to each answer accordingly (Just like h... |
We have an app that receives a web service request, processes it and sends it back to our client by another web service call. There is a unique field in the request, a tracking Id, which currently follow the pattern [A-Z][A-Z][-][0-9][0-9][0-9][0-9][0-9][0-9]. It is better explainable with a sample in that format, let'... |
Case:
Several methods with same params validation inside, like:
public Response method1(...params...)
{
if (someCondition)
{
//do some stuff with side effects
...
return Response1;
}
if (someCondition2)
{
//do another stuff with side effects
...
return... |
Let's say process A has an exclusive lock on some shared resource. Is there a way to ensure that after it completes execution, Process B will definitely get the lock (as compared to say, process C being able to get it)?
I am coding in a language that is relatively less used, but didn't want to limit my question to a la... |
I'm trying to design an API for an object manager that registers and retrieves different related objects. When I want to retrieve an object, I can query it by its object id. I'm wondering if I should be returning a smart pointer or a reference in this case. Here's code to fully illustrate the design and some associated... |
I'm mainly a mathematician, and I am currently doing research into something that I would need to compute. Using basic Octave or Python commands makes the application unresponsive.
However, I have seen instances of where computers (even mine) can run such computations over time. For example, the Prime95 software from ... |
I am trying to understand the floating point system. Can the floating-point system represent all the real numbers within the range of (10^38) accurately? If so, then how is it possible? Because technically, we still have only 32 bit memory available (for single precision) and we can at most represent upto just 2^32 in ... |
Probably a trivial question but I just don't know how that piece of software would be called correctly:
I have a closed system (A) and an application on another system and location (B). The Application on System B needs information&data via TCP/IP from the closed system (A). Unfortunately system A doesn't provide an op... |
There are multiple microservices which are responsible for storing data dependent from user, e.g. user preferences on some products, user orders, etc. There is a scenario when user is deleted from user management service's database and the requirement is to also clear that user's data in other services' databases. Usin... |
I am implementing a REST API and need to validate the JSON API inputs for the CREATE and UPDATE endpoints.
The goal is to send a 400 error prior to doing any processing if the inputs are not valid.
In the past, like most people I have been using some sort of schema validation tool such as Marshmallow/Cerberus/Schema/Vo... |
Scenario
Let's say there is a Shop entity in my app. And two types of users: a Customer and an Admin. When a customer buys anything at a shop, that customer's visit is registered in the system (there's a visit counter per customer-shop).
So let's assume a shop is modeled the following way:
class Shop {
id: number;
... |
1
We are trying to redesign a database that currently holds thousands of parameters for different datatypes and currently has a flat data structure.
We generate XML files from the database, which our software application uses to load and display the required data. As the complexity of the data used by the application i... |
I'm new to DDD.
From my current understanding and from the examples I've seen in books or articles, DDD addresses the design of a software system to solve a complete domain problem.
So it figures out the domain models, use ubiquitous languages for communication between domain experts and software developers, find out... |
I have a situation where clients are posting query requests to an endpoint (a c# controller method), and the controller takes the data they post and figures out what query they want, then calls a stored procedure to retrieve the data, then sends the results back to them.
The problem is that these queries come in pretty... |
Consider the following example in a CRUD application. A user can select their favourite food from a dropdown list ("Burgers", "Pies", "Chips"). This is an optional field i.e. not mandatory. Thus a user can leave it unselected, or also update their data to unselect any choice.
Since the field is optional there are a num... |
I work for a company with 580+ cloud APIs (with every API implementing different functionality, but with a lot of overlap) and even more micro services. There have been many attempts integrate all those APIs into one API and data model with minimal duplication.
Before throwing technology at the problem, I am trying to ... |
Consider class below:
class FillTestBySerialHandler
{
/**
*
* @var FillTestBySerialRepository
*/
private $fillTestBySerialRepository;
function __construct(FillTestBySerialRepository $fillTestBySerialRepository)
{
$this->fillTestBySerialRepository = $fillTestBySerialRepository;
... |
It makes sense to give the server applications as much responsibility as possible as to avoid having to rewrite logic across different types of clients.
In my case I am developing a data structure that represents human relations (mother, father, sister, brother, etc.) the purpose is to query the data structure and get ... |
A PHP based webshop running on a shared hosting stores libsodium encrypted personal data in it's MySQL database. To let users have access to their own data, a design very similar to the one discussed in this topic is implemented: a key is derived from the user's password (PWKEY), which is used to decrypt the user's pri... |
Question 1
All participants in a sequence diagram must match a class in class diagram?
Question 2
All class that represents some object that is created by the system needs a class that creates it?
Example
I'm modelling a system (exercises) for automatic ticketing for bus transport that have these "requisites":
(regist... |
My problem is to classify input time series signal (128 points, equidistant in time, range 0.0..1.0) in limited amount (say 16) different classes. We have hand-classified 20000 samples and we are using 2000 as training set and other 18000 to evaluate our classification algorithm (test set).
In my analysis I found that ... |
With the factory pattern we abstract the creation of objects. But what if we need a specific configuration of an object that depends on the calling context?
Example:
So I have a Builder pattern for creating some types of objects that share the same interface
E.g.
private EmployeeBuilder createEmployee(EmployeeDataS... |
I'm trying to teach myself how to calculate BigO notation for an arbitrary function. I found this function in a textbook. The book asserts that the function is O(n2). It gives an explanation as to why this is, but I'm struggling to follow. I wonder if someone might be able to show me the math behind why this is so. Fun... |
Question
When an alt frame is used in a sequence diagram, and one of the two possibility end the sequence, how is "legal" to continue?
example
I need to represent a sequence in wich there are user and atm
the user insert card
the atm verify card
if card is valid, then it confirm card to user and the sequence continue
... |
I am looking for advice for doing "emergency documentation" for a large and complex software module in the technical/embedded domain, that I worked on for several years.
I am going to leave the company within weeks, due to some developments which don't leave me another choice. The domain is more quality-conscious than ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.