xi ;;Quote: to master a language you must master its grammar, vocabulary, and usage
|
xi+;;Quote: a book on the customary and effective usage of Java
|
78 ;;Quote: design for inheritance or prohibit it; inheritance commits forever design decisions about usage, protected methods, and other aspects of a class' inner workings
|
82 ;;Quote: prefer interfaces over inheritance; unless designed for inheritance, avoid using methods that may be overridden
|
84 ;;Quote: prefer interfaces over abstract classes; easy migration, easy mixins, easily wrapped for enhancements, nonhierarchical
|
85 ;;Quote: provide an abstract skeletal implementation for each nontrivial interface; e.g., AbstractList; simplifies implementation
|
88 ;;Quote: an abstract class is easier to evolve than an interface; can not add methods to a public interface
|
88 ;;Quote: can not change a widely implemented interface; for a new interface, create many test implementations
|
91 ;;Quote: a nested, member class should be static; it has access to all of the enclosing class's members
|
115 ;;Quote: replace function pointers with function objects and interfaces; a function object exports exactly one method
|
126 ;;Quote: use at most three parameters; do not use many parameters with the same type
|
127 ;;Quote: define parameters as interfaces instead of classes; greater flexibility without copy operations
|
134 ;;Quote: return a zero-length array instead of a null; nulls require special code
|
136 ;;Quote: document the API; write doc comments for exported classes, interfaces, constructors, methods, and fields
|
141 ;;Quote: declare and initialize local variables at first use; minimizes their scope
|
152 ;;Quote: strings are poor substitutes for value types, enumerated types, and aggregate types
|
156 ;;Quote: only refer to an object's class when creating it; use interfaces elsewhere
|
156+;;Quote: use interface types for parameters, return values, variables, and fields
|
158 ;;Quote: avoid reflection; no compile-time type checking, syntax is clumsy and verbose, performance is slow
|
158 ;;Quote: reflection is best for design time use by component-based application builder tools
|
159 ;;Quote: use reflection to create objects and use their interface or superclass for access
|
162 ;;Quote: think about performance during design; pervasive architectural flaws can limit performance forever; changing a design later can produce an ill-structured sytsem
|
163 ;;Quote: when optimizing a program, measure performance before and after each change
|
172 ;;Quote: use checked exceptions when recovery is possible; use run-time exceptions for programming errors
|
173 ;;Quote: checked exceptions should include methods that describe the context and cause of the error; assist with recovery
|
174 ;;Quote: use checked exceptions for multiple, necessary exceptions that allow recovery
|
178 ;;Quote: exception translation -- catch low-level exceptions and throw new exceptions in terms of the high-level abstraction
|
185 ;;Quote: failure atomic -- a failed method does not change the state; leave the object in a well-defined, usable state
|
191 ;;Quote: stop a thread by polling for a stop condition; killing a thread is inherently unsafe
|
204 ;;Quote: limit the number of currently runnable threads in an application; helps make it robust, responsive, and portable
|
208 ;;Quote: distinguish immutable classes, thread-safe classes, conditionally thread-safe, thread-compatible, and thread-hostile classes
|
213 ;;Quote: the serialized form is part of the API; it limits a class's implementation; serialization is less reliable and less secure, requiring more testing
|
213+;;Quote: implement Serializable only for value classes and collection classes
|
218 ;;Quote: a custom serialized form contains only the object's logical data; better than the default, physical representation
|