Title: Message
Nope. newInstance invokes the no-arg constructor and it's performance is about the same as:
 
MyObject o = new MyObject();
 
To use newInstance you need to provide a public no-arg constructor. The only extra overhead is casting, methinks, but it's negligible. You should consider a pool of objects if they're being created/destroyed often.
 
Juan Pablo Lorandi
Chief Software Architect
Code Foundry Ltd.

Barberstown, Straffan, Co. Kildare, Ireland.
Tel: +353-1-6012050  Fax: +353-1-6012051
Mobile: +353-86-2157900
www.codefoundry.com
 
Disclaimer:
 
Opinions expressed are entirely personal and bear no relevance to opinions held by my employer.
Code Foundry Ltd.'s opinion is that I should get back to work.
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]] On Behalf Of Glenn Dickson
Sent: Thursday, November 14, 2002 7:29 AM
To: [EMAIL PROTECTED]
Subject: Class.Newinstance

Does class.newinstance have a high impact on performance as I am using it to create objects dynamically?
 
TIA

Reply via email to