[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Annotation processing

adrian@jboss.org do-not-reply at jboss.com
Tue Sep 4 09:04:42 EDT 2007


"alesj" wrote : 
  | No.
  | I mean that referencing MetaDataContext in MetaDataRetrievalToMetaDataBridge via 'instance of' is not what I would consider good OO. Specially with a name yelling out the purpose - Retrieval bridge ... not Context bridge. :-)
  | 

I agree, but the MetaData was never originally designed to retrieve structure
which is what MetaDataContext adds to the retrievals.

i.e. MetaDataRetrieval instanceof MetaDataContext == isRetrievalStructured()

The MetaData is actually designed to hide the structure so the client doesn't have to know
about it, i.e. it does not (need to) know what hierarchical scopes are linking retrievals together.

Its only this AOP requirement/optimization to ask if there is any instance metadata
(and only create a proxy if there is) that introduces the need to know structure.

Maybe we should leave it as the simple hasInstanceMetaData() on the MetaData api
and forget about revealing structure through an api that wasn't designed for it?
But you're still going to need to do the ugliness inside the bridge either way.

It's still better to have the ugliness hidden inside MetaData than
have AOP + others trying to play with things they almost certainly don't understand. :-)

I have similar thoughts about some of the code I did for the 
ScopeInfo/ScopeBuilder which virtually duplicate the same code
to initialize non-existant scopes.
It would be much better to hide the ugliness inside the metadata api.

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

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



More information about the jboss-dev-forums mailing list