Share data between multiple online users

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
 
C

Coskun Sunali [MVP]

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.
 
F

Family Tree Mike

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top