commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [betwixt] Inheritance version 2
Date Wed, 02 Jun 2004 20:52:52 GMT
hi Matthew

On 1 Jun 2004, at 12:31, Inger, Matthew wrote:

> One of the things i've run into in my refactoring is this:
>
> I've create a utility class to add the inherited descriptors
> to an XMLBeanInfo class:
>
> 	public static void addInheritance(XMLBeanInfoRegistry registry,
>                XMLBeanInfo info,
>                InheritType type);
>
> where InheritType is an enumerated style class.

ok.

(i've developed a dislike of booch utilities over the last couple of 
years. everytime i've added one, i seem to come back in six months or a 
year and need to make a real object from it...)

> However, when i make a call in the InfoRule to:
>
> getXMLInfoDigester().getXMLIntrospector(), this comes
> up as null when running the test cases, and thus i get
> a null pointer exception when trying to get the
> registry from there.  I can send you the details later,
> as i don't have the code available at this moment (it's at home).

the code would be great :)

you might need to attach it to bugzilla (since the ASF is blocking a 
lot of attachments now)

> It doesn't seem right that the introspector is null.  In a real
> scenario, this would always be set, correct?

yes, it should always be set. sounds like a bug to me.

> The reason i expect the registry is so that the user can pick and
> choose the inheritance they want.  If A extends B extends C,
> then they would first have to add the inheritance from C to B,
> and then from B to A (as they would with the XML).  In order to
> get full inheritance.

that sounds about right.

> But to get the full inheritance in that case, we need to use the
> same registry instance.

i'm not sure that i really understand this.

the XMLBeanInfoRegistry factors out the storage of already introspected 
XMLBeanInfo's from the introspector into a pluggable strategy. this 
allows developers (for example) to create sophisticated caching options 
(if they wish) and to pre-populate the registry with programmatically 
created XMLBeanInfo's.

it's therefore important to ensure that when the inheritance is being 
built up that the registry is checked. the functionality is built into 
the introspector so i don't really understand (at the moment) why the 
standard introspection calls on the introspector cannot be used to 
return XMLBeanInfo's for the ancesters but maybe i've missed something 
so please explain your reasoning.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message