Pergunta de entrevista da empresa Amazon

Advantage of factory pattern? Singleton class?

Resposta da entrevista

Sigiloso

10 de fev. de 2011

Factory pattern has the advantage of leaving creation details to the subclass, making it more flexible. Singleton provides a single static reference and saves on complexity by being available only when necessary, saving on instantiation when only one global object is required.