Tuesday, April 9, 2013

Difference Between Command Patter & Strategic patter is nothing but difference between instance variable and local variable.

Difference Between Command Patter & Strategic patter is nothing but difference between instance variable and local variable.

Command Patter: We need to use the command patter when client need to process a task(execute) for an command object where which command need to be executed is decided during runtime. Here Command Object is the instance variable.

Strategic Patter: Strategic patter is used when client execute certain task by the strategic class using the local variable. If we are configuring the context as singletom for the service class then we need to use Strategic patter.
[12:19:31 PM] Bala Thiruppathy: In Sudo-Code: Command Patter:

Public CommandImp{
  public void execute(){
   ---
   --
  }

}

Public StrategicImp{
  public void Fun1(FormVO obj){
   ---
   --
  }

}

No comments:

Post a Comment