File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes data type -- interface of RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "data type -- interface of RMI" Watch "data type -- interface of RMI" New topic
Author

data type -- interface of RMI

Jimmy Hu
Greenhorn

Joined: Feb 05, 2001
Posts: 17
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


Jimmy
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
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 ]

scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
Jimmy Hu
Greenhorn

Joined: Feb 05, 2001
Posts: 17
I can see your way works.
Is there an elegant way?
I appreciate your quick response.
Thanks
Jimmy
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
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

Joined: Jan 30, 2002
Posts: 3451
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


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: data type -- interface of RMI