Sebastien, There's the basis of a Java interface to SDO generator at [1] but it hasn't been developed to a working state and hasn't been looked since the initial drop of code into Tuscany. It would be great to get this or similar function up and running.
If you take a look at the noInterfaces test [2] of the toolsTest project you'll see that we don't need interfaces, we can use classes. I think in the scenario that you paint it's just abut possible you may just about be able to get away without a factory. As evidence I changes the referenced sample [2] to have //com.example.noInterfaces.simple.Quote quote = //(com.example.noInterfaces.simple.Quote)scope.getDataFactory().create(com.example.noInterfaces.simple.Quote.class); com.example.noInterfaces.simple.Quote quote = new Quote(); and the test passed. But this wouldn't be acceptable in general. The major showstopper that occurs to me instantly is having a Type that has a Property of a generated Type. so the call to myComplexType.createDataObject("myPropertyOfGeneratedType"); must have a means to create a child DataObject using the generated class rather than the generic DataObject. It does this by maintaining an association with the Type of the Property and the associated Factory. Regards, Kelvin. [1] http://svn.apache.org/repos/asf/incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java [2] http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools-test/src/test/java/org/apache/tuscany/sdo/test/GenPatternsTestCase.java?view=markup On 17/11/2007, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote: > kelvin goodson wrote: > > If you are discounting using XSD for the source of metadata to > > describe the SDO types then there is the SDO API provided for dynamic > > metadata creation. The sample at [1] gives an introduction to this. > > The paper at [2] discusses the subject also, and the program > > underlying the discussion in the paper is at [3] (no change > > monitoring) and [4] (with change monitoring). > > > > You say that you want to write the minimum code. There is a quick and > > simple Tuscany API for simple cases that you could use instead (See > > the MetaDataBuilder inner class in [5]). Whilst the code to create > > the type system with this project specific API is simple to understand > > and implement it has some drawbacks. We don't have a sample program > > for this, but I believe the DAS uses it) I'm happy to discuss further > > if you want some more insight into this. > > > > Kelvin. > > > > > > [1] > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/intermediate/DynamicCustomerTypeSample.java > > [2] http://java.sys-con.com/read/358059_2.htm > > [3] > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/MedicalScenario.java > > [4] > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/MedicalScenarioWithChangeMonitoring.java > > [5] > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sdo/lib/src/main/java/org/apache/tuscany/sdo/api/SDOHelper.java > > > > > Thanks. > > Follow-up questions: > > - Is there an SDO Helper that can introspect my handwritten Item Java > class and drive the calls to the TypeHelper APIs? If not, can I add one? > > - I see that I can associate a class with a type, does it have to be an > interface or can it be a class? > > - If it can be a class do I really need a factory class or is the SDO > runtime able to instantiate the class? > > - I see methods like getStaticType on generated SDOs, do I need to > implement that method in my handwritten SDO and why? > > -- > Jean-Sebastien > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]