On 04/06/2012 05:18 AM, Vincent Massol wrote:
Hi devs,
In another thread we had a discussion about the new name of the method for looking up
components. We had to provide a new one since we introduced support for Types in
http://jira.xwiki.org/jira/browse/XCOMMONS-121
Thomas has introduced a new lookupComponent() method and has asked in a mail to speak up
if we wanted a different name. I have replied to this thread and explained why I preferred
a new one (see
http://markmail.org/message/lvah3d6f37ak66p3).
I'm copying my rationale here:
"
All looks good except CM.lookupComponent() which Ï don't like a lot for the
following reasons:
* It's a bit long. It's longer than before and it would be nicer if it were as
short as before or even shorter ;)
* It's not symmetrical with other lookups like lookupList and lookupMap, which should
theoretically be lookupComponentList() and lookupComponentMap() which are even longer
"
I've proposed several possibilities and some committers have expressed their
preferences for getInstance*() so I'm officially proposing it here as a VOTE since
it's an important API that we're going to keep for a long time ;)
So this vote is about using:
* CM.getInstance(…)
* CM.getInstanceList(…)
* CM.getInstanceMap(…)
Rationale:
* Shorter than lookupComponent, LookupComponentList, LookupComponentMap
* This is what is used in Guice and Picocontainer and seems to be a well-known name
Here's my +1
IMPORTANT: Please vote quickly since we need to agree before the release of 4.0 final and
4.0RC1 is planned for this coming Monday so it would be ideal to speed up this vote and do
the change today if we agree about it.
+1, but I'm not sure I understand the vote. Wasn't the new name already
voted in another thread?
Actually I'd propose to remove lookupComponent completely, since it was
only visible during the milestones, and keeping it in the API would only
be clutter and a source of confusion.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/