Search Interview Questions
| More than 3000 questions in repository.|
There are more than 900 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Java - Interview Questions and Answers|
|Ans. Object Oriented Design Patterns is the science of identifying the pattern to make objects communicate in a way to effectively implement a Solution.|
Factory Design Patterns is the pattern that recommends creation of separate Factory Object for creation of other object. So its like saying - If you want to create an object of ClassA, Talk to FactoryObject ( which is an object of FactoryClass ). FactoryObject in itself encapsulates the inputs and logic required to make the decision regarding the creation and construction of object.
Advantage of Factory Pattern - Loose Coupling and Segregation of Responsibilities. Now instead of hard binding the complete logic to decide the nature and shape of the object on the basis of some conditions, you are assigning the responsibility to some other object and hence making the relationship loosely coupled and hence main tenable.
Disadvantages - Before Understanding the Dis-advantages , we should understand that these patterns were chosen after a period of evolution and research and almost best fit for the required solution, otherwise these patterns would have easily been replaced by now.
Though the advantages of these pattern surpass the disadvantages keeping in mind the decreasing cost of resources and increasing scale of applications, but still loose coupling by means of additional objects results in decreased performance.
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  factory design pattern  design pattern|
|Difference between Factory and Abstract Factory Design Pattern ?|
| Please specify in what sequence the objects of following classes will be created ?|
Session , SessionFactory, Query , Configuration
|Difference between Factory and Builder Design Pattern ?|
|Difference between Factory and Strategy Design Pattern ?|
|What is ThreadFactory ?|
|How many SessionFactory and Session objects are created ?|
|Which class provides the enumerated value for Bean Scope ?|
|What is a factory design pattern ?|
|Difference between Singleton and Factory Design Pattern ?|