What about introducing a remove(String) method that must be called to
avoid exception? This will focus reader's attention on that there were
another child with that name that was removed to free place for new
one, and at the same time prevent accidental developer mistakes with
creating components twice.

In this case this will not throw exception:

new TextField(this, "name");
this.remove("name");
new TextField(this, "name");

And this will throw:

new TextField(this, "name");
new TextField(this, "name");

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to