Forums Register Login

Vector vs Hashtable

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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!
I was born with webbed fish toes. This tiny ad is my only friend:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1050 times.
Similar Threads
Implementing MultiDimensional Vectors
Cookies using Jsp
Vector and StringBuffer
store applet session using servlet
Storing pairs of objects
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:49:03.