Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it ok to create large numbers of javabeans and objects?

 
Simon Harvey
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pavel Halas
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
     
    Simon Harvey
    Ranch Hand
    Posts: 79
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
     
    Stan James
    (instanceof Sidekick)
    Ranch Hand
    Posts: 8791
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic