[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Moving out of the UnifiedClassloaders

adrian@jboss.org do-not-reply at jboss.com
Wed Jan 30 12:24:59 EST 2008


"alesj" wrote : "adrian at jboss.org" wrote : 
  |   | But it's one of those N^2 problems in writing comparators between
  |   | all the different versions, e.g. our own, maven, osgi, java manifest, jdk7 module system, etc.
  |   | 
  | I've taken this approach.
  | Since I doubt the N will be big. :-)
  | 
  | Adding VersionComparator:
  | 
  |   | public interface VersionComparator<T extends Version, U extends Version>
  |   | {
  |   |    /**
  |   |     * Compare the two version impls.
  |   |     *
  |   |     * @param t T version impl
  |   |     * @param u U version impl
  |   |     * @return compare the two version impls
  |   |     */
  |   |    int compare(T t, U u);
  |   | }
  |   | 
  | and a VersionComparatorRegistry singleton to keep all the known implementations.
  | 
  | And changing the Version class to delegate the compareTo to the registry:
  | 
  |   |    public int compareTo(Version v)
  |   |    {
  |   |       VersionComparatorRegistry registry = VersionComparatorRegistry.getInstance();
  |   |       return registry.compare(this, v);
  |   |    }
  |   | 


There are a number of issues with this,
I'll start a new thread
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124882#4124882


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124883#4124883

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124883



More information about the jboss-dev-forums mailing list