design problems
posted 22 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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
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
posted 22 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Ray,
Sounds like a reasonable way to do it.
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.
This is similar to what I did.
See my earlier comment about catching a specific exception and throwing a generic exception.
Regards, Andrew
(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
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
| She still doesn't approve of my superhero lifestyle. Or this shameless plug: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |








