Have the computational hygiene, if you like, to only go through accessors, only go through methods that are actually provided to you as you do this.
请大家注意计算卫生,如果你喜欢这么说的话,只通过访问器访问数据,当你访问数据的时候,通过提供给你的方法来访问。
I'd really like to have that modularity that says, I'm only going to get access to the values, not by calling their names, but by calling some specific method to get access to their names.
这样我们就丢掉了代码的模块化,我很希望代码有这样的模块化:,我访问变量的值,不是通过直接调用它们的名字,而是通过调用某个可以,访问这些变量名的方法来访问。
I think of data hiding as basically saying, one can only access instance values, or, we'll call them that, instance values through defined methods.
一个人仅仅可以访问实例变量,或者,我们可以这么来说,通过定义好的方法,来访问实例的变量。
I would only ever access the values through a method.
如果我真的很讲卫生,我只会通过一个方法来访问变量值。
应用推荐