• 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

Please Suggest a design approach for update operations

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic