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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [design]

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

1
vote
1answer
2k views

Two way data synchronization between web application and REST API server

I have a web application and a REST API server (Microsoft Dynamics CRM 2016) that I don't have access to it's code, but I have access to the available resources. I need to create a data sync between ...
1
vote
3answers
95 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 ...
24
votes
6answers
22k views

Is it good practice to use entity objects as data transfer objects?

I am wondering because if it is, why does Entity Framework not offer logic to create a new object with the same properties to transfer data between layers? I use the entity objects that I generate ...
1
vote
1answer
44 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
1answer
42 views

How to inject env variables AFTER the build process on a JS SPA

We have a build server that will transpile the JS source into the bundle file. I now need to inject values that are dependent on the environment the application is executed. The problem is, since the ...
0
votes
2answers
736 views

Best design pattern for two specific scenarios, the first one fits neatly into a Unit of Work(UoW) pattern

I have a question about what the best design pattern to use would be. I have 2 specific scenarios, the first one fits neatly into a Unit of Work(UoW) pattern. The second is a little bit more fiddly. ...
167
votes
5answers
141k views

When do you use a struct instead of a class? [closed]

What are your rules of thumb for when to use structs vs. classes? I'm thinking of the C# definition of those terms but if your language has similar concepts I'd like to hear your opinion as well. I ...
0
votes
0answers
41 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'...
0
votes
1answer
65 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 ...
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 ...
1
vote
2answers
129 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 ...
1
vote
4answers
169 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 ...
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() { ... } @...
3
votes
2answers
411 views

Is using spacing effectively equivalent to the long method code smell?

There's a common code smell involving long methods with the most common answer being that methods should be really small, less than 50 lines per say (or 20). I understand why this is because it ...
0
votes
2answers
346 views

How to make method calls more generic when dealing with multiple class types?

I have a loader class that executes data loading functions at boot-time for my application to give me test data. The idea is pretty simple, I'm reading in XML data, using JaxB to turn it into a POJO ...
24
votes
5answers
5k views

Best Practices for Redesigning a Database

I'm aware of some general best practices when designing a database for an application, but what about redesigning? I'm on a team tasked with re-designing an internal business application, though ...
1
vote
1answer
140 views

Data Integration Design Using Microsoft SSIS

I am working on a data integration project, where I need to extract data from oracle source and load it to XML file. The requirement is to get the list of customers and foreach customer create an xml ...
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 ...
1
vote
2answers
211 views

Can I use the memento pattern with multiple relationships and persistence?

I need to implement a rollback system and the memento pattern gets mentioned regularly as a solution to this requirement, but in all cases a single object is used and it works in memory, persistence ...
-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 ...
1
vote
1answer
166 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
7answers
2k views

C++ namespace name isolation

It's been considered for a reason, that using for namespaces/names is side-effect-prone, and generally, fully qualified names should be preferred. I've come up with an approach on that, which I ...
2
votes
1answer
125 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 ...
3
votes
1answer
957 views

What's a good notation for showing MVC interactions?

I'm developing various websites and functionality to cater to various different use-cases up in Django. Is there a good notation for showing what behaviour is at each stage, e.g., swimlanes. I use ...
6
votes
1answer
2k views

How do you perform modeling in an Extreme Programming environment?

I know methodologies, like Extreme Programming (XP), which specifies its own specific practices for developing software. However, unlike Scrum where it focuses more on management aspects, XP specifies ...
5
votes
1answer
6k views

System Design: Scalable Chat Server

Suppose you were asked to design a scalable chat server with the following requirements: The main use case is: player A sees B online, A sends a message to B, B receives it. The secondary use case is:...
4
votes
3answers
356 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
73 views

Static data reuse

I'm going to describe the situation first and ask questions in the end. I need to validate a scalar value using the Symfony Validator component. The value is an associative array. Now I have defined ...
1
vote
0answers
48 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 ...
0
votes
3answers
154 views

Designing a class whose dependancies require “starting”/initializing step

I have Facade class which requires an Endpoint instance to function (it uses it in most of the functions). Endpoint is attached to Platform that is passed in Endpoint's constructor and has to be ...
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
31 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
51 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 ...
4
votes
5answers
3k views

Methods of ordering function definitions in code

When I work on some programming project (usually command line application in Python with many switches), I'm usually creating about 30 and more functions. Most of the functions are in one file (except ...
1
vote
1answer
45 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 ...
0
votes
1answer
103 views

Custom Outlook Web App Shared Mailbox

We currently have a large amount of custom mailboxes hosted on Lotus Notes/Domino and have been tasked to migrate these over to our Outlook/Exchange environment. The mailboxes are basic Lotus Notes ...
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
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....
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 ...
3
votes
2answers
120 views

How to create a tree-hierarchical structure with unique behavior for every type combination?

Assume: There is some module whose interface is IA. There is some module B, that takes in a parameter an instance of IA, and whose behavior depends upon the type of that IA, meaning (pseudo code, no ...
-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
34 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 ...
0
votes
1answer
57 views

Pattern for Organizing Shared code/API for Multiple applications/services

I have a single web server running multiple web applications and websites. For simplicity we'll just say I have App A,B,C and websites D and E. All use a shared database and some tables are used in ...
6
votes
3answers
541 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 ...
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
228 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 ...
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: ...