Hi,

I started to play with SDO2 APIs such as XSDHelper to deal with the XSD 
metadata for Type/Property and ran into some issues.

1) Some model interfaces/classes are generated from EMF 2.1 and now it's not 
compatible with the SDO2 implementations. For example, the following code will 
give me a ClassCastException in 
org.apache.tuscany.sdo.helper.XSDHelperImpl.java.

  public String getLocalName(Property property)
  {
    return extendedMetaData.getName((EStructuralFeature)property);
  }

That's because the property instance I got from the model is 
"org.eclipse.emf.ecore.sdo.impl.EPropertyImpl" instead of 
"org.apache.tuscany.sdo.impl.ReferenceImpl" or 
"org.apache.tuscany.sdo.impl.AttributeImpl". The new implementation class 
extends from the EMF base class and implements the "commonj.sdo.Property" 
interface. But "EPropertyImpl" doesn't not implement "EStructuralFeature".

2) The helper provider discovery doesn't work very well in the Eclipse 
environment.

For exmaple, it searches for the first instance of 
"META-INF/services/commonj.sdo.impl.HelperProvider" file on the classpath to 
read the implementation class name. But the file appears twice in the "sdo.api" 
(src/test/resources) and "tuscany-sdo-impl" (src/main/resources). Depending on 
the order of the classpath setting, you may get wrong HelperProvider instances.

I think it's NOT a problem for the SDO case only. In our code structure, the 
test resources are always in the same project as the main resources. I assume 
it works fine in command-line with finer control of the classpath but not for 
the IDE. Does anybody have any creative ideas for the IDE folks?

Thanks,
Raymond

Reply via email to