Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
01-12-2008, 02:19 AM #1
- Join Date
- Apr 2007
- Thanked 0 Times in 0 Posts
DocumentBuilderFactory.newInstance(); OR TransformerFactory.newInstance();
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:
Why use the newInstance() instead?
01-12-2008, 04:25 AM #2
coz thats the abstract factory design pattern read more here http://en.wikipedia.org/wiki/Abstract_factory_pattern
You never have to change anything you got up in the middle of the night to write. -- Saul Bellow