非公共类中的一些方法,它们永远也不会被实际调用,只是为了满足某个接口契约而必须实现。
Methods inside nonpublic classes that are never actually invoked but must be implemented in order to satisfy the contract of an interface.
任何编程语言符合CLI标准可以访问公共类库,可以编译成一个共同的中间语言(字节码)。
Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode).
我这里有一个推荐:通过观察所有的公共类开始,用一个公共基类合并这些类到一个程序集中。
Here's my recommendation: Start by looking at all your public classes. Combine public classes with common base classes into assemblies.
为了提供一致的开发人员体验,公共公开的元素(如公共类和受保护的方法)必须遵守这些准则。
To provide a consistent developer experience, these guidelines are required for publicly exposed elements such as public classes and protected methods.
我喜欢编写新的代码,但也喜欢采用一些现有的代码,以某种方法将其简化或将重复的代码提取到一个公共类中。
I'd rather write new code, but I enjoy taking some existing code and reducing complexity in a method or extracting duplicate code into a common class.
如果想要让某个公共类的方法仅限于由同一个类的成员访问,该采用哪一个访问修饰字实现这一目的呢?
You want to limit access to a method of a public class to member of the same class. Which access modifier accomlishes this objective?
addOrderFrom()方法成为公共类的匿名内部类创建的定义,将这两个工作项目包装起来。
The addOrderFrom() method collapses to the definition of an anonymous inner class creation of the command class, wrapping the two work items.
然而,这个命名糟糕的公共类在代码中保留的时间越久,则相关的使用也会越来越多,改变起来就越来越困难。
However, the longer the badly named class remains in the code base the more prevalent its usage becomes, and the bigger the task of changing it.
修改catalina .properties文件,以使整个cloudscape库都包含在公共类路径中。
The catalina.properties file is modified so that the entire Cloudscape library is included in common classpath.
更好的解决方案是将包结构分解成两个源目录,一个负责客户端代码,一个负责服务器端代码,然后将公共类复制到两个目录中。
A more elegant solution might be to split package structure across two source directories for client-side and server-side code and to duplicate common classes into both directories.
修改 catalina.properties文件,以使整个Cloudscape库都包含在公共类路径中。
The catalina.properties files is modified so that the entire Cloudscape library is included in common classpath.
你已经学习服务定位器模式如何可以用于封装,你的富互联网应用程序可以作出的,在一个可预计位置的一个公共类下的,所有不同的服务调用。
You've learned how the service Locator pattern can be used to encapsulate all the different service calls that your rich Internet application might make under a common class in a predictable location.
我承认我没有系统地使用自动化测试,这是因为我的经验表明,对于那些其公共接口不经常更改的类,自动化测试是最有效的。
I confess that I do not use automated tests systematically because my experience has been that they are most effective with classes whose public interface does not change often.
在控制器类中实现作为公共实例方法的API方法。
Implement the API methods in the controller class as public instance methods.
在服务类中实现作为公共实例方法的API方法。
Implement the API methods in the service class as public instance methods.
API方法实现是作为公共实例方法定义在控制器类中的。
The API method implementations are defined in the controller class as public instance methods.
整个应用程序架构中用于启动、提交和回滚事务的惟一方法就是api层的域类中包含的公共方法。
The only methods in the entire application architecture that start, commit, and roll back a transaction are public methods contained in API layer's domain classes.
这些类执行一个公共接口,如图1所示。
These classes implement a common interface, as shown in Figure 1.
如果包访问不利于对象间的通信,就需要向类中添加更多的公共方法。
If package access prevents objects from communicating, add more public methods to the classes.
我们实现这个类来提供一些公共方法并隐藏SNMP接口的细节。
We implemented this class to provide some common methods and to hide the details of the SNMP interface.
图22:分析用例之中具体的和公共的实现类。
Figure 22: Analyzing specific and common implementation classes among use cases.
做到这一点的最佳方法是在一个小的公共基类的集合中封装特定于Domino的实现细节。
The best way to do this is to encapsulate the Domino specific implementation details in a small set of common base classes.
这些结构支持面向对象式的封装,即本质上只有类或者Trait的公共抽象会被暴露出来,内部实现则被隐藏于视界之下。
These constructs support the object-oriented form of encapsulation, where only the essential public abstraction of a class or trait is exposed and implementation information is hidden from view.
main函数,它调用space类中使用int参数的公共函数func。
A main function calls the public function func with int arguments of class space.
例如,假设您希望利用反射显示给定类的所有公共方法。
For example, say that you want to display all of the public methods of a given class using reflection. Listing 7 shows an example.
因为clone在Object中是保护访问的,调用clone必须通过将clone改写公共访问的类引用来完成。
Because clone has protected access in Object and, to call clone , you have to call it through a reference to a class that has overridden clone to be public.
与booksearch类中的公共方法类似,这些方法的代码如下。
As for the public methods in our BookSearch class, the code for these methods is as follows.
通过直接调度方法,可以把API定义类与控制器类绑定在一起,并且在控制器类中实现作为公共实例方法的API方法。
With the direct dispatching approach, the API definition class is attached to the controller class, and the API methods are implemented in the controller class as public instance methods.
注意,不必要注册类的全部公共属性和方法——可以从中选择想向容器公开的那些公共属性和方法。
Notice that you're never required to register all the public properties or methods of the class — you can choose which ones you want to expose to the container.
最后,该惯例要求方法为公共,因此我使用查找格式,查找类上可调用的公共方法。
Finally, the convention requires the methods to be public, so I use the form of lookup that finds public methods callable on the class.
应用推荐