Why should setParent() be a final method? In fact, aren't you
guys using "final" on your classes and methods a bit too aggressively?

Gili

On Mon, 03 Jan 2005 12:25:56 +0100, Eelco Hillenius wrote:

>Why is it important that a parent, once set, may never be changed?
>
>    final void setParent(final Container parent)
>    {
>        if (this.parent == null || parent == null)
>        {
>            this.parent = parent;
>        }
>        else
>        {
>            throw new IllegalStateException(exceptionMessage("Cannot 
>change parent once set"));
>        }
>    }
>
>I have a concrete usecase, where I remove and recreate all childs of a 
>border, except - as I work with a menu-like component - for a 'current' 
>panel, that I just want to re-add.
>
>I'd like to propose:
>
>    final void setParent(final Container parent)
>    {
>        this.parent = parent;
>    }
>
>Objections anyone?
>
>Eelco
>
>
>-------------------------------------------------------
>The SF.Net email is sponsored by: Beat the post-holiday blues
>Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
>It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
>_______________________________________________
>Wicket-develop mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/wicket-develop
>




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to