Development time generation will still be necessary for the static 
interfaces so client code can compile against the static types.
Do you agree?

Regards,
Dan





Jeremy Boynes <[EMAIL PROTECTED]> 
01/23/2006 12:30 AM
Please respond to
tuscany-dev


To
[email protected]
cc

Subject
SDO code generation using ASM






I did a bit of hacking over the weekend and have checked into the
sandbox (http://svn.apache.org/viewcvs?rev=371465&view=rev) a strawman
to illustrate how ASM can be used to code generate the implementation of
SDO objects at runtime.

The intention was to eliminate the need for the users to generate source
code at development time. Instead, when a Type is "defined", ASM is used
to generate an implementation of the static interface plus key methods
from DataObject. All basic properties are held as plain fields so access
via the static interface is just a normal get/set operation. The
implementation also supports get/set using an index that dispatches
using a switch statement; this could be used by the path and Property
based access methods.

I also played around with using Java5 generics in the type system to
simplify the user's access operations (e.g. by eliminating casting) and
I think this could be used to add more type safety to the the dynamic
behaviour. For example:
    <T> T get(Property<T> prop);
    <T> void set(Property<T> prop, T value);

I also toyed with a annotations that can be applied to a static Java
interface to add SDO specific metadata (such as Type name).

The code generation stuff could be used a starter to reduce the
dependency on EMF, or it can be used in conjunction with EMF to avoid
development time code generation.

--
Jeremy

Reply via email to