Discussion:
[xwiki-devs] [VOTE] Use ComponentManager.getInstance*() instead of lookupComponent/LookupList/LookupMap
Vincent Massol
2012-04-06 09:18:44 UTC
Permalink
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.

Thanks
-Vincent
Marius Dumitru Florea
2012-04-06 09:31:33 UTC
Permalink
+1

Thanks,
Marius
Post by Vincent Massol
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).
"
All looks good except CM.lookupComponent() which Ï don't like a lot for the
* 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 ;)
* CM.getInstance(…)
* CM.getInstanceList(…)
* CM.getInstanceMap(…)
* 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.
Thanks
-Vincent
_______________________________________________
devs mailing list
http://lists.xwiki.org/mailman/listinfo/devs
Jean-Vincent Drean
2012-04-06 09:34:19 UTC
Permalink
+1
Post by Vincent Massol
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).
"
All looks good except CM.lookupComponent() which Ï don't like a lot for the
* 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 ;)
* CM.getInstance(…)
* CM.getInstanceList(…)
* CM.getInstanceMap(…)
* 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.
Thanks
-Vincent
_______________________________________________
devs mailing list
http://lists.xwiki.org/mailman/listinfo/devs
--
Jean-Vincent Drean,
XWiki.
Thomas Mortagne
2012-04-06 09:53:11 UTC
Permalink
+1
Post by Vincent Massol
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).
"
All looks good except CM.lookupComponent() which Ï don't like a lot for the
* 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 ;)
* CM.getInstance(…)
* CM.getInstanceList(…)
* CM.getInstanceMap(…)
* 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.
Thanks
-Vincent
_______________________________________________
devs mailing list
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne
Sergiu Dumitriu
2012-04-06 20:43:23 UTC
Permalink
Post by Vincent Massol
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).
"
All looks good except CM.lookupComponent() which Ï don't like a lot for the
* 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 ;)
* CM.getInstance(…)
* CM.getInstanceList(…)
* CM.getInstanceMap(…)
* 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/
Vincent Massol
2012-04-06 21:26:09 UTC
Permalink
Post by Vincent Massol
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).
"
All looks good except CM.lookupComponent() which Ï don't like a lot for the
* 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 ;)
* CM.getInstance(…)
* CM.getInstanceList(…)
* CM.getInstanceMap(…)
* 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?
It was just a proposal between various possibilities in another thread.

I didn't get that many answer and wanted to be sure since it's a major api we use in lots of places…
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.
Yep.

Done!

Thanks
-Vincent

Loading...