Saturday, February 02, 2008

Factory method

Name : Factory Method
Context : Hide the implementation class but defer the instantiation to subclass
Consequence
a) Provides hooks for subclass
Examples
Calendar.getInstance()
Connection conn = java.sql.DriverManager.getConnection(uri, name, password);

No comments: