Lecture 30: Chat Program Interfaces
Ambient Temperature 74.9oF
Concepts
- The lecture webpage lists several desirable features of a given piece of software:
- Minimal and Complete: “Strive for the minimum number of methods that for a complete set, enabling all required operations to be performed.”
- 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.
- Orthogonality: “All methods should be maximally independent of each other and not perform operations that are also partially performed by other methods.”
- In other words “no interface method should perform tasks that include all of the tasks of another interface method.”
- Implementation Independent: “The user of a method or object should not be concerned with how it is implemented.”
- If a method won’t work unless it is implemented in a specific matter, that method should not be part of the interface.
- In designing the interface, you cannot make assumptions about the state before, or computations after, a given method call.
- 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.”
- Builds on Flexibility: Flexible systems are more easily extended than inflexible systems.
- Robustness: “The system should be designed to gracefully handle user or other errors that may occur.”
- 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.
- Security: “The system should be gracefully disallow deliberate attempts to circumvent proper operation.”
- If you don’t want users to be able to mess with something, make that thing immutable or invariant.
- Do not use anonymous inner classes in any object that will get sent over the network. Java handles this poorly.
- The class went over the union of all lab groups’ ideas for ChatApp features.
Resources
- Lecture 30 webpage: http://www.clear.rice.edu/comp310/f12/lectures/lec30/
- Why not to serialize anonymous inner classes: http://www.clear.rice.edu/comp310/JavaResources/RMI/index.html#tiptraps
- Lab groups’ feature list: https://owlspace-ccm.rice.edu/portal/site/COMP-310-F12/page/57ffcbae-4fb2-4126-8976-734432cce374