aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Update method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply 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: 473
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<br /><i>anton.golovin@gmail.com</i><br />SCJP, SCJD, SCBCD, SCWCD
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Update method
 
Similar Threads
Booking record via record number a bad idea?
Can't declare a Sybase Cursor for StoredProcedures using Spring
Data class lock testing - is it necessary to test create and delete implementations?
B&S: update method responsibility
Methods in RMI and Multithreading