9, the definition of classes and methods

1, OOP motto: when things get complicated when you come up with more types. When the algorithm becomes complex, to come up with more secondary type, package independent functions. 2, do not define nested public types. Try to define sealed class, inner classes. Late sealed class can be changed to a non-sealing. Unsealed late inconvenient to change the seal. 3 for IL calling method: call calling virtual method invocation ToString callvitrl sealed class non-virtual base class calls the detected null reference exception (if the call does not call this method without exception)

Guess you like

Origin www.cnblogs.com/zhuwansu/p/11974402.html