Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes OO, Patterns, UML and Refactoring and the fly likes Command Vs Facade Design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Command Vs Facade Design pattern" Watch "Command Vs Facade Design pattern" New topic

Command Vs Facade Design pattern

Pankaj Kumarkk
Ranch Hand

Joined: Apr 17, 2011
Posts: 108
I would like to know the difference between command and facade design pattern.

Both design pattern essentially hides the sub-system complexity and provides a easy to use interface to the client.
I am confused how to differentiate.

I know the theoretical difference between command and facade design pattern(as per their definitions). I would like to understand it from a practical perspective so that I can apply it when there is a need.

Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

They are very different.

Facade is used to hide internal structure and provided a simplified interface.
The command pattern is used to encapsulate actions which allow you to program undoable actions, task queue's etc..

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Consider Paul's rocket mass heater.
subject: Command Vs Facade Design pattern
Similar Threads
"Business Delegate-Session Facade" and "Command Pattern- Session Facade" pattern
Difference between Facade, Front Controller and command pattern
Difference between Command and Session Facade
Doubt about Petstore ������
Design Pattern in SCWCD