Hi All and especially Andrus and Kevin. I need to discuss some things
on my project. Also I need comments.
Currently I implemented big hierarchy of serializers/deserializers to
provide mostly all of query and sync capabilities. Code at
https://svn.objectstyle.org/repos/soc/trunk/cayenne-ropwsdl/. It
succesfully works on my test applications (i will try to do more
complex way to test them).
Current architecture:
Serverside:
- AXIS web service with CayenneRemote module installed.
- No business logic classes needed on serverside.
- All entities mapped to CayenneDataObject class.
- Has big static WSDL with Cayenne type hierarchy adapted
to XML.
- Users can create their serverside distributions based
on cayenne-axis.jar and cayenne-axis-server project
stub.
Clientside:
- Has it's own configuration files with entites mapped to
concrete java classes (or maybe something else on other
languges in future).
- CayenneDataObjects deserialized to these concrete
classes.
- No java-specific info provided by network. So entity
resolving based on local config.
Questions:
1. It seems like most of Cayenne classes can not be serialized or
deserialized without accessing their private fields through
reflection. I placed "//TODO" at places in cayenne-axis project where
private fields are accessed.
To avoid cyclic blocking dependences in deserialization process I need
to provide initial deserialized value at the early stage of
deserialization. Most of Cayenne classes constructors need child
objects to be deserialized to invoke. And in many cases these child
objects need parent object to be created before. To make
deserialization work I povided constructors of many objects with fake
values and then replaced these values with deserialized correct ones
(using reflection).
So it works. But it's wrong. Some comments - what can I do with it?
2. My web service can work without client business logic classes on
serverside. But I need different .map.xml files on server and client.
On serverside all entities must be assigned to CayenneDataObject class
instead of actual business logic classes.
Maybe I can write an ant task to convert xml files provided by
modeller. Is it ok?
3. Client classes must be subclasses of
org.apache.cayenne.remote.axis.ClientCayenneDataObject.
It copies implementation of CayenneDataObject with some changes:
It uses getObjectContext() instead of getDataContext() in methods
addToManyTarget(), removeToManyTarget(), setToOneTarget(). So these
methods still work when provided context is not DataContext.
It seems like such use of getObjectContext() instead of getDataContext() can
be implemented in main cayenne distribution. Or am I wrong?
Also there is a method named validateForSave() which will not work
without local DataContext...
4. It would be better to remove .driver.xml file (with db info) from
client side. But I need working local configuration on client side to
map entities to classes and do validateForSave() (etc...). Is there
some crorrect way to make configuration work (maybe partly) without
.driver.xml class?
----------------------
Best regards,
Michael Victorov.
This archive was generated by hypermail 2.0.0 : Mon Aug 07 2006 - 12:05:45 EDT