cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <>
Subject Re: Coexisting with WebObjects
Date Sat, 13 Aug 2011 03:34:49 GMT
On Sat Aug 13 09:47:22 2011, John Huss wrote:
> Is it possible to use ROP (serialized data objects) and regular data objects at the same
time?  In EOF each editing context is backed by a different object store and the remote objects
have a special remote object store.  As long as the two types of objects are separate you
can use both at once.

It works like this:

DB (tier 1) ---> Server application (tier 2) --> Client application 
(tier 3)

So the ROP objects exist only on tier 3 (which might be a J2EE app, 
Swing client application, etc) and the regular server objects on tier 
2. There is no cross over: when you commit in tier 3, the corresponding 
objects appear on tier 2. The two types of entity classes actually are 
in different packages so they are quite separate to each other. 
Normally the link between tier 2 and tier 3 is some sort of network 
connection: Cayenne uses the Hessian library to serialise objects (even 
objects which aren't serialisable!) so they can be transported easily 
over a connection. In my case I use Jetty.

Now it is possible to run tier 2 and tier 3 within the same 
application, faking the connection between the two. In fact one of my 
developers is doing that right now in order to make running test suites 
easier in a combined application rather than as server/client.

For those people unfamiliar with this 3 tier structure, an advantage is 
that the third tier doesn't talk to the database directly. That means 
that the server can implement any sort of business logic you want. For 
example, the client app might save a new record, but the server 
application has the listeners in place to create audit trail records, 
perform additional server-side validation, etc. Not only do you move 
processing load off the server, but you don't have to trust the client 
application with a write password to the whole database. This applies 
whether you are running J2EE, desktop applications, or whatever.

I think that Andrey has considered merging the ROP object classes with 
the regular server entity classes, and that would make sharing code 
(eg. validation) much easier between the two. However that hasn't 
happened yet and the object classes, and the context class is quite 
different. I am not sure whether Andrey is still working on that code 
or how hard it might be.

Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

View raw message