If what you're saying is true, then what is the point of the binding.xml file
in the first place? I thought its point was to resolve naming conflicts?


I think we're not properly understanding each other... let me quote a line
from the generated file "Object2DType.java":


private nl.inl.test.types.ShapeType _object2D_shapeType;


Note that the class "ShapeType" was NOT generated. Now, see the name of that
member? "_object2D_shapeType". That's ONE character away from the class name
he should be using! So disambiguating is not rocket science here, in fact
Castor knows the kind of shape we're dealing with: it's the 2d shape that
can either be "circle" or "triangle", and not the 3d shape that can either
be "sphere" or "cube". So it's far from impossible for Castor to
disambiguate. If Castor had generated the code


private nl.inl.test.types.object2D_shapeType _object2D_shapeType;


the generated sources would compile and work correctly. As it is now, Castor
has generated something that doesn't even compile. In fact, it is so close I
could change it by hand, but I think you'll agree that wouldn't be workable
(I'd get a big list of manual changes I'd have to work through each time the
schema changes).


Sorry if I seem annoyed, I appreciate you're trying to help, but I really
don't see what the problem is here.. it seems like a fairly trivial bug, it
doesn't require any intelligence on Castor's part, just correct application
of my schema and binding file.



Uday Kari wrote:
> 
> That is how I dealt with it.  You are running up against a fundamental
> brick wall when you do what you are trying to do, which is to treat XML
> and OO Design as essentially equivalent...which they are obviously not.
> 
> 
> Just like there is a "O-R Impedance", there is a I "O-X" Impedance and
> perhaps a third "R-X Impedance".  Castor is just trying to do its best
> to map between the three worlds of Object, Relational and XML.  No
> matter how much you try, these worlds will *never* be exactly mapped.
> Hence, the simplistic word "impossible".  
> 
> Just think about it.  If we do it you way, then we probably will have
> disambiguate every single child class of every since castor class all
> the way down to java.lang.object!  This would obviously be a fools
> errand.  That is why we need to use some tricks like using different
> packages if you must or, even more simple, just using different names if
> you can.  
> 
-- 
View this message in context: 
http://www.nabble.com/Generator-trips-over-different-elements-with-same-name-tf3472379.html#a9708208
Sent from the Castor - User mailing list archive at Nabble.com.

Reply via email to