Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [design]

Questions about problem solving and planning for a solution through software design.

2
votes
1answer
79 views

If you can store BigInts in a more optimal way than an array

This suggests just storing BigInts as an array: // n = -123 var n = { sign: -1, digits: [3, 2, 1] }; However, if you have "big ints", that array will get large: var n = { sign: -1, ...
2
votes
2answers
164 views

Changing Behavior - Special case in a loop

I have a module as below: def normalize(sub_item): pass def process(sub_item): pass def cleanup(sub_item): pass def calculator(item): pass def main(item): for index, sub_item ...
0
votes
1answer
60 views

API DESIGN: Store Table of function pointers in client or dynamically in api service

FIRST AND FOREMOST: Forgive me if the following question falls into the "off topic" category of this StackExchange, due to its slightly opinion polling nature. This is not my intention, I am simply ...
2
votes
3answers
296 views

If URLs are broken, and how to fix them

I have been having trouble clearly defining/specifying how a URL/URI should be applied to situations such as search queries or different resource formats. The question is what an actual "uniform ...
2
votes
1answer
52 views

System design for multiple workers

I need to design a system where there are many micro-services which we can think of as crawlers that poll 3rd party resource and if they find some new information they pass it to some other service ...
3
votes
1answer
130 views

How to design a simple UDP server which could handle >10000 req/sec?

Currently I have implemented a simple UDP server using java sockets, as soon as the packet is received it is added to the queue and there are four consumer threads which process the queue. This ...
0
votes
1answer
53 views

What to specify as interfaces in component diagrams

I am following the textbook Object oriented software specification using UML, patterns and Java (3rd edition) and I am defining interfaces between system components (subsystems). But I encountered a ...
3
votes
3answers
220 views

Abstract Parent and Inheritance vs. Strategy Pattern and Composition

I'm currently refactoring a class that looks (after some refactoring and very much simplified) somewhat like this: class Foo { public: Foo(bool someFlag) : m_flag(someFlag) { }; void ...
2
votes
1answer
106 views

Microservices loose coupling using distributed business logic or centralized?

How do we achieve loose coupling in the below scenario: N microservices (let's call them Callers) needs a logic or business( let's call it Worker) to be executed with different contracts. Although ...
-2
votes
1answer
78 views

Relational Database Design with a table having redundant information

I am creating a database table that will store a single number 1 thru 16 in 2 fields (there will be many rows of data). I'm trying to avoid duplicating a lot of data and make my dbase most ...
0
votes
1answer
65 views

Would you implement an interface to connect to a database?

I found in a book (Learning PHP Design Patterns, Chapter 2, page 25) a text explaining the importance of interfaces in OOP design. The author ended up by giving this example: <?php interface ...
1
vote
0answers
176 views

Message Queues and Multiple Subscribers

My team is discussing using RabbitMQ for microservice to microservice communication (among other things). We are also supporting a SAP backend that will be pushing data to us in a method undecided at ...
1
vote
0answers
25 views

What are some design ideas for a data mapping and transformation application?

Here is a high level outline of the project: We frequently need to convert data from a new incoming system to our in house system (sort of a basic ETL process) We would prefer to do this dynamically, ...
1
vote
1answer
82 views

Private/Hiding dependencies between Maven modules

Given three project modules X, Y and Z on a Maven based project, and Y depends of Z and X of Y and X should not know that Y depends of Z, being this: X -> Y Y -> Z X -X> Z What is the best way to ...
2
votes
1answer
105 views

Using SPA ( Single-page-application) in production with separate configuration file/module

Problem statement dev team Dev team wants to pre-build the SPA's (Angular App & React App) and provide single package containing JS, CSS, & HTML file. There's no server-side rendering / lazy ...
-1
votes
1answer
128 views

Microservice to access databases [closed]

Our company is designing a new ERP based on microservices. The reason we want to implement microservices is because we noticed that some critical parts of the old ERP are being heavily used by our ...
1
vote
3answers
50 views

