• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface problems

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,
Right now I did the same. One interface which says
interface A extends Remote {
method1 throws RemoteException();
.....
}
and my server and data class implements this interface.
I think for local client we should not use Remote, RemoteException. Iam struck with this point. Can u pls suggest me something ?
 
Enrico Mannarino
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this
interface A (for local use)
interface B extends Remote, B (for server use)
Enrico
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, just have the interface throw Exception, in the implementing classes you can then have it throw a more specialized exception. For instance the RemoteImplementation throws RemoteException and DatabaseException, and Local throws DatabaseException, or something like that.
Mark
 
Enrico Mannarino
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the no was meant for me, Mark, I disagree with you. My first design was like you propose, but I think the second one is better so I'm going for that one know.
It's not really a big deal.
 
Enrico Mannarino
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FYI, look at this topic!
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=25&t=000832
/Enrico
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic