aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Please Suggest a design approach for update operations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Please Suggest a design approach for update operations" Watch "Please Suggest a design approach for update operations" New topic
Author

Please Suggest a design approach for update operations

shukla raghav
Ranch Hand

Joined: Aug 03, 2008
Posts: 200

Consider there is a library application. The user may select and edit the book details. There are 25 fields defined for each book. A user modifies one or two fields (say Book Edition and Publishing date) and saves the edited book details. Now in my Data Access Layer should i try to identify the changed data and just update the fields that have been changed

Update BookDetails
Set edition = '2010',
publisher = 'Prentice Hall'
where isbn = '96X31511134C'

or

simply try and update all fields in the database

Update BookDetails
Set
title = "Some Title"
author = "Some Author"
edition = '2010',
publisher = 'Prentice Hall'
language = 'Eng(US)'
.
.
.
. set all 24 fields
where isbn = '96X31511134C'


For the first i need to do some more work at all layers and UI also to identify the list of field that have changed. Which is usually a more sensible approach.

 
 
subject: Please Suggest a design approach for update operations
 
Similar Threads
Test 486
Subversion Version Control by William Nagel
Recommended books/readings for OOP
Java Testing and Design by Frank Cohen
Official Ubuntu Book, The (4th Edition)