Calculating Journey Summary made by a vehicle and Cache them to database

This is more of a point me in the right direction kind of question, I have 2 solutions but both of them are invalid because the data calculated is invalid in some scenarios. I am working on a system ...
3
votes
2answers
108 views

Putting some business logic in repositories versus keeping it out of repositories entirely?

I know most (if not all) business logic should reside in its own layer, but what is the general consensus of putting some basic business logic inside of the repository layer itself? My scenario: We ...
1
vote
3answers
176 views

What are some strategies for eliminating switches in polymorphic dynamic code spread across multiple layers?

Context: design with correlated polymorphic classes For example, let's consider the following class definitions for representing messages that we would get from some remote service: class ...
2
votes
1answer
46 views

Balancer that delegates requests to servers and problem with Websockets

Lets have an application that has real-time chat feature. The chat requires websockets in order to function real-time. Now imagine we have "balancer" and 3 application servers. Instance of ...
1
vote
1answer
84 views

A performant and robust way to reset multiple files to its original state (TDD)

In our automated Java tests, we sometimes encounter issues, such as: Test A creates a custom file A.sh, that is then added on classpath Automated testsuite cleanup does not know about random file A....
1
vote
2answers
254 views

Best practice regarding interfaces between “typed” and untyped" languages?

Our frontend JavaScript / Vue code makes uses of a number of "internal" REST endpoints, which are implemented in Java using Jersey/jax-rs. We have an "informal" specification that lists the ...
2
votes
2answers
156 views

WCF vs ASP.NET - Binary IPC

I have a windows service and a remote IIS server that need to communicate without any user interaction. As I can’t guarantee the two machines will be on the same network; the service will connect to ...
0
votes
1answer
78 views

Cache vs DB design decision?

Number of times this question comes to my and my team mind, should we persist or cache the data. I understand some time there is functional requirement that we need to persist in DB. But in my case ...
1
vote
1answer
81 views

Which scenario is the best for service worker architecture?

We know about using service workers in modern web sites. Consider a scenario back-end as node.js and SQL Server. Data is loaded from central database to local customer web app (DB is about 700 MB) ...
2
votes
1answer
168 views

Handling hardware dependency while unit testing

I am writing a driver for an IMU sensor using test driven development approach. Communication protocol of choice is SPI. Using CubeMX and STM32F415 processor, SPI interface is implemented in ...
2
votes
1answer
65 views

Race conditions in client synchronization

I have a web app whose server creates a Client for each websocket connection. A Client acts as an intermediary between the websocket connection and a single instance of a Hub. The Hub maintains a set ...
5
votes
4answers
1k views

C# has no friend class - what are better options

I return to this question every couple of years, so now i decided to solve it once and for all, by asking here. So, the sequence: I'm writing a simple application that parses Json file (...
0
votes
1answer
91 views

Querying MongoDb after scheme change

The database schema of an application is rarely fixed, due to new development the schema has to change. This also applies to a schema-less solution like MongoDB. There is documentation on how to ...
3
votes
1answer
105 views

How to design a storage backend for a cloud spreadsheet?

As a personal project to learn key technologies, I am trying to build a spreadsheet on the cloud (something like Google Sheets). How would you design the storage backend to power something like this? ...
2
votes
1answer
69 views

Data points to use cache or database for these three major features under scalable ecommerce? [closed]

Auto-completion :- When we start typing, does system suggest the product from cache or hit the DB every time or hit the DB only when no result found in cache ? Search:- When enter any product, does ...
1
vote
1answer
96 views

Inventory management with limited time hold strategy - How do I protect from bad actors?

Some sites, like theater ticket reservations, place a limited-time hold on the item , while the order is being processed. As soon as you select the seat and proceed to pay, Seat is reserved say for 10 ...
-1
votes
2answers
334 views

How to refactor code with if statements which scattered everywhere in the code?

I have a serious problem with application which i working on. It has a lot of procedural code and now it needs to refactoring now.. The problem: we have two different application in general, but they'...
4
votes
3answers
123 views

Create a single class to map different object to a target object?

I have a service (S) that receives an object of type 's', this service will be called by several classes (maybe 6) and each class has their own object a,b,c, etc. with the information necessary to ...
1
vote
2answers
123 views

What is the best algorithm for implementing a system with a complex execution path?

I am currently working on an implementation that based on a set of user configurations should output a final decision. The multiple configurations are evaluated several times at different stages of ...
3
votes
1answer
251 views

Java web development

I started to develop web applications not so long ago, and therefore there are a lot of unknown things in this field for me. My question concerns web development using the Java language. Assume that ...
0
votes
2answers
41 views

Passing storage location to factory function vs storing it yourself

I have run across a bunch of code where they are essentially doing void CreateFoo(string foo_param_1, int foo_param_2, vector<Foo> *foo_storage) { Foo new_foo = FooFactory(); new_foo....
1
vote
1answer
107 views

Event Driven Microservice Architecture & Dealing with synchronous external neighboring systems

Let’s say I have an event driven microservice system - a microservice cluster - that takes orders and works with them. Orders are placed by an external neighbor system that is working synchronously ...
0
votes
1answer
74 views

Method for loading and running user defined code in .NET windows application

Are there any patterns that address how to have and application load and run user defined code at run-time? I am looking into developing a C# library that the users of a Test Executive application (...
0
votes
0answers
15 views

Hbase Spout or read all data from Hbase in Apache Storm

I have a Hbase table with around 200 million rows with keys as sha hash, so distributed from 00...00 to ff...ff. I want to either write a spout which gives me all the rows(preferable in batches of n) ...
3
votes
1answer
307 views

NodeJS (ES6): Design Pattern with bind usage

The question is related to the resolution of the this operator in Javascript classes. NodeJS now supports ES6 classes. The problem faced during this is that when a new instance of the class is created ...
-2
votes
1answer
102 views

what are the external dependencies that a class should have

from my class I include all dependencies in the constructor. to decide which dependencies to pass what rules should I follow? when I decide to use the parameters of a method instead of the ...
-3
votes
1answer
90 views

test class that include another class - Only one test or both

i have a sytem a that include system b and return the result. simple!. concrete example an API, one controller that internally call another class then perform the operation. route --> controller ...
0
votes
3answers
110 views

Should the name in the codebase always match how users refer to it? (example inside)

We have an internal tool where our account management teams can say "whenever we send this type of SMS message, use this text I specify instead of the default text". They would call this 'configuring ...
0
votes
0answers
35 views

Design of RecyclerView app in Android

I'm working on my first app that uses RecyclerView and while I am making great progress, I strongly suspect that my design needs some changes. I've asked in several places over recent weeks for ...
-2
votes
1answer
133 views

Design for 'inbox' with 'unread' feature

I am implementing a similar feature like the StackExchange Inbox and I have many considerations about the resource usage. My system has inbox messages, system health notifications and Achievements. ...
0
votes
3answers
78 views

Abstract responsibility from caller without introducing complexity

I have two classes: public class Child { public List<Vector2> localPoints; public List<Vector2> localEdges; } public class Parent { public List<Child> children; ...
1
vote
0answers
38 views

Separate UI applications vs single with logic for showing/hiding functionality

Currently my company has a single internal application that our support agents use. It only supports one product at this time. Tech stack is angular on the front end and spring micro services for ...
0
votes
2answers
194 views

If I modify a private field using another setter, is it a bad practice?

I have a java class where I have few booleans and one arraylist. If the boolean field is set to true, I need to add it to the arraylist. One of the ways I can do this is to use the setters of each ...
3
votes
2answers
78 views

Is there any design pattern available for pushing data from devices to cloud?

Hopefully I am posting a question in right forum. As per https://meta.stackexchange.com/questions/68384/whats-the-difference-between-stack-overflow-and-software-engineering-se-previo `software ...