by
dr >> Sun, 18 Jan 2004 21:04:55 GMT
I'd like to implement program like MSN chat with JADE. Any idea how to start?
Okay, let's leave business models aside and concentrate on the most straightforward way to acheive this technically ... in which case we need to make some design decisions - will these do the job for you?
Let's assume we are building CHAT functionality for a few dozen users, but not necessarily a system that will provide the scaleability of MSN Messenger (that can potentially service millions of concurrent users). Let's start with something as simple as possible - each client application supports one chat - run multiple thin clients to have concurrent chats.
- One application server opens the database in single user mode - all users and messages are stored as sharedTransients, so data is accessed via a singleton sharedTransient object called TRoot.
- when a CHAT application starts, the user enters some details, e.g. their name. A User object is created and added to a collection TRoot.allUsers, also set app.myUser.
- the user can view a list of current users, and select a user with whom they would like to chat. This creates a sharedTransient object of type Chat, and the reference User.myChat is set. Chat has a text attribute, which is updated each time a user adds some text.
- When the user indicates they have finished their Chat, or want to start a new one, then the Chat object is deleted.When the user signs off, their user object is deleted.
Cheers,
Rob