Re: [Figleaf-developer] Re: current state of Introspector
Status: Alpha
Brought to you by:
steckman
|
From: <sam...@ma...> - 2004-07-11 14:44:41
|
I've refactored a few things - ObjectIntrospector has now become a ClassDescriptorFactory - its job is to: 1. Locate ClassDescriptor implementations on the classpath (e.g. MyObjectClassDescriptor if MyObject passed in) 2. Create implementations for classes which do not have ClassDescriptor implementations This is tested, references renamed, and is checked in. InformativeFactory now handles part of what we want - pass in an Informative object, and it gets returned. Pass in an ClassDescriptor and I create an Observable implementation and return a composite Informative object. Pass in a POJO and I try and locate ClassDescriptor and return that as part of a composite object. Next up I have to: 1. Look for an Informative implementation on the classpath 2. Handle users defining their own Observable implementations We do start hitting some complex cases that need clarification. For example what if I'm passing in objects of ClassA in where: * ClassA doesn't implement ClassDescriptor, Informative or Observable * ClassAClassDescriptor and ClassAInformative exist on the classpath? I think order of precedence should go like this: 1. If an object implements Informative, use that 2. If an Informative implementation exists on the classpath use that 3. If the object implements ClassDescriptor, use that and implement the rest 4. If the object has ClassDescriptor on the classpath, use that and implement the rest Actually, I think we need to simplify things (I keep thinking of these things mid email!) - perhaps we should just support the following: 1. If an object passed to the factory implements Informative, use that 2. If an ibject passed to the factory has an Informative implementation on the classpath, us that 3. Otherwise create a implementation. Lets not worry about the developer partially implementing Informative - I think that is getting overly complex! sam |