All Questions

0
votes
0answers
5 views

Angular 7 - Injecting a State/Context Snapshot

Requirement There is some (for arguments sake) “global” application state that I am interested in injecting into components. Each candidate component should receive an immutable snapshot of the ...
0
votes
0answers
7 views

Need to make large JSON files searchable online

I have a collection of JSON files. File size is ~2-4MB each, however each file contains an array of 1-2 thousand complex objects. For a hobby project I want to create a website that allows these ...
-1
votes
1answer
24 views

How do I name a service that adds a line item to the quote?

I have an object called LineItem, which can be added to an object called Quote. A Quote can have 0 or more of LineItem. I have a service, which is a class, whose purpose is to add LineItem to the ...
0
votes
1answer
35 views

Is it a good design to create an interface that inherits from multiple interfaces to reduce the amount of dependencies of a client?

I was refactoring an application to respect SOLID principles. When I was applying interface segregation I found the following case: interface A { void methodA(); void methodA2(); } ...
0
votes
0answers
15 views

How to define a structure to store some generic “Variable” classes for easy access later

I'm running into a design problem. My code is in C# but the concepts could apply to any OO language. I'm designing a framework to run experiments, and these experiments have several variables which ...
0
votes
0answers
26 views

subclass with no logic of abstract class

I have a class named Change which should be abstract and have some basic methods. I have classes Insert, Update and Delete that extends Change. In the case of Insert, Update I just use extend and add ...
0
votes
1answer
46 views

Do i need to implement Security for my webpage, if it is only connected to a LAN

I am making a websocket server that can communicate with clients. This server is going to be on a private vLAN channel on a public place, AKA only the staff have access to the network which the ...
-6
votes
0answers
26 views

odd even c program read untill 0(zero) is pressed [on hold]

Hi I just begined my journey in programming. Can anyone help me find soln for this query.How to write a C-program to find the total number of even and odd number,avg of even and odd until 0 is entered ...
15
votes
2answers
1k views

How long to wait before deleting a deprecated method?

I am maintaining a public API and have to deprecate a method. Is there a general rule on how many months/years/versions before the deletion I should deprecate a method?
0
votes
1answer
39 views

DDD - Handling temporary inconsistency when handling domain events

I realize that DDD advocates eventual consistency, thus allowing for a certain period of time in which the system might be inconsistent. Embracing eventual consistency, we can therefore model our ...
-1
votes
1answer
37 views

Working around not being able to execute code in super class after constructor of child was initialized

