John Hofman's Design Study

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
=My Project=
 
=My Project=
This design study was introduced by my ENEL428 software assignment. The purpose of the assignment is to design a prototype of an Instant Messenger System using concurrent programming. The system is broken into two separate parts a client and a server. This design study is for the client program.
+
This design study was introduced by my ENEL428 software assignment. The purpose of the assignment was to design a prototype of an Instant Messenger System using concurrent programming. The system was broken into two separate parts a client and a server. This design study is regarding the client program.  
 
+
The communication protocol was not specified so I am using a system similar to IRC where logging on only requires a unique username, not a user account. This means that the server only needs to maintain a list of currently online users.
+
  
 
=Design Study=
 
=Design Study=
 +
The initial system uses a simple login model, a user attempts to log in with just a username which the server accepts or rejects.
  
==Initial Design==
+
Functional requirements of the client:
When I first sat down and started to think about how to divide up an instant messenger client into separate parts, I came up with two different abstractions of the client environment.  
+
* Connect to a server.
 +
* Login.
 +
* Logout.
 +
* Display the other users online.
 +
* Start a conversation with another online user.
 +
* Post Messages in a conversation.
 +
* Invite other online users to a conversation.
 +
* Leave a conversation.
  
===Chats===
+
Constraints:
This design follows how existing instant messengers appear to present the clients structure. The user interface is used to manipulate chats. Chats communicate with the server to update chats in other clients.  
+
* C++
 +
* Uses POSIX threads for concurrency.
  
UML
+
Room for Expansion:
 +
* Other protocols, XMPP etc.
 +
* Other GUI implementations, currently uses fltk-1.1.9
  
===Room for Conversation===
+
==Initial Design==
This design of the instant messenger client models a group of people conversing in a room. The model contains users objects, one for each person who is online. The users can interact through chats.  
+
This is the design which is fully functional.
  
Users can create, join, leave and post messages to a chat. There is one user, the 'Home' user, that represents the person who is using the client program, the HomeUser is controlled by the
 
user interface. The other users, OnlineUsers, are controlled by the network. However, the behavior of these 'online users' originated from the user input on their own client program somewhere else on the network. Therefore, whenever the HomeUser interacts with the chats, any actions it makes are also sent to the network connection to update the OnlineUser (kind of puppet) that represents it, in the other peoples client environment.
 
  
UML
 
 
===Discussion of Initial Design===
 
Following the [[Do the simplest thing that could possibly work]] heuristic, the first design is better. The "Room for Conversation" design [[Model the real world|models the real world]] but a room with people is not necessarily what needs to be modelled. Therefore the second design is going to be discarded.
 
 
Improvements and Considerations
 
* The design is dependent on the GUI library. Both Chat and UserManager dependant on the fltk library. Its not extensible.
 
** The [[Bridge]] design pattern could be used to separate the interface and implementation of the UI.
 
** The [[Abstract Factory]] could be used to increase exstensibility.
 
* The Gateway is tightly coupled with the UserManager and the Chat classes. The interaction between them is bi-directional.
 
**This coupling could be reduced by using [[Double dispatch]], but, this is a code smell that implies that [[Open closed principle]] or [[Single responsibility principle]]s are not being followed.
 
* The Gateway is currently responsible for connecting, sending and receiving information. Se
 
 
 
 
==User Stories==
 
*[[John Hofman US001| Simple chat]]
 
  
 
==Other Stuff==
 
==Other Stuff==
 
+
[[John Hofman US001| Simple chat]]
 
[[John Hofman's Log|Log]]
 
[[John Hofman's Log|Log]]

Revision as of 11:46, 25 August 2010

Contents

My Project

This design study was introduced by my ENEL428 software assignment. The purpose of the assignment was to design a prototype of an Instant Messenger System using concurrent programming. The system was broken into two separate parts a client and a server. This design study is regarding the client program.

Design Study

The initial system uses a simple login model, a user attempts to log in with just a username which the server accepts or rejects.

Functional requirements of the client:

  • Connect to a server.
  • Login.
  • Logout.
  • Display the other users online.
  • Start a conversation with another online user.
  • Post Messages in a conversation.
  • Invite other online users to a conversation.
  • Leave a conversation.

Constraints:

  • C++
  • Uses POSIX threads for concurrency.

Room for Expansion:

  • Other protocols, XMPP etc.
  • Other GUI implementations, currently uses fltk-1.1.9

Initial Design

This is the design which is fully functional.


Other Stuff

Simple chat Log

Personal tools