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 autopostback in asp net?
What is the difference between localization and globalization?
Explain the namespace classes used in asp.net mvc? : asp.net mvc
benefits of migration from asp to asp.net hi frnds, i have to give presentation to a client about how useful would be migrating their project from asp to asp.net .plz give me some points which i should incorporate in my ppt thanks
How many types of Cookies are available in ASP.NET?
Explain what are webservices?
how to elimainte the similar data from the different tables
What is a ashx file?
What is semantic gap?
What are the different web pages?
What is anonymous authentication?
How to integrate angular 8 with asp.net mvc 5? : Asp.Net MVC
What is asp.net globalization?
Why we use dbms for projects? Why don’t we save any application data in separate files instead of dbms?
How do you secure your connection string information?