1. Not everyone needs to see everything, and neither of your types need to be public. To ensure that a type can complete its work, you should assign the minimum visibility to the type as much as possible. The visibility of types is generally not as high as you expected. Internal or similar classes can also implement public interfaces. All users can access the functions defined by the public interface in the private type.
2. Many independent classes should be internal (internal). You can further restrict visibility and embed protected or private classes into the original class. The lower the visibility, the less changes you need to upgrade later. The reason is simple.CodeThe smaller the number, the less modifications may occur in the future.
3. Creating an internal class is a method that is often ignored to limit the type scope.
4. Classes and interfaces exposed to the outside world in public form will be the contract of your components and must be taken seriously. The more complex the interface is, the more limited future modifications will be. The fewer public types are exposed, and the greater the scope for scaling later.