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
What is form method?
What is redirecting behavior?
What are the disadvantages of asp.net?
What are the parts of an http response?
Is asp.net free?
What is fulltrust?
Explain the benefits of viewstate?
For which does this Codebehind="MyCode.aspx.cs" is relevent to ?
What are web server controls in asp.net?
Describe Segmentation With Paging?
What is custom attribute?
Where is asp.net session stored?
What is aspect-oriented programming?
calling result set one procedure to anothar procedure in sql2000
State differences between MVC and WebAPI