This annoying situation: interface FooProvider { Foo getFoo(); } abstract class A implements FooProvider { final String stuff; A(String stuff) { this.stuff = stuff; ...
0
votes
1answer
40 views

Best route naming convention when a RESTful GET needs to be a POST

I have a REST API that has been built on top (in front of) a legacy system, to allow 3rd parties of various platforms to interact with the system. Most of the time, I can define a resource and create ...
-2
votes
1answer
22 views

What is an integration test pattern for an extensible permutation of cases (e.g. dimensions of seed data and filtering by said dimensions)?

Suppose we have a service that returns users in certain categories, e.g. Listens to a certain artist. Listens to a certain playlist. Listens to a certain genre. Is between ages X and Y. Is located in ...
0
votes
1answer
151 views

Does it matter which branch I push to?

My question is around how branch pushes work exactly; I have come across something that doesn't make logical sense to me and as such would like an explanation as to why I am experiencing this ...
-2
votes
3answers
118 views

Is storing configurations in memory more performance and maintenance efficient? [on hold]

My teammate has this class which contains a lot of Strings: public class Config { /** * List of status */ public static final String IN = "bla*"; public static final String ...
1
vote
1answer
140 views

When to create more microservices rather than inner functions

I'm trying to architect (breakdown) one application we have at my work in a few microservices. Before starting going down to the rabbit hole, I wanted to ask: when is a good idea to create another ...
2
votes
1answer
100 views

Callback pattern - return value confusion

I have a ConstraintsResolver class which resolves a queue of Constraints. This is done when a ConstraintsResolver object calls meetConstraint() on a Constraint one. Most of meetConstraint() ...
-4
votes
1answer
80 views

Renaming ⊈ refactoring?

Is renaming variables a type of refactoring, or is refactoring something different? In other words, what's the difference between renaming and refactoring? I thought they were the same thing. "Code ...
-3
votes
0answers
22 views

Download & Extract Linux package repository to S3 [on hold]

I want to create a pipeline, which will: Download packages and the sources from some Linux package repository (let's say Debian, but it should work on any repository in the future). Extract all the ...
-2
votes
1answer
46 views

Inventory Management Architecture - Databases/Threading? [on hold]

Inventory management for a company is always single threaded? I am currently trying to explore possible solutions or workarounds for a new Inventory/stock management solution. How is amazon doing ...
-2
votes
1answer
29 views

Design of a Distributed System to Uniquely Assign Identifiers to Each Node

Let's say I want to design a distributed system whose only purpose is to assign each running node a unique identifier in some small range (Say, 5-100 nodes into a 10 bit identifier). When a node is ...
-2
votes
0answers
59 views

Is putting related functions into a stateful class just for testability purposes a code smell?

Take the following JavaScript module as an example of a utility class helper file that exposes many related utility functions. This module initializes the state of module and the exported functions ...
0
votes
0answers
16 views

Service Design - Data-orientation vs. Role/Goal-orientation

For a simple web application, I am designing web services to expose the application functionality (mostly data storage / retrieval, but also data processing). As the application is not too complex, I ...
1
vote
1answer
20 views

Cross-aggregate operations, use domain service or domain events?

I'm refactoring a settlements module in a large healthcare application. I'm trying to follow DDD. Let me give you a short and simplified description of the refactored code: A patient has an ...
0
votes
1answer
155 views

Wrong use of factories in Java libraries? [on hold]

Some of the Java libraries I have used so far seem to have a Factory for seemingly every other class in the library. Apache's FTP Server project, for example, provides a UserManagerFactory class which ...
0
votes
0answers
13 views

Handling coherent state changes in DB through API

A simplified version of my DB: Appointment id INT PK datetime DATETIME AppointmentChangeRequest id INT PK user_id INT FK appointment_id INT FK request_datetime DATETIME ...
1
vote
3answers
181 views

what is the best way to write a recurring code with different enums

Basically what this code does is to determine whether the user is allowed access to the page or not from list of pages as enum, each one has the role name as its name and the page name inside it. The ...
35
votes
6answers
7k views

Why use trailing newlines instead of leading with printf?

I heard that you should avoid leading newlines when using printf. So that instead of printf("\nHello World!") you should use printf("Hello World!\n") In this particular example it does not make sense,...
0
votes
1answer
39 views

how to model 2 objects that refer to each other in the DB

Now I have 2 objects which are "PROBLEM" and "SOLUTION", obviously "SOLUTION" is a proposed solution to a given "PROBLEM", my problem is that in my business I have the following relations: 1- a "...
2
votes
1answer
117 views

Unit Testability of Builder pattern

I'm looking at the builder pattern for helping setting up dependencies and parameters that may require complex logic for a class. But from the examples I've seen, the builder pattern does not seem ...
-4
votes
0answers
38 views

Deep learning beginner project in neurology? [on hold]

I seek to work on a deep learning project in the field of neurology, with required knowledge not notably greater than that offered in Andrew Ng's courses. An existing project applies deep learning to ...
2
votes
0answers
27 views

Create clean/blank MacOS filesystem for testing OSS

In developing/testing OSS libraries I can replicate a clean Linux fs using containers. However, if I want to test oss libs for MacOS end users, I seem to be in a bit of a quandary. Is there any way to ...
-1
votes
1answer
39 views

Create web app, android app and ios app

I am am apprentice who primarily works in .NET, ASP etc with my main language being C#. My question is fairly simple, and I couldn't really think of a way to search it other than to ask it. ...
0
votes
2answers
83 views

In which way Haskell limit side effects?

From what I gathered from learning Haskell, functional programming limits the amount of side effects, but in what ways? Hope someone can enlighten me on this one.
1
vote
0answers
54 views

Is there a name for a “multi-instance singleton pattern” — returning a reference for a same-valued object?

I am tasked to write an assembler in C, which lends itself sufficiently well in certain design-pattern scenarios, and in a parsing phase, after tokenization, I need to "fill-in" certain information ...
0
votes
1answer
33 views

Modeling entities for company invoice management software

I am making a software to store all my company invoices (and then infer some statistics about it). The idea is: My company issues invoices to it's clients. My company receive invoices from it's ...
2
votes
2answers
35 views

PHP Sort question

I have a camera based security system that uploads all its images via FTP to a folder in one of my hosting accounts. (FYI, I use it to watch my cats when I'm traveling). So I created a PHP file to ...
1
vote
1answer
54 views

Using generics on interfaces when implementation is not generic

Is it acceptable practice to put generics on an interface when the implementation will not be generic? Lets say that my project will have many classes that read data from the database. I may make a ...
-1
votes
0answers
14 views

Is there a name for the 'application class' pattern used by python's Sphinx package?

As background, I learned to code Java in many years ago in high school and everything I have learned since then I picked up on my own. Currently I code in python, and I have decent experience in ...
0
votes
1answer
27 views

Define multiple DDD events or just one XXXChanged event when using CQRS?

Is it preferable to define a single 'container event' like below: trait UserStatus case object Active extends UserStatus case object Inactive extends UserStatus case class UserStatusChanged(...
0
votes
1answer
413 views

Why does the Square–Rectangle problem violate SOLID principles?

My previous question was just with class diagram and because of some comments I thought I try to find an example with a little piece of code for the diagram to see if principles correct understood? ...
0
votes
1answer
50 views

Does your web app accesses the backend directly or through an API?

I am trying to understand the use of APIs, so allow me to ask my question using an example. Let's assume I have a database with flight data and I want to make a web app where users can search, select, ...
-2
votes
1answer
51 views

looking to solidify understanding of OOP principles

I just wanted some feedback on my definitions of these terms. Abstraction - only showing relevant information and hiding implementation details. Interfaces and abstract classes are an examples of ...
0
votes
1answer
45 views

Why does YouTube save Restricted Content filter locally?

I was scrolling down on my YouTube Homepage and found that beside the filter marked Restricted Content, a point mentioned that the setting of this filter applies to this browser only. Here's the ...
-2
votes
0answers
23 views

Multi-client web-app structure [duplicate]

I'm starting a new web application, and I'm considering how to design it for multiple clients. Each client would have a completely separate interface on a different subdomain, but this can be hard to ...
0
votes
2answers
37 views

Void Or Other Result In DDD Operation

If this is basic question sorry , but anyway it is a question . i am doing domain driven design , i know about RootAggreegate , Anemic model , Rich Model , Domain Services , and ... but still when ...
0
votes
1answer
54 views

Shell Script does not capture values inside ENDSSH

I am very new to writing Shell scripts and am trying to write a simple script to run Vagrant up then SSH into the box and run some commands. The echo Hi there will run but the read -p will never show. ...
1
vote
1answer
51 views

Design pattern for common properties: static properties or a separate single instance class?

I need to create properties that have values common to instances of a class. I'm unsure how to solve this problem, so I could use some help. (This is in C#, but isn't a language-specific question.) I'...
1
vote
0answers
22 views

Domain Service vs Domain Events

What is the difference between using domain services and domain events? The thing I can see is that domain events allow you to further decouple your domain model and get away from using domain ...
1
vote
1answer
44 views

Logging patterns from within library code

I am looking for a design pattern for logging from within library code. Suppose I have a function in a library file that i expect will be used by multiple front-ends (lets assume a CLI and a web): ...

15 30 50 per page