Command Pattern : How to pass parameters to a command?

前端 未结 13 1041
夕颜
夕颜 2020-12-07 16:43

My question is related to the command pattern, where we have the following abstraction (C# code) :

public interface ICommand
{
    void Execute();
}
<         


        
相关标签:
13条回答
  • 2020-12-07 17:12

    You should create a CommandArgs object to contain the parameters you want to use. Inject the CommandArgs object using the constructor of the Command object.

    0 讨论(0)
提交回复
热议问题