Other common principles are as follows; however, detailing of each principle is not in the scope of this chapter, and we request you to refer to other materials if you need to read more information about those principles:
- Encapsulate
- Always encapsulate the code that you think may change sooner or later
- Composition over inheritance
- In some cases, you may need the class behavior to change during runtime, and those cases favor composition over inheritance
- Program for interface (not for the implementation)
- Bring flexibility to the code and can work with any new implementation
- General responsibility assignment software patterns (GRASP)
- Guides in assigning responsibilities to collaborate objects
- Don't repeat yourself ...