Hi folks...Im presently working on a swing rich client talking to a back end.
We will be taking the route of remoting, and we hope to try hessian/burlap/anything that comes with spring framework etc...
However, from a rich client perspective, the objects received from the server side are "dumb", basically a graph of objects for the client to navigate, containing "data".
I would like to layer business logic on these objects and im searching for some options here...basically I wish to create a "domain model" on top of the dumb model receved from the server..
There is a concern that by pushing all the business logic in to the objects from the back end would bloat their sice for transport across the wire. And this client side business logic is of no interest to the server side...
The other option would be to "wrap" the dumb objects on reception in "smart" business objects that contained related processing. This would likely mean implementing a business interface on the client and delegating any necessary calls straight to the received "dumb" objects. So, on reception of, say 100 dumb objects....id have to generate 100 "smart" objects that delegated to the dumb objects.
Has anyone any good experience of elegant strategies to use here?
one option that you might want to look at is JDO 2 - JPOX is a good open source implementation, and Versant and others produce commercial implementations.
with JDO 2 you can use disconnected object graphs, and pass these to your client. So effectively, you can pass an entire graph of domain objects between your client and server, and these can have all of the validation logic that you might want on your client side, plus any other business logic needed inside these domain model objects.
of course you don't need JDO to pass graphs of domain model objects between a client and server - the advantage with JDO is that it also provides a solution for persiting the objects to and from a database.
And I've never used Spring, but I understand that it has pretty good support for plugging in a JDO provider...
Dave Clark<br />Senior WebSphere Architect<br /><a href="http://www.versant.com" target="_blank" rel="nofollow">Versant Open Access - JDO2 & EJB3</a>
subject: Remoting strategies....where to put the business logic?