During this time, Arthur J. riel's "object-oriented design heuristics" was read, so the following object-oriented design principles were summarized as a reference:
- All data should be hidden inside the class where it is located.
- The class user must be dependent on the public interface of the class, but the class cannot depend on its user.
- Minimize messages in the class protocol.
- Implements the most basic public interfaces that all classes understand, such as copy operations, equal judgment, and correct content input.
- Do not put implementation details in the public interface of the class.
- Do not disturb the public interface of the class with something that the user cannot use or is not interested in.
- There should be zero coupling between classes, or only export Coupling Relationships. That is to say, a class must be unrelated to the other class, or only operations in the public interface of the other class should be used.
- Class should only represent a key abstraction.
- Place relevant data and behaviors in a centralized manner.
- Put irrelevant information in another class.
- Make sure that the abstract concept you modeled for is a class, not the role played by the object.