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.

11
votes
5answers
832 views

What is a good design practice to avoid asking a subclass type?

I've read that when your program needs to know what class an object is, usually indicates a design flaw so I want to know what is a good practice to handle this. I'm implementing a class Shape with ...
1
vote
2answers
92 views

Designing a big data web app

How do you design a website that allows users to query a large amount of user data, more specifically: there are ~100 million users with ~100TB of data, data is stored in HDFS (not a database) number ...
32
votes
11answers
4k views

Are design patterns generally a force for good or bad? [closed]

I've heard it argued that design patterns are the best thing since sliced bread. I've also heard it argued that design patterns tend to exacerbate "Second System Syndrome," that they are massively ...
5
votes
4answers
2k views

What is a good way to brainstorm algorithms on a computer? [closed]

I'm looking for something that allows me to work out an algorithm on a computer similar to how I would do it on a whiteboard. At work, I have a huge whiteboard that I can use for this, but at home, I ...
0
votes
0answers
15 views

Messaging engine architecture with front-end and ORM layer (spring)

I'm looking to push my first QuickFixJ messaging engine into production, and I would like to know the best way to do so. Bear with me. The gist of the responsibilities is as follows: Through ...
0
votes
1answer
49 views

Migration benefits from PHP web app to java? [on hold]

I have recently joined the company which took the call to convert the PHP based web application to java. The call was taken around 4 years by some architects who have left the company. I read a lot on ...
0
votes
2answers
50 views

Most efficient way to get unique customer count

I'm working on a system that stores details of customer purchases for several stores. One statistic that they would like is to know how many unique customers they have had over a specified day range, ...
0
votes
1answer
60 views

how to ensure consistency for concurrent requests for same mutable data?

Consider an abstract example, just to illustrate - you have a service for loans, which gets requests to borrow X USD, checks if there’s enough USD to lend that, if yes - marks that amount as reserved ...
2
votes
3answers
100 views

Design: Where should methods specific to a model, but not an instance go?

Let's say I have a User model defined. It makes sense that methods for retrieving certain fields of this model lives in the model file. My question is where something that generates a unique UUID, or ...
1
vote
5answers
355 views

Making logging more efficient and useful by categorizing data (and virtually not writining messages anymore)

I'd like to make my logs more useful. Currently they mostly contain such common columns as: timestamp, logger-name, log-level, message, exception. They are unsearchable and unparsable and writing ...
0
votes
2answers
85 views

Is this a proxy or bridge or something else?

I have an object that acts as a "bridge" between objects and I'm not really sure if it has a name. Unity (the game engine) lets me build a concrete object and then link those objects in the inspector ...
1
vote
1answer
22 views

Best practice to confirm unique username for user creation in JSP and JDBC?

First let me state the asynchronous approaches:- The user enters a character into the username form field. I create a connection to the database, use a prepared statement to confirm whether the ...
0
votes
1answer
38 views

How to build a custom intermediate operation pipeline in Java for a series of API calls?

I am working on a project which provides a list of operations to be done on an entity, and each operation is an API call to the backend. Let's say the entity is a file, and operations are convert, ...
0
votes
1answer
39 views

Custom ACL Implementation

I have been trying to figure out an ACL solution for my application which should manage API endpoint's access rights dynamically. Some said that I have an option of Spring Security ACL. I checked it ...
0
votes
0answers
33 views

AMQP integration

I’m trying to make a AMQP integration layer for my app. This layer would only consume messages from my customer’s queues and the result would be a specific action in my application. My application is ...
2
votes
1answer
100 views

Long running server process. How to update client

What I'm looking for is a pattern for the client triggering a server process, then the server process signalling the client when its finished. preferably with examples available in .NET or dotnetcore ...
1
vote
0answers
42 views

How to solve circular dependency scenario while executing http calls which require authentication?

I am working on a project which requires me to execute standard HTTP calls with session tokens. I am building a custom HTTP client, with a custom authenticator, something like this: Client client = ...
2
votes
4answers
257 views

How to adapt Clean Architecture to a rich desktop application

I'm just learning about clean architecture and I'm trying to design a proof of concept for an application I want to build soon. In the Clean Architecture the Presentation layer and the Domain Model ...
-2
votes
0answers
46 views

How to auto populate 4 PDF's per truck load? [closed]

I have lets say 40 trucks of meat come to my Wearhouse every day, each truckload requires us to fill out 4 different PDF's that go 4 different places. The information is basically the same on each ...
1
vote
1answer
68 views

Functionality design: Multiple sources, multiple consumers with configuration

It is a Design Problem which I am listing out here. I have multiple event sources in my app, each one produces events with the different set of data (but each source is producing only one type of ...
17
votes
7answers
23k views

Ways to have a history of changes of database entries

What are ways to allow the versioning of database entries (data)? Think of the content-managment-systems abilities to revert back changes of articles. What are their pros/cons?
0
votes
0answers
79 views

Base class with bool flag to imitate virtual constructor

I am using bool flag to call base class function when needed to imitate virtual constructor. I am using this way for inheritance purpose. I have a Base class constructor with int and bool. The bool ...
4
votes
1answer
203 views

How to set up a sql database to cater for user records, group records and default records?

Outline I have an application that loads data from a database. I'm not talking about client data here though, I'm talking about application configuration. The database will therefore come with some ...
2
votes
1answer
53 views

In a multi-tenant micro-service architecture, who stores the account IDs for each tenant?

I've been doing some research on multi-tenant systems and micro-services and I'm a bit confused by this. If each micro-service has it's own database, and implements the support of multi-tenancy in it'...
1
vote
1answer
101 views

Modeling on Domain Driven Design and C4Model

I am wondering how DDD and C4Model can play together. Level 1 of Simon Brown's c4 Model is System Context diagram. So I think after you find and define your Bounded Contexts, you may start creating ...
61
votes
12answers
9k views

Having a flag to indicate if we should throw errors

I recently started working at a place with some much older developers (around 50+ years old). They have worked on critical applications dealing with aviation where the system could not go down. As a ...
-1
votes
0answers
16 views

Design of a service to manage and expose product definitions

I’m trying to come up with a high-level design for a service that manages and exposes definitions of a relatively small set of products. Context: An online tool allows a user to design their own ...
-2
votes
0answers
31 views

How to design the iOS App that runs only one REST API responses?

I have to develop an app which has nearly 50 plus API calls to the server. And iOS app is just a UI layer for the API responses. Also based on these responses, application UI states gets updated in ...
0
votes
3answers
151 views

How to best design a software feature when work shifts are considered

I am making a program that tracks whether an employee has checked in on a software app that day. The employee can check in at any time, so long as they check in before their shift ends. If they don't ...
0
votes
4answers
103 views

Does a server send a client a ServerMessage, or a ClientMessage

Suppose I have a server and a client. When I send a message to the client, would I be sending a ServerMessage, or a ClientMessage? The other way to think about it - when I receive a message, it is a ...
0
votes
2answers
51 views

Architecture/design for reading incoming data and distributing it across program

This may be a broad question but I have not been able to find an answer. In my program I am communicating to a device over serial communication. The data coming through is binary, and formatted with ...
3
votes
3answers
397 views

How to decide, should I put methods to abstract class or to interface?

I'm writing an app it needs to have generic registration step item. It needs to be able to do some specific things (I use interface for that) and it needs to be a visual element (of Xamarin. It doesn'...
7
votes
4answers
632 views

What is “premature abstraction”?

I've heard the phrase being thrown arround and to me the arguments sound completely insane (sorry if I'm strawmaning here, Its not my intention), generally it goes something along the lines of: You ...
-1
votes
1answer
119 views

Start frontend development with incomplete analysis, delayed backend and no API

To give a bit of context first, I have been tasked to mentor an internship on creating a UI for a certain business need: Already 4 months were spend on analyzing, creating the business use cases ...
1
vote
0answers
81 views

What are some examples of generality?

The cover of the book The Practice of Programming lists programming principles: Simplicity Clarity Generality Intuitively I understand generality as preferring to solve the general problem rather ...
0
votes
0answers
29 views

Does separating chunks of “similar” code into separate functions really improve maintainability? [duplicate]

I was working on a relatively large function recently (about 500 LOC) and I noticed that a lot of the code could be relatively well summarized into a few different chunks of code: void MyFunction() { ...
-2
votes
1answer
277 views

Server initiated communication to clients

I am trying to build an internet service that executes commands on the connected computers. Commands are initiated through a web-based dashboard. I currently have a REST API running with Laravel and ...
0
votes
1answer
66 views

What approaches are there to making apps homoiconic from users' perspectives; which are good, which bad, and why?

In terms of an application that's about affording its end-uses the ability to add, view, and manipulate their own data (like Podio, Trello, Redbooth, Asana, et cetera), I'm wondering how it can be ...
0
votes
3answers
72 views

How can I do a step based design form my applicaiton?

I want to create an application that has some optional steps. But I could not decide how to do step plans. It looks like a workflow. I have a Work entity. This work includes specific business steps. ...
1
vote
1answer
61 views

How to balance code duplication with being able to prevent unnecessary service calls

Apologies in advance if this is considered opinion based, but I wasn't sure where to ask it and was interested in learning if there were any definitive best practices. Say an application calls a ...
0
votes
0answers
82 views

The Frontend-Backend Vs. Backend-Backend

I've seen this pattern pop up in a couple of different teams. They have a server with a REST API and a frontend web project. What commonly happens is the frontend developer finds their requests are ...
1
vote
0answers
43 views

Strategies for dealing with Stale data and Fetching

I'm working with firestore and have encountered several situations where a document will contain stale data which is a duplicate of the source of truth located elsewhere in the database. For ...
2
votes
1answer
180 views

How to handle a software design project when I am the only member of the team with any design experience

Some background I am the newest member of a small team of 3 developers. For the past two years I have been working with them on an application the two of them made roughly 5-6 years ago. This ...
0
votes
1answer
73 views

Moving from a Coded Approach to a Stateless Approach

Our project is in its early stages and we are currently using Uncle Bob's Clean Architecture (also known as the Onion Architecture). An overview of our project is as follows: domain package ...
0
votes
0answers
78 views

How to handle shared data across microservices?

At my work we have a typical microservice architecture, but one of the issues we are running into is sharing data across multiple services. We have certain data that is used by multiple services and ...
0
votes
1answer
61 views

Avoid numerous dynamic_cast_ptr in the API design of polymorphic types

I am trying to design a geometric intersection API. Below is the code to represent geometric elements. #include <iostream> #include <memory> // Since I did not write the Shape class I ...
0
votes
2answers
93 views

Is it possible to represent an if statement in a system sequence diagram?

I'd like to highlight that this questions is about a System Sequence Diagram (SSD) and not a simple Sequence Diagram and of course any help would be appreciated! I'm reading Graig Larman's book ...
1
vote
2answers
54 views

Should data be pre-processed before being handled by an ETL framework?

So I was discussing coding with an associate of mine at work, and was mentioning how I was working on a project where I'd need to transform the data that was provided into a standardized format before ...
3
votes
2answers
218 views

Should I provide partialed functions based on API call in Clojure?

I am designing a library to wrap an API with Clojure. The API requires user credentials to authenticate user related calls. My first approach was to have functions that do each task the API can do: (...
3
votes
2answers
114 views

Passing a list of base class objects to a method and using instanceof to filter them

I'm working on a Java reverse engineering project, where I am analyzing bytecode and trying to identify classes, methods and fields using the ASM framework. After identifying these I transform some ...