Interface Design by Bill Venners
Chapter 8
Object Initialization and Cleanup
Advertisement
|
Interface Design |
Contents |
Previous |
Next
The Guidelines:
- Guideline: Force a proper initial state.
- Guideline: Keep constructors and initializers focused on
initialization.
- Guideline: Invoke the
this()
constructor with the most
parameters.
- Guideline: Make clones of mutable referenced objects
in
clone()
.
- Guideline: Watch out for transient variables when
deserializing.
- Guideline: Don't depend upon "timely" finalization
for program correctness.
- Guideline: Use finalizers knowledgeably.