Share data between multiple online users

  • Thread starter Thread starter John Devlon
  • Start date Start date
J

John Devlon

Hi,

I would like to share a collection of objects between all online users of my
webapp. Each user must be able to read and write to that same collection.
The data is not importanted enough to store it in a database and doesn't.
What is the best approche? Creating a singleton class and storing all the
information in that class?

For example: I would like to know all other people currently online on my
website.

Does anyone recommand an approach ?

Kind regards

John
 
Hi John,

If the data is not important for you to be lost, if you want to avoid using
database or flat data files or serialized binary data, etc, the best
approach on my idea is the Singleton pattern.
 
John said:
Hi,

I would like to share a collection of objects between all online users of my
webapp. Each user must be able to read and write to that same collection.
The data is not importanted enough to store it in a database and doesn't.
What is the best approche? Creating a singleton class and storing all the
information in that class?

For example: I would like to know all other people currently online on my
website.

Does anyone recommand an approach ?

Kind regards

John

Sounds like you could store the collection in the Application object as
opposed to the Session object where these might normally be stored.
 
Back
Top