Ability to mock concrete classes and interfaces.
模拟具体类和接口的能力。
Depend on abstractions. Do not depend on concrete classes.
依赖于抽象,而不是具体的实现类。
Recall the earlier discussion on using interfaces versus concrete classes.
回想一下之前关于使用接口还是具体类的讨论。
To map our two concrete classes (Lease and Property), we will use the XML tag.
要映射两个具体类(Lease和Property),就要使用XML标签。
One major disadvantage of the EasyMock framework is that you can't mock concrete classes - only interfaces.
EasyMock框架的一个主要缺点是不能模拟具体类——而只能模拟接口。
Instead of using interfaces directly, we create concrete classes first and then use them as per our need.
我们首先创建具体的类,然后根据我们的需要来使用它们,而不是直接使用接口。
For example, when building library code, it's better to define types as interfaces rather than as concrete classes.
例如,在构建库代码时,最好把类型定义成接口,而不要定义成具体的类。
As shown above, queries on concrete classes only select the required data without unnecessary table joins or unions.
正如上文所示,对具体类的查询只选择需要的数据,没有不必要的表连接和联合。
JDBC concrete implementations are loaded implicitly, and source code rarely references these concrete classes directly.
JDBC的具体实现是被隐式加载的,而且源代码很少直接引用这些具体类。
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
为创建一组相关或相互依赖的对象提供一个接口,而且无须指定它们的具体类。
Provide an interface for creating families of related or dependent objects without specifying their concrete classes .
提供一个接口可以创建一系列没有实现类的,相关联的对象。
Capture highlevel, stable concepts in abstract classes and interfaces and provide implementations using concrete classes.
在抽象的类和接口中捕捉高级、稳定的概念,并用具象类实现。
In the worst case, if the imports are concrete classes and their behavior changes, then the class doing the importing could break!
在最糟糕的情况下,如果导入的是具体的类,并且它们的行为发生更改,那么执行导入的类可能会中断!
This technique helps in agile development, without the need to create many concrete classes that will be used only in one component.
这种技术有助于敏捷开发——不需要创建许多只在一个组件中使用的具体类。
In this case it is better to implement the method in abstract class rather than defining it separately in all your concrete classes.
在这种情况下最好是实施方法的抽象类而不是定义分别在你所有的具体类。
By further examining the exception package and noting the ratio of abstract to concrete classes, you can derive another metric: abstractness.
通过进一步检查exception包并注意抽象到具体类的比率,可以派生出另一个度量:抽象性。
When referring to the classes Open Close Principle can be ensured by use of Abstract classes and concrete classes for implementing their behavior.
当提及类的打开关闭原则,它可以通过抽象类和实体类实现行为的方式来确保。
Since Castor USES concrete classes rather than interfaces, it's a little simpler than JAXB for constructing or modifying document data structures.
由于Castor使用具体的类,而不是接口,因此对于构造或修改文档数据结构,它要比jaxb略微简单。
Concrete classes provide the appropriate implementation for their respective base class. The Factory Method Pattern consists of the following classes.
concrete类为它们各自的基类提供恰当的实现。
So, if you inherit the abstract class in multiple concrete classes, then the properties of the abstract class will be part of each table of the concrete class.
因此如果你在多个具体的类中,继承了抽象类的话,那么这个抽象类的属性将会是每一个具体的类(表)的属性的一部分。
These are the concrete classes with work with the WebSphere Application Server EJB container to make the example EJBs fulfill all of the qualities defined by the EJB specification.
这是一个具体类,它与WebSphereApplicationServerejb容器一同工作,使范例eJB实现EJB规范定义的所有特性。
Another helpful addition to PHP V5 is the abstract class, which makes it easy to have one base class to implement the core of an interface from which you then create concrete classes.
PHPV 5中另一个有帮助的新功能是抽象类,使用抽象类可以轻松地用一个基类实现接口的核心部分,然后用该接口创建实体类。
Rather than merely redefining or adding specific methods as in most inheritance patterns, Spark concrete classes have two features (the general pattern is common to the stages and various parents).
Spark具体类并不象大多数继承模式中的类那样仅仅重新定义或添加特定的方法,而是具有两种特性(一般的模式与各阶段和各种父模式都一样)。
We can't instantiate instances of abstract classes, even when all their field and method members are concrete.
我们不能实例化一个抽象类,即使它们的字段和方法都是具体的。
To achieve a degree of consistency between different interception points, it was decided to create a set of base classes that could be subclassed for each concrete interception point.
为了在不同的拦截点间保持一定程度的一致性而做出的决定是,创建一组基类,可以根据这些基类为每个具体的拦截点创建子类。
Client classes can be coded to require only the abstract type, leaving the strategies and outcomes of implementation to the concrete class instances passed to them at run time.
客户机类可被编码为只需要抽象类型,而把实现策略和结果留给在运行时传递给它们的具体类实例。
Its components rely on interfaces and abstract classes as opposed to concrete ones, as they would in a tightly coupled system.
松散耦合应用程序中的组件依赖于各种接口和抽象类,而紧密耦合的系统则与之相反,其组件依赖于各种具体的类。
Listing 6 shows the concrete DictionaryIO classes, with the actual implementations omitted for the sake of brevity.
清单6展示了具体的dictionaryio类,为了简洁,此处省略了实际实现。
Adding new data types (classes) with visitors is difficult, however, as the visitor pattern requires a visit method for all concrete types.
然而,通过访问者添加新数据类型(类)较为困难,因为访问者模式要求所有具体类型都具有一个visit方法。
It also introduces the BaseEntity and AuditableEntity base classes, from which concrete persistent classes can be extended, depending on whether or not auditing information is required for an object.
还引入了BaseEntity和AuditableEntity基类,可以根据是否需要对象的审计信息,分别从这些基类派生出具体的持久化类。
应用推荐