COMP 310 
		  
		Spring 2018
		 | 
		
		Lec30: Chat Program 
		Interfaces
		 | 
	
	
		
		
		  
		
		  
		
		   
		
		  
		
		  
		
		  | 
	
Today we will continue developing the common Java interfaces and protocols that we will need to enable 
everyone's chat program to interact.  Please refer to the
previous lecture materials...
Some basic notions to consider:
	- Minimal and Complete -- Strive for the minimum number 
	of methods that for a complete set, enabling all required operations to be 
	performed.
 
	- Orthogonality --  All methods should be maximally 
	independent of each other and not perform operations that are also partially 
	performed by other methods. 
 
	- Implementation Independent --  The user of a 
	method or object should not be concerned with how it is implemented.    
	
 
	- Flexibility -- All possible operations must be able to 
	be accomplished with the defined set of operations and objects without the 
	need for special cases.
 
	- Extensibility -- The addition of new operations and/or 
	capabilities should not require major reconfiguration of the system, 
	preferably no changes at all.  
 
	- Robustness --  The system should be designed to 
	gracefully handle user or other errors that may occur. 
 
	- Security --  The system should be gracefully 
	disallow deliberate attempts to circumvent proper operation.
 
In order to more accurately represent "real world" 
API's, the ChatApp networking API should minimize the number of method calls on 
remote objects.
Note that shared network API may encompass more than one 
set of use cases for distinct sets of processes.   This may mean that 
the API may naturally separate into multiple decoupled parts!
Technical Details
Some details that need to be standardized:
	- RMI bound name for initial connection entity in the Registry
 
	- "Well-known" data types
		- What well-known data types are required?
 
		- What are the host ID's of the well-known data types?
 
	
	 
 
Pitfalls:
	- 
	Infinite loops or other problems when notifying existing chat room users 
	that one has joined the chat room:  This can be caused by adding one's 
	self to the room before notifying the existing room occupants, causing one 
	to receive one's own join notification. 
 
	- 
	Attempting to serialize an anonymous inner class.
 
	- Locking up and/or "cross-thread invocation" errors:  This could be 
	caused by threading issues 
	due to the fact that RMI method calls run on a diffferent thread than the 
	GUI.  We will be treating these issues on an "as needed" basis, so if 
	you experience the problems, please let the staff know right away. 
	
 
	- Threading 
	Issues
	
 
 
 
© 2018 by Stephen Wong