Lecture 30: Chat Program Interfaces

Ambient Temperature 74.9oF

Concepts

  1. The lecture webpage lists several desirable features of a given piece of software:
    1. Minimal and Complete: “Strive for the minimum number of methods that for a complete set, enabling all required operations to be performed.”
      1. Convenience methods that are composed of other functions in the interface do not belong in the interface. Convenience methods add no new capabilities to the interface, and are therefore entirely in the domain of the implementation, not the interface.
    2. Orthogonality: “All methods should be maximally independent of each other and not perform operations that are also partially performed by other methods.”
      1. In other words “no interface method should perform tasks that include all of the tasks of another interface method.”
    3. Implementation Independent: “The user of a method or object should not be concerned with how it is implemented.”
      1. If a method won’t work unless it is implemented in a specific matter, that method should not be part of the interface.
      2. In designing the interface, you cannot make assumptions about the state before, or computations after, a given method call.
    4. Flexibility: “All possible operations must be able to be accomplished with the defined set of operations and objects without the need for special cases.”
    5. Extensibility: “The addition of new operations and/or capabilities should not require major reconfiguration of the system, preferably no changes at all.”
      1. Builds on Flexibility: Flexible systems are more easily extended than inflexible systems.
    6. Robustness: “The system should be designed to gracefully handle user or other errors that may occur.”
      1. Rather than checking to see if input or actions are valid, instead avoid providing any interface methods that allow invalid input or actions. Also applies to Security, below.
    7. Security“The system should be gracefully disallow deliberate attempts to circumvent proper operation.”
      1. If you don’t want users to be able to mess with something, make that thing immutable or invariant.
  2. Do not use anonymous inner classes in any object that will get sent over the network. Java handles this poorly.
  3. The class went over the union of all lab groups’ ideas for ChatApp features.

Resources

  1. Lecture 30 webpage: http://www.clear.rice.edu/comp310/f12/lectures/lec30/
  2. Why not to serialize anonymous inner classes: http://www.clear.rice.edu/comp310/JavaResources/RMI/index.html#tiptraps
  3. Lab groups’ feature list: https://owlspace-ccm.rice.edu/portal/site/COMP-310-F12/page/57ffcbae-4fb2-4126-8976-734432cce374