This principle asserts that the designer of a class and the user of that class share assumptions about the class implementation.
这个原理声称一个类的设计者和这个类的使用者,共同分享关于类的实现的假设。
An easy way to follow the Single Responsibility Principle is to constantly ask yourself whether every method and operation of a class is directly related to the name of that class.
遵循单一责任原则的最简单办法就是不断地问自己是不是这个类的每一个方法和操作都与这个类的名称直接相关。
As I said earlier, the most common manifestation of the Open Closed Principle is using polymorphism to substitute an existing part of the application with a brand new class.
如果我前面所说的,使用开闭原则最通常的做法就是使用多态去用一个全新的类替换程序中现存的一部分。
In principle, we could play this with the whole class, but let's single out a particular row of the class so I'm going to come down here and I guess eventually, well I'll grab it in a minute.
理论上,我们可以全班一起做这个博弈,但我要选出特定的一行,我先走下来,我觉得,我很快就能挑到人
应用推荐