在这里我们需要考虑的一个更大的问题是:我们到底从哪里封装代码?
The larger question here to consider is, precisely what are we trying to encapsulate the code from?
这就会有更好的性能,并且可以避免围绕现有功能编写SOAP封装代码。
This can lead to better performance, and you avoid writing SOAP wrapper code around existing functions.
正如您所看到的那样,封装代码看上去复杂,所以我们感谢代码生成器为我们编写的每一行。
As you can see, the wrapping code can look complicated, so we thank the code generator for every line it writes for us.
您可以通过将实际的模型知识封装到模型中来保证代码是面向对象的。
You can keep the code object oriented by encapsulating the actual model knowledge within the model itself.
幸运的是,这种特殊代码可以封装并重用。
Luckily, this special case code can be encapsulated and reused.
可以通过胖客户端或瘦客户端访问PHP代码中封装的核心银行逻辑。
The core bank logic encapsulated in the PHP code can be accessed through a thick or thin client.
一开始的代价要高一些,不过您很快就会发现,封装XML代码的时候节省了时间。
The startup costs are higher, but you will quickly find that you save time when you encapsulate the XML code.
记住采用OO习惯的原因是要谨慎封装更改,这样代码将更具有可扩展性并且更容易维护。
Remember that the reason for adopting OO habits is to carefully encapsulate change so your code is more extensible and maintainable.
在图3中,齿轮箱代表处理一些基础数据结构的抽象,而黄色箱代表可移植代码,将数据封装在里面。
In Figure 3, the gear box represents abstractions that deal generically with some fundamental data structure, and the yellow box represents portable code, encapsulating data inside it.
将几行代码封装成一条语句。
这在组件测试中非常有用,如你可以在封装之前确认未测试代码并检查它。
This is immensely useful during component testing, as you can identify untested code and check it before it is shipped.
这个模式通过目录服务封装访问组件的代码,如JNDI客户端代码之类,因此客户端可以简单的以资源名通过验证并返回这个资源。
This pattern encapsulates code for accessing components through directory services, such as JNDI client code, so that a client can simply pass in the name of a resource and get back that resource.
清单2显示了这个数据库封装类的代码。
根据的类型不同,封装内容适配器代码和运行内容适配器的步骤也是变化的。
The steps for packaging and running a content adapter vary according to the type of content adapter.
将这些代码封装到一个函数中,便于理解和重用,并且使脚本更加易于阅读。
Encapsulating this code into a function makes it easier to understand and reuse, and also makes the script easier to read.
注意像普通的代码块那样封装在大括号 { }内的动作。
Note the actions enclosed in { } braces, like a normal code block.
要完成这项操作,可以将记录器生成的三行代码封装到测试脚本的某个单独方法中。
To accomplish this, you can wrap the three lines of code produced by the recorder into a separate method in your test script.
这是一项通用的良好实践,可以以这种方式将常见的复杂代码封装起来,从而供实现者更容易地遵循您的开发标准。
It is a general good practice to wrap common complex code in this way to make it easier for implementers to follow your development standards.
不过,虽然Web服务基础结构可以封装调用的细节,从而简化代码,但服务设计也应对调用方式加以考虑。
However, although the Web service infrastructure may encapsulate details of invocation and hence simplify code, the service design should be influenced by the style of invocation.
而Unicode提供了足够多的信息来避免呈现错误,如果将这些信息封装在程序代码中,它们仍不足以创建一种字体。
Unicode provides enough information to avoid rendering errors, although the information, if encapsulated in programming code, is not sufficient to create a font.
代码类型——封装python程序的元素。
Code types — Encapsulate the elements of your Python program.
这里没有支持Back按钮或者将用户数据保存到会话中所需的冗长代码——这些都封装在Cocoon的框架中了。
You don't see any of the normal tedious code to support the Back button, or to save user data to the session — that's all encapsulated into Cocoon's framework.
生成图表的代码被很好地封装在net . sf . statcvs. renderer包中。
The code for generating the charts is nicely encapsulated in the net.sf.statcvs.renderer package.
通过将DAO代码封装到trait中,该DAO trait所提供的所有持久化方法可自动为所有实现类所用。
By encapsulating DAO code in a trait all persistence methods provided by this DAO trait are automatically available to all implementing classes.
其中一个例子是将主要的代码块封装到一个evalf(. .)函数中,使它只在运行时有效。
One example of this is wrapping major chunks of code in an evalf (..) function, making it only valid at runtime.
它的代码被封装为wsdl. jar,它使用WSTK的bsf . jar (bean脚本框架)和xalan . jar (xml样式表单处理器)文件。
Its code is packaged as wsdl.jar, which utilizes the bsf.jar (Bean Scripting Framework) and xalan.jar (XML stylesheet processor) files from WSTK.
ServiceLocator模式对封装使用JNDI的代码仍然有用,即使定位器不使用缓存。
The Service Locator pattern is still useful for encapsulating the code that uses JNDI, even if the locator does not use caching.
将本机代码封装成Web服务是一个优秀的解决方案,这样可以提供许多的好处。
Wrapping the native code as a web service is an excellent solution that offers many benefits. For example.
它还可以采取动作;当解析器达到表达式中的那个条件点时,封装在中的代码块将会被执行。
It can also take actions; blocks of code enclosed in pairs will be executed when the parser reaches that point in an expression. For instance, one might write.
通过将复杂的RationalFunctionalTesterAPI代码封装到窗口小部件类的方法中,我们使脚本的手工编码更加容易。
By wrapping complex Rational Functional Tester API code into methods in widget classes, we have made manual coding of scripts much easier.
应用推荐