*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Update method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Update method" Watch "Update method" New topic
Author

Update method

Dalibor Kalna
Greenhorn

Joined: Sep 17, 2004
Posts: 8
Hi all,

in my update method I'm concerned only about owner. That means I skip all fields in record beeing updated and I stop in front of owner field. Then I perform write. Is that right ? Could I ignore the other stuff completely ? This would be minimalistic but sufficient.

Thanks
Dalibor


SCJP, SCJD in progress, SCWCD, SCBCD, SCSA, WMCID
Anton Golovin
Ranch Hand

Joined: Jul 02, 2004
Posts: 476
Originally posted by Dalibor Kalna:
Hi all,

in my update method I'm concerned only about owner. That means I skip all fields in record beeing updated and I stop in front of owner field. Then I perform write. Is that right ? Could I ignore the other stuff completely ? This would be minimalistic but sufficient.

Thanks
Dalibor


It is up to you. If you ignore the other stuff, you would need to check it in your business logic by going lock-read-check-update-unlock.


Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
mike acre
Ranch Hand

Joined: Sep 23, 2003
Posts: 197
I think you maybe talking cross-purposes.
I understood the question to mean

"Can I ignore implementing update on all fields except customer"

If this is the question I would say this is a mistake.

I would implement the database tier completely for all methods and make them totally agnostic of the business logic. Your update should be able to update all fields and only care that the max field lengths are adhered to.

I don't really see that your suggested approach is defendable at all. Unless I misunderstand you.


SCJP 1.4, SCJD
 
Consider Paul's rocket mass heater.
 
subject: Update method
 
Similar Threads
Can't declare a Sybase Cursor for StoredProcedures using Spring
Booking record via record number a bad idea?
Methods in RMI and Multithreading
Data class lock testing - is it necessary to test create and delete implementations?
B&S: update method responsibility