Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remote interface

 
Frank Cheng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sun provided an interface "DB" in the assignment and mentioned that my data access object must implement this interface.
Now I am creating a rmi remote interface which extends DB and Remote. So all the functions defined in the remote interface have to throw a RemoteException. Then there is a compiler error saying "RemoteException is not compatible with throws clause in DB.functionName". Should I change the method throws clause in DB? Does it break the rules of the assignment if I change the throws of the provided interface?
Thanks in advance.
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that will probably break the rules. I wouldn't do that.
J
 
Frank Cheng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jacques,
If my remote interface does not entend DB, it means I need to have another data access object besides the local mode one. It still break the rule that data access object must extend DB.
I am kind of lost here. Any suggetions?
Thanks,

- Frank
 
Denis Spirin
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not mean that you have to write another DAO. You just need another class which implements Remote interface.
Regards
 
Ben Zung
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Cheng. I think this is more of a design issue. You will have to have a class that implements the DB interface, let's say Data. And you will have to figure out a way of provide the services of Data to the clients, not
directly though even with server mode.
I would not let Data extends the Remote. You can draw a diagram first to
model your design. I like to use diagram as that gives you a clear picture of what you have to do and how you want to do it.
Look through this forum, there are lots of good ideas of how to design and implement this assignment. Do a search on anything you want to know, 95% of the time you will get a good results returned to you.
Good luck.
Bing
 
Frank Cheng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me think about it again and do some search on ranch.
Thanks.
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank. Sorry, only got back to this now. But the other guys have given you good food for thought.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic