Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NX:Expanding the provided DB interface  RSS feed

 
Trym Moeller
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
When implementing the DB interface I open a file in the constructor of the implementing class. To close this file I either need add a method to the interface (void exit() or only add the method on the implementing classs and then cast the interface to the implementing class to call it.
Do you think it's alright to add mthods to the interface?
Best regards Trym
 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My understanding is we can't add methods to the interface. I also have a couple situations where I do some casting as you mention above.
TJ
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!