Hi, > David Jencks wrote: > > +1 on canonical name as internal string representation > > -1 on attempting to preserve whatever string is used to > construct the > > gbean name > > I think the usability value in getting back what you put it > is greater > than having the keys rearranged on you (given the order of > the keys is > not significant to the implementation).
Just as an aside note, JMX may change in the future about orders of the keys. One thing the expert group is evaluating for inclusion in J2SE 6 is to make ObjectName implements Comparable<ObjectName>, and the implementation of compare() be "smart". For example, to "sort" the keys so that the "type" key is always the first. This is intended for further grouping (beyond what you can do with the domain), e.g.: :type=connector,protocol=rmi,transport=jrmp :type=connector,protocol=rmi,transport=iiop "Sorted" this way MBeans are probably more human readable than the case where the keys are in random order. Not that it may be relevant for this discussion, but wanted to let you know. My experience with JMX tells that trying to preserve the string at construction lead to complexity in the implementation (I hope that GBeanNames don't have a GBeanName(String domain, Map keys) constructor) and it is not very often needed. If you specify one canonical form (whatever will it be) to be the only available for GBeanNames I think will be simpler. So I am with David here. My 2 cents, Simon
