• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Methods add and delete

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
what should I do in the methods add and delete of the data class?
Since they are included in my data interface, should I make them throw DatabaseException("method not supported")?
I know that I dont use them in this application, but if they want to reuse the database, I have to make sure no body calls them...
what is the best approach?
daniela
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Since they are included in my data interface, should I make them throw DatabaseException("method not supported")?


These methods are supported (they have a complete and functional implementations), they are just not used. Let them exist (for future use)!
Eugene.
 
Daniela Ch
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but eugene they are not completed...
in the comments of the add, the intern said that
first field, the key, must be unique in the database or his is going to throw runtime exception (i know that he should not) but he dont do this check in the method...
do i have to complete it?
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


first field, the key, must be unique in the database or his is going to throw runtime exception (i know that he should not) but he dont do this check in the method...


Yes, there is such a check (at least in my version of Data.java):

Again, all the methods of Data (except for possibly lock/unlock) are functional and complete. So leave them alone.
Eugene.
[ January 03, 2003: Message edited by: Eugene Kononov ]
 
Daniela Ch
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hehehe ok fine!!! I will leave them alone
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Daniela,
It's time for you to submit. I think you are way too done with your project :roll:
 
reply
    Bookmark Topic Watch Topic
  • New Topic