The Package Organization Golden Rules
Golden Rule Number 1:Never mix generic code with application code directly
Below your com.company or org.yourorg package level, split your package hierarchy into two fundamentally incompatible branches:
- The reusable items branch
- The project-specific branch
Golden Rule Number 2:Keep it hierarchical
Always create a package hierarchy that has a balanced, fractal-like tree structure.
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.
Leave A Comment