Core Java -- Class Design Hints

Core Java -- Class Design Hints

1. Always keep data private.


2. Always initialize data.

3.
Don't use too many basic types in a class.

4.
Not all fields need individual field accessors and mutators.

5.
Use a standard form for class definitions.

6. Break up classes with too many responsibilities.


7. Make the names of your classes and methods reflect their responsibilities.

你可能感兴趣的:(Core Java -- Class Design Hints)