322 questions
-1
votes
1
answer
71
views
SQLAlchemy session initialization in Command pattern [closed]
A question on consideration for case/approach choice.
Let's say we have an app that has an ORM model and also uses simple realisation of the Command pattern. Inside of each command we need to ...
0
votes
1
answer
156
views
Combining Command and Visitor design patterns
Designing the architecture of a personal project, I've come up with the idea of using the combination of these two patterns to solve an architectural issue. In an MVC context, I need to implement ...
1
vote
1
answer
225
views
Should you use the Command Pattern for requests involving very little logic? [closed]
I am new to design patterns and want to get a better understanding of when to implement the command pattern. The command pattern from my understanding is intended to encapsulate a request and the ...
2
votes
1
answer
97
views
Is this Command Pattern or Strategy Pattern?
This is an image from an old exam I'm working through. Through the UML-diagram, as seen above, how can I determine if this is Command Pattern or Strategy Pattern?
The answer to the question is that is ...
0
votes
0
answers
68
views
Command pattern, EF Core, type casting and MS DI
How to put together this approches correctly?
Today I'm struggling with emplementing domain events, or something that looks like it.
Let's say, I've got this (not a real code):
public abstract class ...
2
votes
1
answer
90
views
Why can't std::visit disambiguate templated overloads
I'm trying to build a command pattern where each command has access to a defined interface. Receivers implement one or more of these interfaces and can then have commands, by way of CommandLists ...
1
vote
0
answers
96
views
Am I applying command pattern correctly?
I'm currently working on a Unity project and I decided to use command pattern to manage the buttons of the interface among other things. I'm not sure if I'm applying the patter the way I should ...
0
votes
2
answers
535
views
mypy does not recognize a method of a class
from abc import ABC, abstractmethod
from typing import List
class AirConditioner:
"""Class that represents an air conditioner"""
def __init__(self, identify: str,...
0
votes
1
answer
1k
views
What are the differences between the Mediator and Command Design pattern?
The Mediator and Command design pattern are both Behavioral patterns and describe decoupling a Sender from its Receiver via an intermediate object. In case of the Mediator pattern this intermediate ...
1
vote
1
answer
2k
views
How to proper implement Undo Redo system in React using context and command pattern?
I'm trying to implement an UndoRedo system in my App. I'm using TypeScript and React. I want to use the command pattern to develop the system as I want it to be a global system for several commands ...
0
votes
0
answers
91
views
Command pattern implementation
I'm practicing with command pattern and faced a problem. If I get an exception after executing a command, I need to repeat it 2 times (by adding it to the command queue), and then write logs if it ...
1
vote
0
answers
265
views
How to apply command pattern in js
I have a calculator app and I'm trying to apply the command pattern
I have a fully working version
Please help me figure out how I should do
How do I use the command pattern in my code?
CalculatorCore....
0
votes
1
answer
339
views
Command design pattern with friend class in C++
The situation: I have to handle and take action on various commands, which can be encapsulated in the command design pattern. So right now I have
class Command {
virtual void applyCommand(IFoo&...
0
votes
1
answer
257
views
command pattern vs strategy pattern in Javascript
Strategy pattern and command patternz are very similar. I just want to confirm my understand of their differences.
Can I say with both design patterns, they both require to implement the methods in ...
0
votes
0
answers
190
views
State VS Strategy design pattern
I really know that when we have a state-dependent behaviour, we automatically think of state design pattern, especially when it comes to a behaviour that changes according to the state and at the same ...