instruction stringlengths 34 36.1k |
|---|
I have a small Desktop application (Windows+Mac) that uses third-party API calls (RESTful) to collect some data and present results to users.
At this moment, the API calls (open and free APIs) are made directly from the client (approach #1). However, I am wondering if this is a bad practice.
As an alternative, I woul... |
For a report with 25 fields, there are a lot of decisions to be made for every column. Tracking them in a wiki, like what's below, drew complaints that the final field values couldn't be scanned rapidly and it was hard to tell what were open questions (despite using red text for the word "Question").
Column A
Que... |
I am playing with sequence diagram. And main question is how to draw properly on sequence diagram interaction with variable. How to draw
1) When MakePayment aggregates person
insurance.MakePayment(person.FirstName, person.SecondName, 20);
2) Variable assignment
internalVariable = SecondName;
I am not sure that I ... |
Let's say (just for the sake of example) I have three classes that implement IShape. One is a Square with a constructor of Square(int length). Second is a Triangle with a constructor of Triangle(int base, int height). Third is a Circle with a constructor of Circle(double radius).
Considering all the classes share the s... |
I created one webapi application which includes few modules like account, user etc and overall includes 10 or more endpoints.
I deployed this in EC2 instances and configured in application load balancer with domain in cloud front. The authentication used is oauth2 (bearer token)
All working fine and can access using do... |
I somehow get the point of REST API, like for example you want to get the list of customers to the database server, you have to request a GET method and the server will throw a response with a standard format like JSON, XML, etc.. If you want to create data, you have to request a POST method and the server will throw a... |
For example in addition "Open" action, "Compile & Install" be another available action when user click on package
|
So i want to make a crawler in python but not the usual UA/middlewares way.
My idea was a modulable architecture, which pass the callable class as arguments in a cli. This is kind of odd, i don't know if there any other way/framework which implement that.
Architecture detail:
I have a class Command which is pass with f... |
It strikes me why most of the sites don't talk about this topic. Recently, I've been doing some extensive research when it comes to NoSQL schema design, and evaluating the different NoSQL options (Focusing on MongoDB, and DynamoDB), and found out, through this video:
https://www.youtube.com/watch?v=HaEPXoXVf2k
That whe... |
Given a Person model:
Person {
int PersonId;
string Name;
string Email;
}
and an UpdatePersonDto which just updates the Name
UpdatePersonDto {
int PersonId;
string Name;
}
How should the repository handle the update process?
Accept the UpdatePersonDto object, fetch the current Person object from ... |
What are the best practices to extend Authorization to the Model layer if in a monolith MVC application (i.e rails) you have other entry-points than just the Controller? I.e background jobs, or the model interaction?
Regarding security
Normally we enqueue jobs in a queue, to off-load the main thread, then we have a tas... |
I'm reading about Observer Pattern of GoF, the UML in the book:
From the above diagram, how many Observer interface are there in a system if I have two different ConcreteSubject classes? Would they share the same Observer interface? Or is that each (Concrete)Subject classes should have its corresponding Observer inter... |
For my company i am refactoring our embedded C/C++ code base to increase re-usability for commonly used functionality. Currently i am refactoring our command line interface but i ran into a design issue.
Our core command line interface is good and stable as is but in some project there is a need or wish to add addition... |
I'd like to develop a microservice architecture application that sends text messages from one communication provider to another and I'm just considering changing architecture would be best suited to cope with large workload fluctuations.
A text message is commissioned via a REST api and then sent to Whatsapp, Telegram ... |
This is to ask whether accdb databases are suitable for this application, and how to connect the user with the database (and the phone network with the database if anyone has a comment on this).
I use an old pc program that downloads data from a local sensor, writes it to a small Access database (mdb), and gives the us... |
We don't have any frameworj like Spring where we can inject dependencies using annotations or xml file.
We have handler classes, service classes and dao classes.
Handler classes access service which perform business logic to get the data to be persisted into the db using dao layer.
Now I have seen that in our project w... |
I must design a database that store items that can be associated to a production. Production is only a identifier with no common attributes. But, a production may or may not have attributes (which are heterogeneous according to the production).
If I use a 3 tables design, I can put a foreign key on the prod_id of the I... |
I started a new job with a greenfield site in Angular to create a website from an old desktop app. I gave a presentation guided by my Supervisor who wants game style top icon menus to cut down on space usage, however it has now come to light that my supervisor wants the sites page's, width's and height's to be equal t... |
I have a CategoryClass (Aggregate root) -> SubCategoryClass -> and now a relational entity (n-n).
Category (root) 1->N SubCategory 1->N SubCategorySlotType (n-n)
SlotType (root)
My SubCategory only exists in the context of the Category and the SubCategorySlotType only exists in the context of the SubCategory. Is this t... |
I have code that follows this pattern.
Class Factory
build:
returns: Add|Remove|Stub
takes: property1, property2, property3
Class Add
execute: does something
takes: property2, propery3
Class Remove
execute: does something
takes: property2
Class Null
execute: does nothing... |
I am trying to come up with a solution to replace joda-time with java 8 time in our product. The code-base encompasses many projects of which some import joda-time directly and some transitively. To limit regression and to allocate multiple developers for the task an iterative approach of library swapping is required. ... |
My company currently has SVN as main version control and we are in process of migrating to Git. Doing that is a perfect chance to do a structure reorganization.
Before I get to that let me describe current situation and our use cases. We have one main product and 20-ish clients which have customizations in place. What ... |
Hi I am in middle of designing DB and Got a little bit confused about DB Design.
I am Using Hibernate as ORM Tool ahd mapping between Page and Step entity in hibernate.
@ManyToMany(fetch = FetchType.LAZY,cascade=CascadeType.REFRESH)
@JoinTable(name = "page_childstep",
joinColumns = @JoinColumn(name = "page_id"),
inve... |
I have started work on writing a tool to version the database schemas we use at work and enable migrations under version control. My first research into existing tools turned out to be too cursory due to searching for the wrong key words and I'm now aware of Flyway and Liquibase. Now I'm wondering if it wouldn't be bet... |
I first posted this question on stackoverflow but I think, it as more it's place here.
In order to limit the size of my REST API answers, I want to implement the Google performance tip: using the fields query string parameter to do partial resources.
If I have a full answer GET https://myapi.com/v1/users
[
{
"id": ... |
As some js files are very common and widely used on the web, why browsers don't reutilise them?
wouldn't it improve efficiency, as js framework files are usually heavy?
|
Today the job of most Java-based servers is to translate HTTP requests into SQL commands/queries and send a JSON-ed response back to the client. That's a pretty generic (and honestly boring) job.
I wonder is there a mature solution that can generate a working RESTful server out of my relational database schema? Possibl... |
I have a web application. I don't believe the technology is important. The structure is an N-tier application, shown in the image on the left. There are 3 layers.
UI (MVC pattern), Business Logic Layer (BLL) and Data Access Layer (DAL)
The problem I have is my BLL is massive as it has the logic and paths through the ap... |
When merging development code into the production code, what is the preferred method for handling items that should not be in the production code branch? For example, I have configuration scripts that are configured for the test servers in the development branch, and I have the same scripts also configured for the prod... |
I have searched well before asking this question, and some of the questions look like what I need here, but none of the gave a clear answer to my question.
I am writing a web application (in PHP if that matters) that is separated into multiple sub-applications (e.g. Auth, Database, Session, ...etc)
Each of of these sub... |
I've worked in Agile environments for many years. However, one of the things that I've always felt uncomfortable about is the idea that each story should map to an end-user request.....i.e., an enhancement that is clearly visible to someone using the application.
However, a significant part of the work in real-life so... |
I have an API that has a POST method to create a new Product. The creation of the new Product is handled by POSTing to a ProductService. Now I want to be able to instruct the API when creating the new Product to also add the Product to each Store.
What is the best approach to achieving this in a RESTful way? If I POST ... |
So i have a class called VirtualMouse, it is used to perform mouse actions such as moving and clicking.
public class VirtualMouse
{
public VirtualMouse()
{
}
public void MoveByOffset(int offsetX, int offsetY)
{
// Implementation.
}
public void MoveToPosition(Point position)
{
... |
I want to create a medium height panel with a long list on its left side and a details section on the right. This will be the help panel so that any unique command item selected from the left list will automatically display its description in the right hand side. Details are in a xml file. I've searched everything I... |
I'm confused about unit testing order. Many posts in StackOverflow say that unit test should be independent and small. IMHO, in the case of aggregation or composition, the member objects should be tested before the container object.
Let's say I have a Test_Procedure class.
The Test_Procedure object contains one or mo... |
So I am debating what approach to follow.
My scenario is :
Will receive a POJO which I need to validate ( REST end point )
Now I can explicitly validate specific fields ( which I know / are stated in requirements that they are mandatory )
OR
should I define the fields in a db table and define which are mandatory vs... |
Working on a Rails project at the moment, we're working on some mixin-type methods to provide descriptions for each of the models in the project.
There's a method called model_description which returns the description attribute of the instance of the model. I would have expected model_description to return a descriptio... |
I previously asked this question on Code Review but was told this was 'off-topic' so I am trying it here. I hope someone can help guide me.
As part of an insurance claims system we have created, the claims managers can log incoming telephone calls relating to a claim.
The claims manager must validate the caller by aski... |
I'm working in a team of 12 where we have around 8 developers and a QA. We do not follow a git flow model but we do have feature branches where individual feature developments take place and then these are merged to master and then released. As there are many developers and only one QA, the QA person always creates a b... |
My first time trying to implement API versioning here, and I need some guidelines on how to do it...
I know there are many ways of doing API versioning.
I'm already decided on doing it by uri (i.e, I'll have something like put mydomain.com/api/v1/resources/:resourceId)
The question is not about 'referencing' the right... |
Currently im injecting my Unit of Work inside the controller.
I figured out that in most of the designs, controllers calls the service layer and service calls the repository/DAL layer.
Most of the times in the controller, I don't have/need any logic and just need to fetch from db and pass it to view.
I do this by call... |
JSON
{
"hello": "world"
}
Protobuf
message HelloWorld {
required string name = 1;
}
Why do we say that protobuf uses binary format during network exchange and json don't, even though network always will transfer using binary data format?
|
I'm trying to implement the clean architecture and I'm not sure to quite understand when to reuse interactors (use cases).
Considering that we have one use case such as get user information and we would like to reuse it in different location.
Screen A: product owners decided to display very few user information (pictur... |
I'm developing a microservices based application and having trouble to understand how api calls should be organized between microservices ...
Suppose my application is a products management application.
As i understood each microservice should use it's own database , i'm going with this pattern.
Microservice Category -... |
I am working on handling authorization for an application. I need some way for a command handler to ask the Authorization bounded context "Is this user allowed to perform this action?".
User account creation, deletions, locks, etc. as well as permission and roll management will generate the appropriate events.
The best... |
My point is that the actual code is more important than import statements. I often don't even need to change or see the import statements. Also, when I'm refactoring code, I usually finish changing the code first before fixing import statements.
I know modern compilers would be intelligent enough to pick up import stat... |
I'm beginning a small Web development project (maybe 20 tables initially). I would like to use a relational database for transactions, SQL, indexes, etc. I have limited needs for true objects, though.
Although the application will be written in an OO language (Java), most of the domain data work will consist of:
1. Pa... |
I'm looking at designing some new software for work, and I have been using EF Core quite a bit in my personal projects.
In my mind, EF Core generates queries for the underlying data provider which returns data. These queries are ad-hoc, or the same as running a query on the MSSQL database through SSMS or equivalent.
I... |
Let’s say I have two larges arrays of users with equals number of rows and I want to match them randomly and one to one(one from the first array,one from the second), I will first need to shuffle one of the two sets because I need to do this every x hours, and i don’t want matchs to be the same everytime.The problem is... |
Recently I was asked in a interview to implement to e-commerce site .
One of the requirement was to maintain cart details across various devices .(i.e) if user adds a book from his iPhone , and when he again Login from his browser it should be available just like amazon
Should I have to maintain a separate table to ma... |
I am in the process of building out a private REST API. This API is intended for machine to machine communication. In short someone else's server will kick off a job via CRON that pulls information from my REST API.
Reading through the OAuth2 RFC6749 I concluded my clients will be a confidential client since they can k... |
I do have this use case.
callers(APIs in same microservice or different microservices) wants to report different KEYS and VALUES as an audit as part of their methods.
There is a high possibilities that some of KEYS will be very common that majority of callers can report.
consistency is MUST when using KEY NAME from mu... |
The definition of a MDL from Microsoft is:
The operating system uses a memory descriptor list (MDL) to describe the physical page layout for a virtual memory buffer.
The definition of a Page Table Entry (PTE) on Wikipedia is:
A page table is the data structure used by a virtual memory system in a computer operating... |
Here is the known old way to iterate over the string:
for (int i = 0; i < str.length(); i++) {
char c = str[i];
}
However recently I have also seen in multiple places the usage of iterators:
for (auto i = str.begin(); i != str.end(); ++i) {
char c = *i;
}
I have no difficulties in understandin... |
We have a web application and our partners asked us to log in silently from their web applications, which would allow their users to make a single login on l to access our application instead of two.
Obviously, their applications are different from ours and need to remain separated. They also need to have their own sep... |
I have the web application that provides user with the interface to edit its character. When user makes some changes and saves them, I store it as delta in MongoDB. UI and backend communicate via REST.
But in addition, I want to store any change that user made on UI - like clicking the button, or updated some parameter... |
Let me show you the connection/similarity, which surprised me, between Observer Pattern and Command Pattern. The following is the Class Diagram of Observer Pattern:
The following is the Class Diagram of Command Pattern, which I have added an red arrow on it to represent there could be an inheritance relation between R... |
So I have built a Telegram bot where you can play a rpg. This is the class structure.
Creature
MobType <-- Creature
Mob <-- MobType <-- Creature
Mob1 <-- Mob <-- MobType <-- Creature
Mob2 <-- Mob <-- MobType <-- Creature
Where:
Creature contains functions shared with User class
MobType contains data from database table... |
I'm busy playing around with some training material to help teach some of the juniors the factory pattern.
Whilst writing the example, I can't help but think this might be an anti-pattern.
Lets say I have iVehicle which is implemented by iMotorVehicle which, subsequently is implemented by iCar, iBike and iTruck respect... |
I am thinking about starting an open source project and right now I am deciding what technology stack to use.
At the moment, my main coding experience is using C# and I am wondering if I can build a truly open source application using .Net Core?
I appreciate that this might sound like the answers to this question might... |
I came across several cases where people are validating the saml response (verifying the signatures in the xml using the IdP's public key). But, Why do we need to do that? (unless http is being used)
This might be a dumb question, but google is not much of a friend in this case and couldn't find much in saml specs.
Tha... |
I am facing a design problem related to the design of the user notification messages to be used in a web application.
Just for the record, I am working in a JS environment and use a json structure to store user notification messages. However, I think the actual tech stack I use is of no importance here, since this is m... |
The COCOMO and NASA datasets are widely used in most of the systematic literature review about software efforts estimations and I want to know the reason for it? I have read many papers which used these two datasets but no author has given any justifications about it. COCOMO/NASA are publicly available on PROMISE repos... |
We're implementing a REST service with three main layers: Controller, Domain, Repository.
The REST API is supposed to respond to error conditions with meaningful error messages. Suppose the general layout of a payload given to a POST request were something like this:
{ "name": { "first": "string", "last": "string" } }... |
Maybe this is stupid question but if I implement http patch, is there no good way to reduce the number of possible cases without exploding into a large number (2^n) of different cases depending on which parameters are present or null/None.
For a simple example consider an SQL table named "User" with columns FirstName, ... |
I have a small team where I'm largely the only person who reviews what goes into production and makes sure that the code introduced doesn't contradict business logic, no bugs etc.. I know a lot of this can be improved with tests and we often use them, however I see tests at most complementing the human code review (wha... |
In one of the existing batch process codebase, I can see a practice of JDBC Connection String is getting logged and also persisted. Logging or Persisting a JDBC Connection String alone may not be a security issue. Though, it's a little discomforting to make this information available to naked eyes. But is it a best pra... |
Which underlying system parameters have most influence on how fast a typical Java project (say dozens of classes and dependencies) builds?
There is a lot information on JIT (bytecode to CPU instructions) compiler optimization, but what if you need a large project to compile (very) fast? Say, 10 times faster? 100 times ... |
I'm thinking about defensive programming here, through model driven design. I would insert null guards where a property must not be null, but would use a Maybe struct in the cases where it's admissible.
However, I'm not sure how to explicitly model in OCL when a property can or can not be null.
|
Brief background
I'm currently designing a COM DLL in .NET for use in MS Access by a few other developers. The Access application is hooked up to a SQL-Server & is supposed to just act as a front-end, but currently it pretty much does everything. Ideally we would like to separate the business logic into a separate enti... |
Just looking for some advice. I have to write a Software Analysis Document for a new application, which basically is to write and describe all use cases.
First, I have to list all use cases of that application, like this:
However, I'm wondering if it would be better to show those uses cases by groups.
I don't know if ... |
Currently, we had a web app that integrated with SSO through Open-Id protocol
Then we got another client that had it's own SSO and need us to integrate with their SSO through SAML protocol so their employees can authenticate and use our site, then another client came with another SSO (SAML protocol).
the fast solution,... |
We use WordPressEngine and want to have multiple developers and multiple branches using git.
One challenge is how do we incorporate the database into the workflow? Should we take a sql dump and incorporate that in the commit?
Another challenge is due to the fact that WPE only gives you 3 environments. So, if developer ... |
I'm building a web application that has a feature which allows visitors to directly access resources using URL patterns, for example:
www.site.com/client/[clientID]/orders
www.site.com/client/[clientID]/orders/[orderId]/details
These URLs can be static or dynamic links from other applications/sites. The URLs are secu... |
This question is related to How should an `Employee` class be designed?
In the above question, to uniquely identify an employee, each Employee object has an id field as shown below
class Employee
{
private int id // id is given by the database
// Employee data (let's say, dozens of properties).
//methods... |
Let's say I am writing code to run a machine similar to a 3D printer and I have a routine like:
machine.moveTo(x1, y1);
machine.alignByCamera();
machine.heatUp();
machine.extrude(amount1);
machine.moveTo(x2, y2);
machine.extrude(amount2);
I want to add a new optional feature to keep track of process history. Let's say... |
I have a big codebase yet to be covered with tests and rather limited access to the real data.
The code that needs to be covered is very data dependent. And the data is anything but shallow and trivial. So I had that naive idea to somehow make the data up. It worked well for simple data sets, but all goes south when t... |
I have trouble understanding why this boolean b = new A() {} instanceof A; is a valid statement and not boolean b = new A() instanceof A; and why the former is true knowing that A is an abstract class.
|
So I am going to be developing atleast 5-6 Res end points . ( all distinct and stateless )
Now I am debating on the following:
Should they be combined as single war / ear or deploy each service separately ?
deploying them as single war - down time during deployment should that be a concern ? ( with load balancer - id... |
I have a Software.
User will use software to process file,
But my software will use a other software or "Dynamic Link Library" of 3rd party.
Is "Dynamic Link Library" of 3rd party an actor?
|
I'm trying to pass a point to my team whereas there are two different kind of "programs" we can serve : applications and executables/librairies.
An application in this sense is dependent on other parts (think microservices), it has to match certain configurations or enforce certain security fix so it knows how to work ... |
I'm working on a Java application, it's a middleware between two ticketing webapps. I want to write end2end tests using Selenium to test functionality.
Let's say my testing process goes like this: I manually start a Jenkins Job, it compiles my app using maven, launches unit tests, then if the unit tests pass, deploys t... |
My Widget class has a method called loadWidget. This method needs to shuffle an array to work properly, among other things. In Widget, I could implement a Fisher-Yates shuffle as its own static method named shuffle and then call shuffle in loadWidget. However, this looks unseemly to me for two reasons:
The shuffling a... |
I have an old php web application, with very bad code.
While a lot of it just has html and ajax calls in the, the wrapper is still php.
I want to develop the new modules in react, and slowly replace the old php modules one by one with react; Instead of doing everything from scratch.
What would be the best way to merge ... |
I'm wondering how service oriented architectures can follow the 12-factor principles.
Designing an architecture as microservices means (to me) that you separate the features in services. This means you have multiple code source for the different services.
The first principle of a 12 factor application is "One codebas... |
Our current workflow is that we create a Sprint branch and then developers create Feature branches having the user story number. Once the story is complete this Feature branch is merged to Sprint branch by pull request where it undergoes code review. Once code review is complete then we raise another pull request to De... |
Recently I learned about GraphQL which claims to be superior to RESTful. However, I started wondering why don't we simply put SQL statements into an HTTP GET request.
For example, in GraphQL I would write
{
Movie(id: "cixos5gtq0ogi0126tvekxo27") {
id
title
actors {
name
}
}
}
Which isn't much... |
I'm writing a simple game engine and after a lot of rethinking/refactoring I settled with sort of a component based architecture (not strictly ECS, but it isn't inheritance based anymore either). So everything in my world is an entity, and each entity has got a bunch of components. Every system/subsystem in my game sca... |
In languages such as C or Java we have the concepts of the Stack and the Heap.
Are these abstractions the particular language runtime/compiler creates over the plain-old RAM? Or are these concepts inherent to the OS?
In other words, do the Stack and Heap "physically" generally exist in any application regardless of the... |
I have the following requirement:
There are about a 100 recurring jobs that needs to run every one minute.
This job has an IO intensive phase, followed by a CPU intensive phase, followed again by an IO intensive phase (total amount of time taken to run the job can vary from 2 seconds up to 50 seconds).
Its extremely c... |
I have the following homework question: You develop a video surveillance software that must run on real-time data. In one of the steps of the algorithm executed with each image captured by the camera, you have to sort some numbers.
Considering that the average execution time of QuickSort is better than that of MergeSor... |
Imagine the following situation:
1. Consume a 3rd party WSDL, out comes thousands of classes.
2. There's an opportunity to optimize performance by using a custom paralleled implementation.
3. Wsdl class structure has consistent naming convention: [RecordType][CrudAction]
4. Use Java Reflection to create type-less func... |
Do helper utilities like the one below violate the spirit of the Law of Demeter? It doesn't technically violate the law, since the doOperate method doesn't invoke C's methods itself. If so is there a way to work around this so that the container class doesn't need getters and potentially setters for every field in ever... |
I need a textual human readable format which is reasonably compact and version-control friendly to serialize a persistent memory heap. My Bismon system (GPLv3) has such a format (it is textual, human-readable, git-friendly, occasionally editable under emacs, but specific to Bismon. It is usually loaded and dumped by th... |
I'm developing software that calls a SOAP web service I've created.
My questions are about security:
Is it "enough" (about securing web service) to have my web site secured with HTTPS, and to call it the web service using HTTPS?
If not, how can I prevent "illegitimate" users/software from calling my web service?
|
Is the following implementation in PHP correct?
I focused on what they say about the lifetime of dependencies:
“Aggregation implies that an aggregate object and its owner have identical lifetimes.“
The implementation of acquaintance:
class B {}
class A
{
/**
* @var B
*/
pri... |
I have heard some people claiming that boolean state variables are generally bad and should be avoided when possible. Apparently in many cases it is possible to put state into lambda functions, instead of using booleans. An example to this approach is a conceptual implementation of C#'s Lazy. Lazy<T> gets a function-li... |
I'm learning about javascript's event loop, however I'm not understanding what a message is? The resources I find mention how the callback associated with events get added to the message queue, but nothing seems to explain what a message actually is. I'm assuming its different then the callback itself. What is the mess... |
I use entity framework with Repository Pattern. while searching for means of writing unit test cases that run isolated from the database I found some people mocking the database context and others mocking the repository pattern. I wonder what's the difference? and which is better?
|
Is there a generic way (useful formalisms) to think about data synchronization between two systems, especially in the case of slightly asymmetric roles (eg, one system contain master data, another one specialized set of data, overlapping master data), broken down to individual entities. For simplicity, mapped one to on... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.