File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI server questions

 
Eduard Mamedov
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;
}




and


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
Sheriff
Posts: 9157
76
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eduard Mamedov
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replies! As always, very usefull advices
...
Roel, it was misprint
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic