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...

Explain Factory pattern?

Answer Posted / swetha

Factory Design Pattern is a simple decision making class
that returns one of several objects depending on the data
provided. It comes under creational type of design pattern.


Example:

Suppose say that want to write the code to perform
arithmetic calculations. Initially you decided to write code
for only Addition and Subtraction. And later on you decided
to add more functionality by including Multiplication and
Division. Now, if you don't use Factory Design Pattern, we
need to change the entire code to include additional
functionality. But, when we use Factory Design Pattern, It
is easy to add additional functionality when needed without
disturbing previous code.

In factory class we create the instance of the classes
addition, subtraction, division and multiplication based on
the operator selected.

In this way Factory Design Pattern is useful.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you nest updatepanel within each other?

978


Can you set the session out time manually?

887


Describe the diffeerence between inline and code behind?

1024


What is AutoPostback?

1211


What is connection pooling and how to enable and disable connection pooling?

1021


Out of ASP or ASP.NET which one is stateless?

1231


What’s the difference between asp.net web forms and asp.net mvc?

1172


What is the importance of Global.asax in ASP.NET?

1146


To wrap up a call to a Web service the standard used is..?

978


What does the orientation property do in a menu control?

996


Can I read the hard disk serial # of the client computer using asp.net?

1096


What is the use of worker process in asp.net?

1015


How do I use a proxy server when invoking a web service?

993


What is the difference between localization and globalization?

1037


What is syntax code to send email from an asp.net application?

1016