My question is related to the command pattern, where we have the following abstraction (C# code) :
public interface ICommand
{
void Execute();
}
Let's take a simple concrete command, which aims to delete an entity from our application. A Person
instance, for example.
I'll have a DeletePersonCommand
, which implements ICommand
. This command needs the Person
to delete as a parameter, in order to delete it when Execute
method is called.
What is the best way to manage parametrized commands ? How to pass parameters to commands, before executing them ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…