Hi everyone, I am just wondering about how javabeans (and objects I really) are typically used. Lets say, as a hypothetical scenario I have a computer program that deals with lots of logged in users. Would it be appropriate to hold loads of user javabean objects in some form of collection? Basically what I am wondering is whether you are supposed to use classes and javabeans to create large numbers of objects held in memory. How many simple objects can a modern computer handle easily. I'm just wondeirng if there is a different model. Maybe you're not really supposed to use a bugger load of objects or java beans. But then how else do you store representations in memory? A big ol fankoo to anyone who cares to share any advice. Kindest Regards Simon Harvey
At first. Everything is Object in Java. Collections are used to store data in memory. But if you have LOTS of users to be logged, there are two cases:
users aren't online at the same time So there's no need for storing all of them in memory (in the collection). Use disk space.
lots of users are online at the same time They want to work. If they could not work, they would not be there. So if the system is ready for serving so many users, it will be ready for logging them. Use super hardware, eventualy (surely) some kind of extra optimalization.
[ July 13, 2003: Message edited by: Marilyn de Queiroz ]
Joined: Jan 26, 2003
Thank you Pavel. I'm going to take it from your answer that I shouldnt worry to much about making javabeans and storing them (although of course I wouldnt store something in RAM unless I needed to) If thats ok then thanks for your answer, if not then perhaps someone could post back quickly. Many thanks pavel Simon
I work with a Java client application that caches gobs of data to avoid time-consuming trips to the server. I'm sure we cache thousands of objects. You just have to keep an eye on your memory usage and make sure you can share the computer with whatever else is going on at the same time.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi