Using Singleton over Factory pattern
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ckollareddy_reddy
Posted On:   Monday, November 26, 2001 01:46 PM

Hi

What is the difference between the Factory and Singleton pattern.
Can we use a singleton (pattern) class to create other object instances and return them.
What are the advantages and disadvantages for using the Singleton pattern here.
Or do we have to use only a factory (pattern) class to do the above type of task.

Any input is highly appreciated.

Thanks.

Re: Using Singleton over Factory pattern

Posted By:   Bozidar_Dangubic  
Posted On:   Monday, November 26, 2001 03:09 PM

singleton = single instance. therefore, you cannot use singleton to create other object instances because the class ceases to be singleton (it becomes doubleton, tripleton... :-))) ). factory on the other hand is used to create objects. factory is usually implemented as singleton. the idea behind this is to have a single class responsible for creating objects of a given type.
About | Sitemap | Contact