Jigsaw API nit: VersionQuery and Comparator<Version>

Mark Reinhold mr at sun.com
Fri May 8 12:06:50 PDT 2009


> Date: Fri, 08 May 2009 11:04:18 -0700
> From: jonathan.gibbons at sun.com

> Minor API comment:
> 
> It's weird having VersionQuery implement Comparator<Version>.  In
> principle, this means that different version query instances could
> provide different implementions of the comparator.

My thinking at the time was that this would allow a query also to express
the desired version ordering ("ORDER BY" in SQL terms) in case you wanted
something other than the natural order.

That was at best a half-formed thought, however, and since I haven't seen
an actual need for this yet I'm happy to remove it.

>                                                     It would make more
> sense for Library or some other "more-singleton" item to provide the one
> true comparator for the system, without having to cons up VersionQuerys
> just to get the Comparator functionality.

The Version interface implements Comparable so that specific module
systems can define whatever natural ordering is preferred.

- Mark



More information about the jigsaw-dev mailing list