Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - History of objects?

 
Thread Tools Search this Thread
Old 01-07-2005, 10:10 AM   #1
Default History of objects?


Hi

a relatively complex project I am working on now has a need for
"versioning". I mean, we have a system for administration of data (creating
and updating) in a database, and this data needs to be saved as separate
versions each time it is updated - a lot like a CVS.

The data is in the main "bridges", which have lots of data (name, location,
height etc), and lots of related data: persons (controller, supervisor);
tasks to be performed...

It should for example be possible for a user to view a "bridge" as it looked
on a certain date in the past, with all its related data (as they also were
at that date).

Does anyone have some good ideas about how we can save a history of versions
of all our objects? Where can I start to look for good ideas? Could we use
CVS via some sort of java api?


Thanks,
Peter



Peter Kirk
  Reply With Quote
Old 01-07-2005, 04:42 PM   #2
Chris
 
Posts: n/a
Default Re: History of objects?
> a relatively complex project I am working on now has a need for
> "versioning". I mean, we have a system for administration of data

(creating
> and updating) in a database, and this data needs to be saved as separate
> versions each time it is updated - a lot like a CVS.
>

<snip>
> Does anyone have some good ideas about how we can save a history of

versions
> of all our objects? Where can I start to look for good ideas? Could we use
> CVS via some sort of java api?


I presume you're using a SQL database. I've handled this in the past by
having a set of history tables that parallel my app's tables. For example,

table bridge (id, name, location)
table bridge_history (id, version#, user_id, timestamp, name, location)

Make the primary key of the history table the id + the version #. The
user_id tells you who made the change, and the timestamp tells you when it
happened.

If your database is not large, it's easiest just to create a complete
snapshot of the record in the history table. If saving space is important,
then just save the *old* values of the fields that changed. That's a lot
more work, though, if you want to recreate a snapshot of the data at a given
point in time.






Chris
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
New releases: My Darling Clementine, Affair To Remember & Bratz: The Movie: Updated complete downloadable R1 DVD DB & info lists Doug MacLean DVD Video 0 10-09-2007 06:51 AM
DVD REVIEW -- "JFK: A Presidency Revealed" (2-Disc Set Produced By "The History Channel") David Von Pein DVD Video 0 11-10-2006 02:43 AM
DVD Verdict reviews: A HISTORY OF VIOLENCE, WALLACE AND GROMIT IN THE CURSE OF THE WERE-RABBIT, and more! DVD Verdict DVD Video 0 03-13-2006 09:32 AM
New Releases: SCTV, Huckabess & History: Updated complete downloadable R1 DVD DB & info lists Doug MacLean DVD Video 0 12-17-2004 05:00 AM
OT... Would you by this DVD if it came with Easter Eggs? Lookingglass DVD Video 0 09-10-2004 02:47 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46