You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by robert burrell donkin <ro...@blueyonder.co.uk> on 2004/06/13 21:48:28 UTC

[beanutils] Re: Beans.instantiate [WAS Re: Beans.instantiate]

please remember to prefix with the name of the component.

On 13 Jun 2004, at 13:25, Hanson Char wrote:

> The JavaBean spec 1.01 (Section 10.3) recommends in general to use
> Beans.instantiate when creating beans.  Any reason why the 
> common-beanutils
> does not follow the recommendataion ?

if this question means: why wasn't the source written in this way then 
i'm afraid that someone who was involved with the beanutils early years 
(like craig) would need to jump in.

if (on the other hand) you have strong arguments for changes to 
specific lines of code, then it'd easier if you'd outline the specific 
changes and the reasons why you propose them.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Re: Beans.instantiate [WAS Re: Beans.instantiate]

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Mon, 2004-06-14 at 07:48, robert burrell donkin wrote:
> please remember to prefix with the name of the component.
> 
> On 13 Jun 2004, at 13:25, Hanson Char wrote:
> 
> > The JavaBean spec 1.01 (Section 10.3) recommends in general to use
> > Beans.instantiate when creating beans.  Any reason why the 
> > common-beanutils
> > does not follow the recommendataion ?
> 
> if this question means: why wasn't the source written in this way then 
> i'm afraid that someone who was involved with the beanutils early years 
> (like craig) would need to jump in.
> 
> if (on the other hand) you have strong arguments for changes to 
> specific lines of code, then it'd easier if you'd outline the specific 
> changes and the reasons why you propose them.

I believe the Beans.instantiate method scans the disk looking for a
serialized bean file to initialize the new object with. In general this
is a bad idea, as it requires several disk IO operations per object
instantiated. 

Sun's idea was that for GUI applications, this would allow the
application "state" to be saved as a bunch of serialized beans on disk
and by using Beans.instantiate they will pop up on the screen with the
same layout, size, etc. as when the app was last used (ie when the beans
were last serialized to disk). However not all of Sun's ideas are bright
ones - and I think this is one of the dimmer ones (though not as bad as
distributing org.apache.xalan in the rt.jar for java 1.4!).

I think *very few* users of BeanUtils will want the option to restore
the beans from serialized files.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org