[ome-devel] model description driven code generation

josh.moore at gmx.de josh.moore at gmx.de
Mon Jul 6 10:31:26 BST 2009


re-send & reply.

zag at crs4.it writes:
 > 
 > > A few words of warning:
 > > 
 > >   1) though the OME-Perl server was built with exactly this use in
 > >   mind, and OMERO was _originally_ built to include it, we've made
 > >   other design decisions since then. By doing this, you are breaking
 > >   API compatibility with the official clients, and will have to
 > >   package your own. Similarly, your clients will not be able to work
 > >   with the official server.
 > 
 > Does this mean that adding a new model has side effects on the code
 > generated for the others? If so, how?

By modifying the model, you are changing the on-wire binary
representation. It *might* be possible, if you are very careful, to
create a model that would work in with server/client hybrids. But I
don't think so. My experience is that model changes will break
communication. To understand why, imagine adding the type:

 class MySuperAnalysis {

    private long valueA;
    private long valueB;
    // etc.
}

and then the relation:

  image.getMySuperAnalysis()

what is a client to do with all the bytes which make up
mySuperAnalysis as they come over the wire?

 > >   2) in the mid-term, we will be trying to move the code generation to
 > >   no longer use the files under model/resources/mappings, and instead
 > >   to use the XSD definitions directly. If you begin to build
 > >   significant infrastructure based on this code generation, we may
 > >   should talk first.
 > 
 > This is rather interesting, since what we will try to do is to put in
 > some OpenEHR derived objects. We did write some time ago a ADL (the
 > model description language used to describe OpenEHR 'models') to XSD
 > converter: it was an ugly piece of code, but we did learn something and
 > we can probably rewrite it better now. In the code generation, are you
 > also considering the production of automatic object validators?

Yes, to some degree.

 > > If the above isn't enough to scare you away and you'd still like more
 > > information, ping me and I'll setup a wiki page on the trac. 

 > Please do setup the wiki page :-).
 > --gianluigi

Will do.
~josh.


More information about the ome-devel mailing list