您还尚未登录 | 登录 或者 注册
Page-Views
 
Weekly People
Week
interviewquestionsadda.blogspot.com
Interview Questions and Answers
Newest Posts in Feed
Abstract Factory Design Pattern
Abstract Factory- Offers the interface for creating a family of related objects, without explicitly specifying their classes.
Factory Method Common usage
Along with singleton pattern the factories are the most used patterns. Almost any application has some factories. Here are a some examples:- factories providing an xml parser: javax.xml.parsers.DocumentBuilderFactory or javax.xml.parsers.SAXParserFactory
Factory Method pattern When to use
Factory Method pattern should be used when:- a framework delegate the creation of objects derived from a common superclass to the factory- the base factory class does not know what concrete classes will be required to create - delegates to its subclasses the creation of concrete objects- factory subclasses subclasses are aware of the concrete classes that must be instantiatedFactory method pattern...