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
Explain the difference between an exe and a dll?
How to unit test Web API?
What do you mean by caching in asp.net?
Describe state management in asp.net?
What are directives in asp.net?
What is asp.net architecture?
can any one find and tell the difference between dot net and php which one is best ? which one we get more salary? which one is stable and which one is best for freshers and also better in future and carrer ? which one we wil get more salary sir ? please send ur valuable suggestions to kiranpulsar2007@gmail.com
What are the types of validation in asp net?
What is a proxy in web service?
What is GAC in ASP.NET 2.0
What is the use of the tag in the web.config file?
Explain the difference between authentication and authorization.
Is asp.net and .net the same?
Explain asp.net page life cycle?
How to do state management in ASP.NET?