And our goal is then to basically see how we can build systems that take advantage of that modularity.
方法优点的系统,好,那么最基本的思想,就是,我想要把信息放在一起,我想要把应该。
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.
这样我们就丢掉了代码的模块化,我很希望代码有这样的模块化:,我访问变量的值,不是通过直接调用它们的名字,而是通过调用某个可以,访问这些变量名的方法来访问。
And what I want to be talking about is modules of one sort, and of course that's because what we're interested in is modularity.
我想要说的是一种类型的模块,当然这是因为我们关注的是程序的可组合性,我们如何处理复杂程序呢?
And that's a wonderful thing to have because it gives you that modularity, that encapsulation that basically says, when I create a point, the only way I can get at the values, is by using one of the defined methods, in this case it could be Cartesian, Cartesian and get all the pieces of that.
这是很棒的一件事情,因为它让你有了,模块性以及封装性,这基本上也就是说,当我创建了一个点,我能够得到它的值的唯一的方式,就是用一个定义好的方法,在这个例子中也就是。
First of all, I've used the notion of modularity.
首先,我用到了模块的概念。
And that's where the modularity comes in.
这些实际上都是点。
First of all, notice the modularity.
首先,注意模块化。
But here, if I decide I'm going to store things not in x and y, but with some other set of names, for example, I've gotta go back into these pieces of code that use the points, and change them. So I've lost modularity.
除了要改下借口,但是这里,如果我决定,我不把值放在x和y中,而是和其他一些变量名进行绑定,例如这样的话,我就得回到使用这个点的代码,那儿去做更改了。
应用推荐