Though as soon as I did this something hit me - if you add a component by itself - and a component doesn't have an ObjectName (at least on the Component interface today) then how does the Container know the ObjectNames of the components? i.e. how can we implement the getComponentNames() method?

(a) I don't think the getComponentNames() adds anything that you couldn't get yourself from the getComponents()
(b) Is it true that every Component has an ObjectName? I don't think it does (necessarily), and I think this assumption could lead to bad coding ...


Maybe I've not grokked this code fully yet but either Container needs a getObjectName() or the addComponent() method should take an ObjectName right? This is echo-ing Jan's previous comment that Component should have a method...

The point of having a separate type for Component is that it should be a component, not an ObjectName.


If you were writing

public interface JMXContainer extends Container {
}

then you might want to restrict everything having an ObjectName, but that's not necessarily going to be the case.

Alex.



Reply via email to