users@jaxb.java.net

Re: Difference between object factory and default constructor

From: Ed Mooney <Ed.Mooney_at_sun.com>
Date: Fri, 13 Jun 2003 09:01:03 -0400

Hi Tim,

ObjectFactory is portable (being required by the specification).
MyObjectImpl is specfic to the RI.

You should always use the ObjectFactory.

Regards,
--
Ed Mooney         |Sun Microsystems, Inc.|Time flies like
Java Web Services |UBUR02-201            |an arrow, but
Ed.Mooney_at_Sun.COM |1 Network Drive       |fruit flies like
781-442-0459      |Burlington, MA  01803 |a banana. Groucho
Tim Davidson wrote:
> Hi
>
>  Whats the difference between using
>         ObjectFactory objFactory = new ObjectFactory();
>         MyObject myObj = objFactory.createMyObject();
> and
>         MyObject myObj = new MyObjectImpl();
> ? I cant find any documentation which says why to use the objectFactory?
> We are using both methods and they both appear to work fine.
>
> thanks.
>