-
1. Re: Coupling between namespace object models
aloubyansky Dec 18, 2004 12:34 PM (in response to starksm64)This is a good point.
This issue also raised a few others in my mind regarding this type of object model factories, i.e. the one that uses introspection when adding children to parents.
If you look at the factory implementation, you will see that all addChild methods are 'typed', i.e. parent and child are of concrete Java types. So, as it works today, you would have to move that addChild method you are talking about from JDBCPmMetaDataFactory to XMBeanMetaDataFactory. Which is not really good, since the parent and child are still typed. And XMBean might have some other non-JDBCPm persistence manager.
I'll work on the fix and let you know. -
2. Re: Coupling between namespace object models
starksm64 Dec 18, 2004 12:56 PM (in response to starksm64)Correct, the type binding can only be as strong as the object model itself exposes. The xml framework should not be looking for more explicit type bindings by default. That should not preclude an object factory from choosing to expose type specific injection points, so say the xmbean factory wants to maninpulate the JDBCPm and FilePm prior to establishing the relationship:
public void addChild(XMBeanMetaData xmbean, JDBCPm pm, ContentNavigator navigator, String namespaceURI, String localName) { pm.x(...); xmbean.setPersistenceManager(pm); } public void addChild(XMBeanMetaData xmbean, FilePm pm, ContentNavigator navigator, String namespaceURI, String localName) { pm.y(...); xmbean.setPersistenceManager(pm); } public void addChild(XMBeanMetaData xmbean, Object pm, ContentNavigator navigator, String namespaceURI, String localName) { xmbean.setPersistenceManager(pm); }
Sure this is just a convience for doing type chekcs in the most generic signature, but if its not a big deal to implement its cleaner. -
3. Re: Coupling between namespace object models
aloubyansky Dec 18, 2004 1:03 PM (in response to starksm64)This is exactly how I am going to fix this.
Also there already is GenericObjectModelFactory interface. Which accepts parents and children as java.lang.Object's. Implementations of this interface are not introspected for 'typed' methods. So, everything is delegated to generic methods. -
4. Re: Coupling between namespace object models
aloubyansky Dec 18, 2004 3:37 PM (in response to starksm64)Decoupling phase is done. The testcase is updated. Now, the 'property type' phase...
-
5. Re: Coupling between namespace object models
aloubyansky Dec 18, 2004 4:32 PM (in response to starksm64)It's done.