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 the difference between stored procedure vs function?
What’s the catch?
What is data caching?
What is the difference between user control an custom control?
What is dynamic web page with example?
Can anyone please tell me that the question posted on this website are Sufficient for the interview with 2+ year experience in .net
Let's say I have an existing application written using vb6 and this application utilizes windows 2000 com+ transaction services. How would you approach migrating this application to.net?
How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them ?
What is the difference between custom web user control and a custom web server control?
How many types cache in asp net?
What is a server farm in iis?
What is server side in asp.net?
Define machine.config in .net?
What are custom user controls in asp.net?
How does asp page work?