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

Implementing Sun's DB Interface

 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there are a few methods I dont see any use for in this project, specifically delete and create, am I to provide empty bodies for these methods?
in doing so I will still be implementing the interface as required, it doesn't say to define every method in the interface, and specifically says to conform to specification, extra features dont receive full credit.
could I have misunderstood the requirements?
I've read it a few times and it seems to be clear as day in that respect.
The reason I feel uncomfortable regarding my understanding of the requirements is that it appears that only one field will ever be updated in this project, no records deleted, created, and modification only happens to a single field.
please excuse the long post, and thanks for your time
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would just like to say that if you do not want to fully implement a method you should at least throw an UnsupportedOperationException.
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Gaunt:
I would just like to say that if you do not want to fully implement a method you should at least throw an UnsupportedOperationException.


would love to but thats not possible, the overriden method doesn't throw that exception
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a second question regarding this, the instructions want this interface implemented by suncertify.data.Data, and the interface is packaged in suncertify.db.DBMain
is it ok to implement it this way?
i would choose to package them together although it could be done both ways, or am I missing something, just makes sense packaged together
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ta Ri Ki Sun:

would love to but thats not possible, the overriden method doesn't throw that exception

You can, because it's a RuntimeException, that is unchecked. (I guess that's why we have to do SCJP first )
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Gaunt:

You can, because it's a RuntimeException, that is unchecked. (I guess that's why we have to do SCJP first )


bah, well spotted, i'd better go home now, been at it for 14 hours straight
 
Michael Dreese
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ta Ri Ki Sun:
i have a second question regarding this, the instructions want this interface implemented by suncertify.data.Data, and the interface is packaged in suncertify.db.DBMain
is it ok to implement it this way?
i would choose to package them together although it could be done both ways, or am I missing something, just makes sense packaged together

Is your assignment about the home improvement contractors? For my assignment, the interface DB is packaged in suncertify.data. Also, Data.java must be in suncertiy.data and must implement DB interface. Hopefully, there is no mistake from Sun again. I think Sun made a mistake on the data file format on the provide db file.
Cheers,
Michael
 
Michael Dreese
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ta Ri Ki Sun:


would love to but thats not possible, the overriden method doesn't throw that exception

Have you tried " throw new java.lang.UnsupportedOperationException(
"Method find() not yet implemented.");" ?
I guess that would do the trick.
Cheers,
Michael
 
Thomas Kijftenbelt
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I had the same question (to be honest I would also package them in the same package...) but the instructions state that they should be in two different packages.
I guess you don't have to implement all the methods you won't use (like create / delete).
good luck,
TK

SCJP2 / SCWCD
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just an an FYI, I did create those methods, just because my beta required that I create my own DB, per the given requirements.
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
Sun qinlong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
also I am confused about the method such delet and create because i think they are not used in the assignment first .but after think about I think does it need to delet a record after a user has booked whih making the flag OXFF which can gurand that the next user can't booked again .
and use tne created method after the user who booked the record left.
does it all right ?/
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sun qinlong:
hi
also I am confused about the method such delet and create because i think they are not used in the assignment first .but after think about I think does it need to delet a record after a user has booked whih making the flag OXFF which can gurand that the next user can't booked again .
and use tne created method after the user who booked the record left.
does it all right ?/

either we have different assignments or I am indeed reading this wrong, because my app allows a user to book a room, and these rooms are not permanently available, instead they're available for one night only, and the only flag is a customer id, and if its blank, then the room is available (other conditions apply)
so to me this appears simple, so simple its unbelievable these are the requirements, which is why I'm concerned I've read it wrong.
 
shan chen
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ta Ri Ki Sun:
i have a second question regarding this, the instructions want this interface implemented by suncertify.data.Data, and the interface is packaged in suncertify.db.DBMain
is it ok to implement it this way?

I have the same problem. I asked SUN and they admitted DBMain should be in "suncertify.data", not "suncertifiy.db".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic