This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data type -- interface of RMI

 
Jimmy Hu
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have this question based on my SCJD work.
If in the remote interface, some return type and parameter type refer to some class definition in server side, what is the proper way to handle it in client side?
My instinct tells me it is not a good practice to provide the duplicate class definition in client side in order to make the interface in client side compilable.
Thanks in advance
---
Jimmy
 
Nate Johnson
Ranch Hand
Posts: 301
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this will answer your question, but I just imported my db package in my client and packages the db classes with the client... not the most elegant, but definitely the most lazy . I only lost 5 point on the entire project, so take my approach as you will .
[ August 26, 2002: Message edited by: Nate Johnson ]
 
Jimmy Hu
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can see your way works.
Is there an elegant way?
I appreciate your quick response.
Thanks
Jimmy
 
Nate Johnson
Ranch Hand
Posts: 301
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jimmy Fang:
Is there an elegant way?

I think the best way would have been to put the interfaces and stubs right in the client. Maybe some others can talk a bit about the ways they did it?
[ August 27, 2002: Message edited by: Nate Johnson ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jimmy,

My instinct tells me it is not a good practice to provide the duplicate class definition in client side in order to make the interface in client side compilable.

Why? You should strive to decouple the server/db package classes from the client package classes as much as is practical, but inevitably the client will have to have some knowledge of some of those classes. I worked very hard to accomplish that in my design. Data itself was unknown to the client, but DataInfo and FieldInfo were necessary for a couple of classes on the client. I just imported the necessary packages as Nate did and never concerned myself with it.
Hope this helps,
Michael Morris
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic