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

B&S, is DBMain interface the remote interface to client?

 
Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am working on B&S assignment. I do not like the given interface DBMain for a couple of reasons:
1) it does not declare any checked exceptions for error in backend database, which is generally present so that client can react to such error.
2) it does not use any VO type of classes, instead it simply uses String array, which lacks of explicit type checking.

I wonder if it would be OK for me to extend that interface and create a new one, something like MyDBMain interface, and then use this new interface as the contract between my client and server. In other words, I am going to bypass the given DBMain interface entirely, it is there simply because the assignment says that I have to implement it.

The only fear I have is that Sun expects me to use DBMain, not anything else as the remote interface, although my assignment does not explicitly say so.

Thanks.
Yan
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Yan Zhou:
Hi there,

I am working on B&S assignment. I do not like the given interface DBMain for a couple of reasons:
1) it does not declare any checked exceptions for error in backend database, which is generally present so that client can react to such error.
2) it does not use any VO type of classes, instead it simply uses String array, which lacks of explicit type checking.

I wonder if it would be OK for me to extend that interface and create a new one, something like MyDBMain interface, and then use this new interface as the contract between my client and server. In other words, I am going to bypass the given DBMain interface entirely, it is there simply because the assignment says that I have to implement it.

The only fear I have is that Sun expects me to use DBMain, not anything else as the remote interface, although my assignment does not explicitly say so.

Thanks.
Yan


Use the Adapter Pattern. If your using RMI, you have no choice since your RMI methods will throw RemoteException.

/pkw
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic