design-patterns Questions

3

Solved

I have been reading about using Command objects to represent use cases that our domain exposes, and Command Handler objects to process those commands. For example: RegisterUserCommand RegisterUs...
Insphere asked 29/6, 2014 at 9:40

33

Solved

I need to create a function which can be executed only once, in each time after the first it won't be executed. I know from C++ and Java about static variables that can do the work but I would like...
Selfexistent asked 3/10, 2012 at 17:18

5

Solved

In large and complex software products managing configurable settings becomes a major pain. Two approaches I've seen to the problem are: have each component in the system load its own configurat...

9

Solved

In JavaScript, you can use Lazy Function Definitions to optimize the 2nd - Nth call to a function by performing the expensive one-time operations only on the first call to the function. I'd like t...
Journeywork asked 23/9, 2008 at 1:49

6

Solved

So, I was just reading about the Visitor pattern and I found the back and forth between the Visitor and the Elements very strange! Basically we call the element, we pass it a visitor and then the e...
Methylnaphthalene asked 3/6, 2021 at 4:54

5

Solved

I am writing an abstract class with an abstract method (thus, all classes inheriting from it must implement that method). However, I do not want to specify the parameters which the method must use,...
Conclave asked 1/2, 2011 at 14:52

4

Solved

Is there such a thing as a manager design pattern that controls how different entities interact? This is for a project for which the Environment, EnvironmentListener, and Entity classes have been...
Vannie asked 4/9, 2010 at 8:41

4

Solved

Please what is the main difference between entities and aggregate roots in domain driven design. For example in entity framework, what is the use of aggregates if I can ensure data integrity entiti...
Koester asked 2/9, 2015 at 12:57

6

Solved

What is a good example of a cross-cutting concern? The medical record example on the wikipedia page seems incomplete to me. Specifically from this example, why would logging lead to code duplicat...
Mabel asked 16/5, 2014 at 16:45

8

Solved

I just came across two patterns. Strategy Pattern Decorator Strategy Pattern :- Strategy pattern gives several algorithms that can be used to perform particular operation or task. Dec...
Ebonize asked 17/10, 2014 at 10:19

5

Solved

We all know about log, ok, but why should we consider the «Logger» class a singleton one? What happens if we make it as a normal non-singleton class?
Gurrola asked 3/11, 2010 at 9:4

6

Solved

What tools or libraries exists for Java that will take an interface only with accessor method definitions and automatically generate an immutable object class and also a "builder" class for increme...
Monitory asked 6/2, 2013 at 9:43

5

Solved

I've been reading a document from Microsoft's patterns & practices group (Data Access for Highly-Scalable Solutions: Using SQL, NoSQL, and Polyglot Persistence). In Chapter 3, in the section "...
Kellen asked 5/3, 2015 at 14:50

2

The active object design pattern as I understand is tying up a (private/dedicated) thread life time with an object and making it work on independent data. From some of the documentation I read , th...
Paratyphoid asked 19/4, 2012 at 22:36

4

I am trying to find the most elegant way to allow a child and parent to react to an event initiated by the grandparent. Here's a naive solution to this: abstract class A { final public void foo()...
Mariellamarielle asked 1/8, 2019 at 0:22

7

Solved

What is the difference between the Strategy pattern and the Command pattern? I am also looking for some examples in Java.
Diplodocus asked 29/1, 2011 at 3:33

5

Our team is starting a new project following Domain Driven Design (DDD). At the high level, we have an API on the top of our domain which enables a client to perform operations on the domain. One o...
Thresher asked 18/10, 2018 at 21:41

3

Solved

We are developing applications for use within AutoCAD. Basically we create a Class Library Project, and load the .dll in AutoCAD with a command (NETLOAD). As so, we can use commands, "palettes...
Oloroso asked 11/2, 2009 at 14:1

6

Solved

How does the SOLID "Interface Segregation Principle" differ from "Single Responsibility Principle"? The Wikipedia entry for SOLID says that ISP splits interfaces which are very large into small...

8

Solved

One stumbles upon this phrase when reading about design patterns. But I don't understand it, could someone explain this for me?
Chiffchaff asked 23/4, 2010 at 10:27

18

Solved

Hi I am a newbie in the Kotlin world. I like what I see so far and started to think to convert some of our libraries we use in our application from Java to Kotlin. These libraries are full of Pojo...
Latonya asked 21/3, 2016 at 20:19

2

I'm trying to figuring out how to implement repository design pattern on NestJS that using MongoDB and mongoose database
Culvert asked 7/7, 2019 at 16:35

3

Solved

How Chain of Responsibility Pattern Differs from Decorator Pattern..?
Gutsy asked 15/9, 2010 at 19:49

5

Two design patterns namely Dependency Injection and Dependency Inversion exist out there, Articles are there in the net trying to explain the difference. But the need to explain it in easier words ...
Selfconscious asked 12/10, 2017 at 12:5

3

Solved

I understand that the State pattern can be used to model objects that changes behavior depending on the state and the various states that the Context can have is encapsulated in concrete classes th...
Aluminum asked 21/1, 2013 at 7:33

© 2022 - 2025 — McMap. All rights reserved.