QtChat 2.0 - Development
Design Methodology

Home
News
FAQ
Download
Development

Contact
Here I will attempt to describe my vision for QtChat2.  I will outline the basic design methodology, interaction between components, and guidelines for developers wishing to contribute to this vision.  This page comes at the request of altf2o, who asked me to provide a more concrete idea of the overall flow of QtChat2.

Beginning a session
A typical chat session will begin with the AccountManager class.  This class manages Account objects which represent individual settings for beginning a user session.  An Accountincludes a user's username, authentication details, and a reference to a Protocol object which knows how to connect to a chat server.  The Protocol object is allowed to store information in the Account object which it will need to log in the  next time, such as chat server address lists, the preferred chat server address, etc.; this is made possible because the Account class is derived from ConfigSet, which is the persistent configuration data class.  There will be some standard settings stored in the Accountsuch as "ServerAddressList" which all protocols will likely require.  So each Account includes exactly one Protocol; to create a new account with e.g. MSN, one would specify an MSN-compatible Protocolfor the account.

Logging in
Once an Account is selected, the account username and secret are passed to the Protocol to obtain an AuthToken object using the Protocol::getAuthToken() method.  This AuthToken is then passed back to the Protocol to actually log into a chat server using the Protocol::login() method.  I used this double-passing method to account for protocols which use a challenge-response authentication method such as Yahoo's YMSG protocol.  Many protocols will simply return the username:secret pair unaltered in the Protocol::getAuthToken() method.  The Protocol::login() method returns a pointer to a Session object; this object is the main interface to all chat functionality.  Of course it would help if I were to actually define the Session class already :-).

The ChatRoom
The ChatRoom class represents the user's main interface to the chat session.  This base class contains a virtual method update() which is called by the system when the chat room contents change...at least that was my original idea.  


QtChat2 Design Flowchart
QtChat2 Flow Diagram.


Last updated: 2003-Oct-23