• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

design problems

 
Ray Cheeny
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have several questions:
(1) I use Facade and MVC design patterns in my client side. The model have an instance of Facade.
Is that right?
(2) Should I declare "throws xxxException" in the Facade and let the model catch it ,or catch it in the Facade?
(3) I have one DataInterface and both remote and local data extends it. Is that right? If I do this,the local data have declare "throws RemoteException" ,I think it may be bad. Need I put the DataInterface in both client and server side?
Thanks
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ray,
(1) I use Facade and MVC design patterns in my client side. The model have an instance of Facade.
Is that right?

Sounds like a reasonable way to do it.
(2) Should I declare "throws xxxException" in the Facade and let the model catch it ,or catch it in the Facade?

That depends.
Is the exception something that the facade can handle itself? In which case you might want to have the facade catch it and handle it.
Is the exception something you want passed to the MVC? You might want to hide an RMI exception by catching it in the facade and then throwing a more general exception up to the MVC.
Is the exception something that the MVC should inform the user about? In which case you might want to just throw it directly.
(3) I have one DataInterface and both remote and local data extends it. Is that right?

This is similar to what I did.
If I do this,the local data have declare "throws RemoteException" ,I think it may be bad.

See my earlier comment about catching a specific exception and throwing a generic exception.
Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic