在本例中,我使用PHP代码创建了一系列标记—一个标记用于表格中的一个页面。
In this case, I use the PHP code to create a series of tags-one for each page in the table.
这里的区别是,在使用位置增加代码让我有了灵活性。
The difference here is that by adding the code at the point of use, I gain flexibility.
我在代码示例中使用EJB 3.0规范;同样的概念也适用于Spring Framework和JOTM。
I use the EJB 3.0 specification in my code examples; the concepts are the same for the Spring Framework and JOTM.
Because if I don't specify a name for this input, I have no way of actually referring to it in subsequent lines of code.
因为如果我不给这个输入定义一个名字,在随后的代码中,我就没有办法使用它。
I want to just use it, I shouldn't have to worry about what variables I use inside of it, I have shouldn't have to worry about where that is in the code, I should be able to just abstract it away. And that's what we want to add today, are those two things.
我只是想使用它,我不用考虑我在这段代码中,使用的是什么变量,我完全不用考虑代码的内容,只要抽象就好,我们今天想补充的内容就是这两点。
Now that I've written sqrt, I can just use it anywhere I want in the code. You've got to rely on the fact that I wrote it correctly, but you can basically suppress the details of how it's used.
就是忽略细节,既然我已经编写了sqrt函数,我可以在代码的任何地方使用它,你完全可以依靠,我已经编写的这个函数。
应用推荐