dp command pattern introduction as per wikipedia"in object-oriented programmingthe command pattern is design pattern in which an object is used to represent and encapsulate all the information needed to call method at later time this information includes the method namethe object that owns the method and values for the method parameters command pattern is one of the design patterns that are categorized under _observerdesign pattern in command pattern the object is encapsulated in the form of commandi the object contains all the information that is useful to invoke method anytime user needs to give an examplelet say we have user interface where in the background of the interface would turn into red if the button on the user interface named _red|is clicked now the user is unaware what classes or methods the interface would call to make the background turn redbut the command user sends (by clicking on _redbuttonwould ensure the background is turned red thus command pattern gives the client (or the userto use the interface without the information of the actual actions being performedwithout affecting the client program the key to implementing this pattern is that the invoker object should be kept away from specifics of what exactly happens when its methods are executed this waythe same invoker object can be used to send commands to objects with similar interfaces www testingperspective com