Search code examples
design-patternsooparchitectural-patterns

Design Pattern(S) Command or Factory Which is Better to implement?


We can solve some Design Problems By implementing Factory as well as Command Pattern also. so, according to performance which is the better one?


Solution

  • Given that there are some situations where both apply -- and none really come to mind -- I'd assume neither is "better"; the best solution depends on the problem, the overall system, the team, etc. If one was "better" then the other could simply be discarded!