• Post Reply Bookmark Topic Watch Topic
  • New Topic

B&S: Adding methods to Data that are not in DBMain

 
Eric Alex
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiya,

My Data class implements all the methods that are specified in the DBMain interface. I've also added some other methods to the class that I feel that I need like:
getNumberOfFields()
getFieldNames()

Question: Is this ok or is the Data class ONLY supposed to contain the methods specified in the DBMain interface?
 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,
 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wooooops!

Hi Eric,

I added 2 additional public and 2 additional private methods to my implementing class. No problems with that at all. I would NOT add these method declarations to the supplied interface, though. Leave that untouched. Hope this helps.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!