Stack Exchange Network

Stack Exchange network consists of 175 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.

1
vote
3answers
111 views

Is it okay to have a class where some attributes won't always be used?

I'm designing an app which use a Knowledge Base filled with rules. Depending on the context some rules will be applicable and others will not. I need to get first the list of the applicable rules and ...
1
vote
1answer
47 views

What is a good way of satisfying open/closed principle in this case

I have a class that looks like this: class MyClass # takes an array of actions def initialize(actions) @actions = actions end def act @actions.each {|a| a.do} end end class ...
0
votes
0answers
43 views

Using rabbitMQ for an order management system

I am building an e-commerce app that allows you to buy products from an online store. I am struggling to understand if using a queue will be helpful. if so, how can I make use of it effectively? Let'...
2
votes
4answers
85 views

Make a class depends on its own ports instead of injecting dependency interfaces

I just have an idea about dependency management in Spring IOC environment that seems to be better than the typical approach, but I am not sure because I can't find any references or example out there ...
1
vote
4answers
176 views

In TDD, should we specifiy all classes to implement before start coding

My team is interested to apply TDD in our next software project. We have a discussion about how many details should be specified in design specs before the developers start coding. Some of us propose ...
1
vote
2answers
132 views

What is the best model to catch DB side error?

We have a web application that all update, insert and DB operation procedure handle via SQL Server DB 2017. What is the best way to handle and get error (in Web-app or SQL server error handler?). for ...
0
votes
2answers
71 views

How to separate responsibilities of a shared entity

Suppose I have game achievement class that stores achievement information like name, popup message, etc. class GoldMedal implements GameAchievement { @Override String getName() { ... } @...
-2
votes
1answer
48 views

Interface for abstract base class [duplicate]

I'm planning an application in C# which has a feature of sending messages. ATM I'm doing the non-businesslogics and frameworking stuff. The idea was to make an abstract base class which is inherited ...
2
votes
1answer
126 views

How can I optimize an alert system that processes 1000 requests / hour?

I am building a solution where IoT-devices send in measurement-data to an API that's hosted on AWS. For each measurement-type the user can set a threshold value; that when reached will trigger an ...
1
vote
0answers
54 views

Running medium duration critical distributed jobs every minute

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 ...
1
vote
2answers
37 views

JDBC Connection Url Logging - Security Risk

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 ...
1
vote
1answer
28 views

track user actions on UI and store them in the database

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....
1
vote
1answer
36 views

HashMap versus Object ? Which one is better to finally generate JSON output with KEY and VALUE

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 ...
1
vote
0answers
32 views

How to manage cart details across various devices

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 ...
0
votes
1answer
52 views

MVC Controller calling UoW (unit of work) directly instead of going through Service Layer

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 ...
1
vote
1answer
46 views

How to implement a partial resource rest api?

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 ...
2
votes
1answer
91 views

Design approach for extending class functionality - Embedded C++

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 ...
0
votes
2answers
141 views

handle server shutdown while serving http request

Scenario : The server is in middle of processing a http request and the server shuts down. There are multiple points till where the code has executed. How are such cases typically handled ?. A typical ...
4
votes
3answers
359 views

Authorization and Audit on models in MVC architecture

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 ...
1
vote
1answer
42 views

How can I track questions and decisions for each of multiple report columns?

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 ...
-1
votes
0answers
48 views

Layered architecture - what's the best way to share data?

I'm developing a project (.net core) which is still in its very initial stages. For now, I've divided the solution into multiple projects each of which represents a layer. For ex: Project.Web (react/...
0
votes
0answers
35 views

Implementation event-based game server architecture

I'm trying to develop a game server in Netty using an event-based approach where incoming events are dispatched to the correct game rooms, but I'm having some trouble with managing my world state. My ...
0
votes
1answer
37 views

Controller or application service making HTTP Requests

I'm in the school of thought of 'thin controllers', and love to push logic down into services and the domain models. However, I'm wondering if my controller should be making an HTTP Request to another ...
3
votes
3answers
210 views

What are possible benefits of using a class instead of a function here?

I often see classes of this form: class Thingy { public Thingy( /* some arguments here */ ) { // Initialize some member variables. // Maybe do some other things that // ...
2
votes
2answers
229 views

Algorithm for Parking Space Allocator System

In my office, there are 200 employees who come to the office in their car. But my parking space has slots for parking 160 cars only. Now I want to design and develop an application that issues parking ...
0
votes
1answer
16 views

Architecture for remote data collection using MySQL

I am working through a MySQL design issue. I have a server with a database of phone numbers used in nuisance calls, like robocallers. I also have remote clients that are provisioned. I want the remote ...
6
votes
3answers
544 views

How should I design database, where I have 30 users, each who needs full access to their data?

I work for something like a consulting company. I have a web application that I built for one client. Now around 30 other clients want about the same product. The problem is, I don't know where to put ...
2
votes
2answers
78 views

API Race conditions

I have an API in which we expect a emailID and a certain deal data. The case is we want to keep the dealId and contactId(email) to be unique. Creating a deal requires data insertion in multiple ...
0
votes
4answers
54 views

Extent of Administrator Capabilities: HR and Design Logistics?

So I am developing an employee management application on behalf of a company and am concerned about the extent of rights and capabilities that are to be bestowed upon registered administrator accounts....
-2
votes
0answers
41 views

What is the right way to orchestrate long running batch jobs?

I have a long running (3-4 hours long) monthly batch job that is scheduled to run on AWS with Python as it's implementation language. There are multiple python scripts which essentially needs to run ...
0
votes
2answers
49 views

Usage of composition relationship between two class in UML

I'm having quite a difficulty with what i think would suit a Patient class and a Record class in UML Basically the Record class stores the patient's information such as name, vitals, gender, age and ...
-2
votes
1answer
44 views

Advantages of using a message broker for scaling websocket client-to-client communications

I'm designing a system where pairs of clients need to exchange messages proxied by a backend service. My initial plan was to use websockets and have the clients connect to a single websocket server, ...
1
vote
1answer
67 views

Library with different runtime behaviour based on usage history (design question) [closed]

I want to design a hash table library that keeps usage statistics and based on how it is used will use different implementations at runtime. For example use a certain implementation for small size ...
1
vote
1answer
48 views

Functional Approaches to Serializing Objects to Variable-length Byte Array Output

I have a large number of record types derived from a binary format specification. So far, I've already written a computation expression builder that let’s me read structures from the files easily: ...
1
vote
1answer
273 views

How to avoid Super User account from business?

I have developed a package program 3 tiers architecture. Persistence layer is developed by using Repository Pattern and Entity Framework 6 Code First Approach. This package program has many features ...
0
votes
2answers
92 views

Design optimal read operation in my service

---- Description I'd like to optimize read operation in my service. It has basically put and get methods. On put I accept some numbers in a string format and put them into thread-safe cache with ...
1
vote
4answers
186 views

Object Oriented Design: Repositories and Inheritance

I have an OO design concern. Let's say my models as following: class Account {} class LocalAccount extends Account {} class SocialAccount extends Account {} These Account entities are persisted and ...
2
votes
1answer
112 views

How to write a class that uses other classes but needs the same functionality - should I just wrap around the methods?

I want to create a class ProcessHandler for Windows that pretty much uses the WINAPI. The class ProcessHandler should be able to scan memory, emulate keyboard and mouse, needs some DLLInjector, some ...
2
votes
1answer
116 views

How to model workflows

I'm building a helpdesk-type system, where there are: Customer - can submit/resubmit tickets; Manager - can review submitted tickets, assign to developers (one ticket to multiple developers), review ...
1
vote
1answer
80 views

Ideas for designing a system for processing status updates [closed]

Given that this question is related to my work, I will simplify what I need to do. The system consists of 4 primary types of statuses (internally, we call them events): Working, not operating ...
1
vote
3answers
139 views

Should we have one class for each responsibility?

Consider an Eg. of Library Management System, we can have a design where in a student can search for a book based on it's title from the list of books using a function, something like below (in c++) ...
2
votes
2answers
58 views

Syncing two Notifications and Merging them Into One

I am running into this issue: Suppose that there are two independent services, A and B, and both process messages from C. Suppose that I have a service X that needs to know if a message m from C was ...
-2
votes
1answer
121 views

What is the best way of implement a virtual world like a garden? [closed]

I want to develop a virtual garden with a lot of kind of insects like ants, bees, etc... For example, if I want to create an area of 10x10m². I can implement this with ArrayList<ArrayList<...
3
votes
4answers
234 views

Does the Open and Close Principle relate to renaming a class [duplicate]

My coworker and I have having an argument. The Open and closed principle is defined as: A module will be said to be open if it is still available for extension. For example, it should be possible ...
2
votes
1answer
100 views

How to (or should I) refactor RxJS nested subscriptions with intermediate return value?

I hope this fits more here than SO because it is mostly about code design than making it work. Also, this is not tied to RxJs, but more to the reactive paradigm. (TypeScript tag is only added to make ...
2
votes
1answer
44 views

Architecture design for Linux administrative interface

I've developed an IoT device utilising OpenWrt so my design needs run a on a shoe-string budget of resources. I need to be able to push small amounts of data, up to 300bytes to my app on a very ...
1
vote
0answers
54 views

Third-party API wrapper in Java: how to design

Suppose, there's a site that provides an API, such as this: Users post questions, answers on that site You can make GET and POST calls There are two types of authentication: weak (only gives read ...
49
votes
10answers
11k views

Does splitting a potentially monolithic application into several smaller ones help prevent bugs? [closed]

Another way of asking this is; why do programs tend to be monolithic? I am thinking of something like an animation package like Maya, which people use for various different workflows. If the ...
2
votes
1answer
64 views

Angular class design dilemma

I'm trying to set up a good class diagram for my Angular application, however I have a problem figuring out how to solve the following situation: I created a base Link class that can be used anywhere ...
3
votes
4answers
215 views

How to get a decoupled design without injecting repositories inside entities

I am facing the following situation: I have to develop a system that has to calculate the price of a car so i need to calculate the prices of all the Pieces that make up the car and then total them. ...