Skip to main content

Questions tagged [design-patterns]

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

-1votes
1answer
202views

Which pattern is suitable for this scenario?

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
2votes
3answers
121views

Is this an aggregate in DDD? Is it unnecessary to group objects as an aggregate if there are no invariants?

Below is a scenario that needs to be modeled using the Domain-Driven Design (DDD) approach. A Project can have Notes added to it. A Note cannot exist without a Project. A Note needs to be viewable ...
EMN's user avatar
  • 399
4votes
1answer
166views

Holding state in a service class in MVVM

In my SwiftUI app, I have a UpNextManager view model and a service class called UpNextService which contains many methods to read up next items from disk, write them to disk and much more. The service ...
User95797654974's user avatar
3votes
3answers
445views

Is it a good idea to wrap node.js package functions in a micro-service architecture?

Our development team works with a micro-service node.js architecture. This means we work with a very large amount of repositories that currently each take care of their own dependencies. To avoid ...
dreagan's user avatar
3votes
1answer
153views

Deciding on granularity of SOLID's SRP

I am currently working in a project where we are utilizing kafka as a Message Queue. We have two use cases here, one is to consume the messages in parallel, no ordering of any kind required. And one ...
Akshansh Jain's user avatar
3votes
1answer
329views

why would one use the "Functional Options" pattern in go?

I just learned about the Functional Options pattern in golang. what are the benefits of using it over just allowing to pass a config struct and just overriding the default values provided in the ...
moshevi's user avatar
2votes
0answers
223views

How to encapsulate functions inside a library

I'm working on a project that uses an in-house library, which is also used by other projects. There are some classes and methods in other classes that are not used outside the library itself, is there ...
ulitosCoder's user avatar
1vote
3answers
177views

How to handle authorization in CQRS

In a CQRS architecture, at least as implemented by Vaughn Vernon in IDDD_Samples, the query services lives in the application layer. But then where and how should authorization be handled? For example,...
Kyle Richards's user avatar
3votes
3answers
228views

Repository returning multiple aggregates

A common DDD wisdom I encounter online is that your repository should not return more than one aggregate type. But I came across this passage from Vaughn Vernon's book "Implementing Domain-Driven ...
Kyle Richards's user avatar
3votes
5answers
961views

What is the design pattern of a program that uses global arrays to store variables?

Specifically, I mean code structured in a way where storage is global. Bare with me, as my terminology is all over the place. If I want to create a variable, I "load" it into a global cache. ...
Scene's user avatar
0votes
1answer
116views

What's the point of "use case optimal query" and partial aggregates in DDD?

In Vaughn Vernon's book "Implementing Domain-Driven Design", he talked about repositories that allows you to query for partial aggregates using a "use case optimal query": (from ...
Kyle Richards's user avatar
2votes
3answers
210views

Aggregate with a huge list of value objects

I'm currently reading "Implementing Domain-Driven Design" while going through the code samples, but I'm having trouble modeling aggregates that stores a huge list of value objects. For ...
Kyle Richards's user avatar
2votes
3answers
284views

How do I model this scenario so that it adheres to OOP principles?

I have a Slide class with subclasses referring to the different types of slides (IntroSlide, SummarySlide, etc.): abstract class Slide { String slideType; final String title; final String ...
Hello's user avatar
21votes
5answers
4kviews

How manage inventory discrepancies due to measurement errors in warehouse management systems

I'm developing an enterprise-grade warehouse management application for a chemistry laboratory. A critical feature involves mixing multiple stock solutions to create new solutions based on predefined ...
Biowav's user avatar
1vote
3answers
262views

How to allow users to provide their own child classes in a factory design pattern in c++?

I am building a c++ project that will allow users to essentially model and create their own fleet of cars. Right now, the approach I have in mind is a Car Factory Class that will implement all of the ...
J K's user avatar
  • 27

153050per page
close