Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAXB ObjectFactory safe as a singleton?

843834Jan 28 2004 — edited Aug 18 2005
I'm looking over some code written by someone else and they create a new ObjectFactory everytime they want to construct a response object. This seems like a really bad idea to me (i.e. causing lots of unecessary overhead).

My assumption was that people would apply a singleton pattern to the JAXB ObjectFactory; is that recommended? This also assumes that ObjectFactory objects are thread-safe (but I didn't see any
mention of that in the spec).
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2005
Added on Jan 28 2004
4 comments
1,084 views