Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

When to Use a Factory Pattern?

Answer Posted / guest

A class can?t anticipate which kind of class of objects it
must create.
A class uses its subclasses to specify which objects it creates.
You want to localize the knowledge of which class gets created.


There are several similar variations on the factory pattern
to recognize.
1. The base class is abstract and the pattern must return a
complete working class.
2. The base class contains default methods and is only
subclassed for cases where the default methods are insufficient.
3. Parameters are passed to the factory telling it which of
several class types to return. In this case the classes may
share the same method names but may do something quite
different.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain three types of components comprise an application design?

1035


What is factory method in design pattern?

1055


Can we inherit singleton class?

1117


What are the SDLC phases you have invloved ?

2769


Can we make the reference instance non static?

1092


What are the design patterns you know explain?

1113


Which design pattern is mostly used in net?

1121


When singleton pattern is used?

1102


What are the disadvantages of singleton pattern?

1138


Are you using singleton in your code?

1199


What are the 23 design patterns?

1180


What is the creational design pattern?

1090


what are the creational design patterns

1252


What is singleton design pattern in java?

1173


What is the difference between adapter and facade?

1228