a) components need to know their ids, they use them to generate markup id, etc.
b) it is a space optimization. an array of components each with their
own id is cheaper on ram/serialization space then a map.
im sure i could come up with a few more, what is really the advantage
of having put(id,component) ?
-igor
On Sat, Mar 1, 2008 at 11:47 PM, John Patterson <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I haven't really thought this through but I was thinking that if the
> id of a component was not a member of a Component but set by the
> parent of the component then child components could be passed to the
> constructor of the parent.
>
> Instead of
>
> Component a = new Component("aid");
> parent.add(a);
>
> Having this:
>
> Component a = new Component();
> parent.put("aid", a);
>
>
> It seems to me that a parent component behaves more like a map of
> child components than a list anyway. Are there reasons why it does
> not work this way? Sorry for what might be a very naive question.
>
> Thanks,
>
> John.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]