...

View Full Version : DocumentBuilderFactory.newInstance(); OR TransformerFactory.newInstance();



otnj2ee
01-12-2008, 02:19 AM
Usually when we create a reference to an class, we'll do:

Test tst = new Test();

But when we create a DocumentBuilderFactory or a TransformerFactory, we use:

DocumentBuilderFactory.newInstance();

or

TransformerFactory.newInstance();

Why use the newInstance() instead?


Thanks


Scott

shyam
01-12-2008, 04:25 AM
coz thats the abstract factory design pattern read more here http://en.wikipedia.org/wiki/Abstract_factory_pattern



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum