• 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

Vector vs Hashtable

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, peopel keep saying they use Vectors for storing their locked / deleted /whatever records and its associated cookies. But I can seem to understand why cos no one actually detailing how they store their data. I think there is a need to store both record numbers and lock cookies. So I need to use the wrappers for both key and element.
How do people get away with Vectors?? I am very curious!
Thanks
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anna,
I think people have used Vector (or ArrayList with the synchronized wrapper) for the database record cache usually. I think most people have used a HashMap to hold the locked record details. I am currently doing this.
Jonathan
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anna,
Only some of the assignments have lock cookies - some people don't have them in their requirements. If you look at the question "How may assignments are there? (What is an NX assignment?)" in the JavaRanch Sun Certified Java Developer Faq, you will see some of the known signatures for the unlock method for the UrlyBird assignment.
If you didn't have a requirement for cookies, and if you were building thin clients (three tier) ( ) then you might feel that you only need a simple Vector.
But on that topic, those using Vector's may be interested in reading Peter den Haan's comments on why Vector and Hashtable should not be used.
Regards, Andrew
[ February 20, 2004: Message edited by: Andrew Monkhouse ]
 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh I just think no one talks about using Hashtable and the like but only Vector, so I think I missed something. Now I know I am not in the wrong direction. Thanks guys!
 
reply
    Bookmark Topic Watch Topic
  • New Topic