Hello there,
I have three questions about this topic, one regarding the up-to-dateness of
the SDO FAQ, one regarding the XSD2JavaGenerator, and one regarding the use
of factories for extensions to generated classes.
The SDO FAQ still states:
"2) I cannot (yet) simply subclass a generated SDO class, this may be addressed
in TUSCANY-513"
while TUSCANY-513 has been resolved in 2007 for Java-SDO-1.0, and Tuscany 1.6
presumably includes
Java-SDO-1.1.
In the generated code, extensibility behaviour is the default, as the base
class for generated
SDOs, DataObjectBase, extends ExtensibleDataObjectImpl. However, the generator
option
"-noExtensibility" which is mentioned in TUSCANY-513 is not accepted by the
generator.
So here are the first two questions:
a) How can I (or someone else) update the FAQ
b) has the generator ever been updated with that option?
Among the generated classes, there is a factory class with a create method, e.
g.:
public DataObject create(int typeNumber)
{
switch (typeNumber)
{
case TYPE1: return (DataObject)createType1();
case TYPE2: return (DataObject)createType2(); // (*)
default:
return super.create(typeNumber);
}
}
Here is the third question:
Now, when I extend the generated implementation class of type 2, and want to
use that
subclass everywhere instead of the generated class, can I simply edit the
factory? e. g.
replace line (*) with
case TYPE2: return createSubclassOfType2();
where createSubclassOfType2() is not a generated method but defined by me?
-- Sebastian