I am reading the book on Head First Design Patterns, and am still trying to understand the clear difference between the Simple Factory and Command Pattern.
From what I see, they are the same - in the sense, they encapsulate the invocation of a method.
Is the only difference between the Simple Factory and Command in the sense that Simple Factory deals with object creation while Command pattern deals with behaviour?
So if the behaviour is about creating objects - isn't it the same?
(Please don't mark this as duplicate as I am trying to make things clear between these two!)
The two patterns have very different responsibilities. One is constructional pattern responsible for creating an instance of certain type. The other is behavioural, defines a certain action that needs to be performed.
In a way you are right, to construct something is also an action(behaviour). As such you can say that construction is one behaviour of all possible behaviours that the behavioural patterns cover. But this does not put sign of equality between command and factory :) it just means that the particular behaviour defining the construction of something is delegated in its own class of patterns named Constructional.