• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Remoting strategies....where to put the business logic?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Many thanks in advance.

Alan
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...

cheers,

Dave.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic