File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI server questions 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 "RMI server questions" Watch "RMI server questions" New topic

RMI server questions

Eduard Mamedov

Joined: May 20, 2010
Posts: 23
1) Does server need functionality of Data class like (create, delete operation...).... My server provides only "book" and "strictSearch" methods (as needed to GUI client)....When I search this forum, I found that some people creates DBRemote inteface, that extend Remote, DB... (maybe it need for fat clients??) I'm little bit confused.....Is this ok to implement server with only business methods......

2) Can i use this interface both for local and network mode:

public interface BusinessService {
void bookRoom(int recNo, String owner) throws NoRoomFoundException, RemoteException;
Map<Integer, Room> strictSearch(String[] criteria) throws RemoteException;


ServiceLocal have implementation of BusinessService's methods, and ignoring RemoteException. ServiceRemote is adapter to ServerLocal (delegate own methods to ServiceLocal methods)....

Or this ugly decision?

Roel De Nijs

Joined: Jul 19, 2004
Posts: 8395

1/ You can use a fat client or a thin client. With the 1st one you will expose methods from the given interface to the client; with the other one you will only have 2 methods (find and book). Both approaches are acceptable. A nice discussion about this topic can be found here.

2/ an interface implementing another interface Are you sure you passed the scjp certification? But I just used the BusinessService for both local and remote implementations, other people used your approach, with either one you can pass this certification.

SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
Roberto Perillo

Joined: Dec 28, 2007
Posts: 2271

Howdy, Eduard!

Here, you can find a proposal of a thin client. Although I implemented a thick client, if it was today, I would definitely implement a thin client, because I think it eases the solution. If your lock() method does not return any value, then implementing a thick client is a little bit harder.

Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Eduard Mamedov

Joined: May 20, 2010
Posts: 23
Thanks for replies! As always, very usefull advices
Roel, it was misprint
I agree. Here's the link:
subject: RMI server questions
It's not a secret anymore!