Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 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-patterns]

A design pattern is a general reusable solution to a commonly occurring problem in software design.

Filter by
Sorted by
Tagged with
-3 votes
1 answer
147 views

Is there a name for this anti-pattern? (reference to a class member passed to another class method) [closed]

Is there a name for this anti-pattern? A reference to a class member is being passed to another class method, rather than having the class method set the class member directly. public class ...
Jeff Roe's user avatar
2 votes
2 answers
281 views

How to design extensible data aggregation code to avoid manual updates in multiple places?

I have a data aggregation function that collects statistics from multiple sources. The problem is that whenever I add a new metric, I need to manually update the code in three different places, which ...
Tank's user avatar
  • 37
1 vote
1 answer
226 views

OO design - Process that relies on the current state of objects

We have a CAD software extension, where you can draw products like walls, doors, windows, etc., and you can export the drawing as an order, which contains the parts and costs. As part of this export, ...
Divan's user avatar
  • 369
2 votes
7 answers
330 views

I'm looking for a design principle referring to using a system for it's intended purpose

Recently a junior team member was asked to use a survey tool to act as a system by which fuel delivery drivers could submit their Bill of Lading to our dispatch team for record collection after ...
David Stratton's user avatar
0 votes
1 answer
80 views

Best practices for serving encrypted files in Laravel?

I'm building a Laravel-based web application that functions as a personal online photo archive. Each user uploads and manages their own private collection of images. These images are encrypted at rest ...
TimoFran's user avatar
0 votes
6 answers
272 views

Design pattern for exposing different parts of interface to different entities

In a certain program I would like to have three objects, say, a, b, and c, with c being a shared private member (sub-object) of a and b. The data between the three objects shall only go this way: a &...
Alexey's user avatar
  • 958
0 votes
1 answer
143 views

Optimal way to avoid iterating through each row in a dictionary of data/arrays?

I have an excel macro that imports daily share price files, and finds the highest price for a share after a given date. Each of these daily stock price files has ~1000 rows of data. Currently I have ...
Frankie139's user avatar
1 vote
1 answer
134 views

Optimal way to match prioritized list of tasks with available workers

Problem Match prioritized tasks with suitable workers. Details Consider a task with following properties - type and size. Based on task type, tasks are prioritized. While a worker has following ...
Ammar's user avatar
  • 123
0 votes
1 answer
91 views

Designing a Clean Separation for API Sorting Parameters and Database Columns

I'm working with a data mapper called UserMapper and a User model. Currently, UserMapper has a method called find_many. Now, a client makes requests like /api/users?sort_by=+last_name,-birthdate, so I'...
Dante's user avatar
  • 161
0 votes
1 answer
107 views

Designing a Scalable Caching Layer for User and Tenant Metadata in a Messaging System

I'm developing a microservice-based application that processes a high volume of messages. Each message must be handled according to the user’s personal settings and some tenant-specific (customer) ...
GeekChap's user avatar
0 votes
2 answers
147 views

Is it better to pass a specific “context” object to handlers rather than the entire domain object?

I’m designing a system where various “handlers” apply business rules to an object. Initially I had each handler receive the full domain object: // A large domain object with many properties and ...
nicke7117's user avatar
0 votes
0 answers
75 views

When DI goes too deep - what is another architecture/design pattern you should use? [duplicate]

I like using dependency injection but sometimes I find that I have to nest some dependencies so deep that I would almost rather use a global variable (despite this being bad practice). Here is an ...
Leftover Salad's user avatar
3 votes
3 answers
217 views

Is it good DDD practice to hide all the aggregate methods behind domain services?

I'm working on a DDD-based system and was researching the best way to handle domain services and keep business logic consistent. During my research, I came across this insightful quote from Steve ...
Mr_Sure21's user avatar
3 votes
1 answer
182 views

How should User behaviour depending on role be design as OOP

Imagine I got user which might be either author, administrator, reviewer An author have relation on book that he wrote. An administrator have relation on banned user (we track which administrator ...
Vincent PHILIPPE's user avatar
-1 votes
1 answer
319 views

Pattern for a chain of unreliable steps

I would like to refactor some code of a process that must perform a processing. The processing involves several steps, each of which can fail or go well. If successful, it must proceed to the next ...
jordan1982's user avatar

15 30 50 per page
1
2 3 4 5
302
Morty Proxy This is a proxified and sanitized view of the page, visit original site.