• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding isClosed() to Data class.

 
Mike Youngstrom
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did anyone else add an isClosed() method to their Data class or Data Interface to help stop the client from sending commands to the database when it's been closed or shutdown?
Does anyone think it would be a bad idea to add the method to the Data class? Meaning do you think I'd be penalized?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the data class is closed, does it still exist for clients to call isClosed()?
Did you extend the Data class? If you had to have an isClosed method could you put it in another class to handle that for you?
The big question is... Is it the responsibilty of the Data class to let others know that it is closed? It is it's resposibility to know what to do when someone calls close on it. But that the fartherest I believe it needs to do.
the work around for the clients is to throw Exceptions to the client, when the database is not available, and handle it there.
Mark
 
Mike Youngstrom
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
O.K. Thanks. I did add an isClosed method to my Facade interface and I implement the functionality of it in the facade and not in Data. So I should be O.K.
Thanks again for your help Mark,
Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic