每个具体类使用一个数据实体。
一个实现了dao接口的具体类。
模拟具体类和接口的能力。
4使用隐式多态实现每个具体类一张表。
回想一下之前关于使用接口还是具体类的讨论。
Recall the earlier discussion on using interfaces versus concrete classes.
创建一个模拟对象类作为具体类中的一个子类。
Create a mock object class as a subclass of the concrete class.
从接口继承,不要继承于具体类。
如何实例化一个具体类初始化粘合剂?
策略3:每个具体类一个表(estates)。
图7显示了将每个具体类映射成数据实体时的持久性模型。
Figure 7 presents the persistence model when each concrete class is mapped to a data entity.
在这里完成的所有操作是获得用于实际的具体类中方法的同一个签名。
All you've done here is take the same signature you used for the method in the actual concrete class.
灰框代表JMS 1.02的“统一域”中未被XMS实现的具体类。
The grey boxes represent the domain specific classes in JMS 1.02 that are not implemented by XMS.
清单2中的值对象看起来和我们的远程接口几乎相同,但它实际上是具体类。
The value object in Listing 2 looks almost identical to our remote interface, but it's actually a concrete class.
这种技术有助于敏捷开发——不需要创建许多只在一个组件中使用的具体类。
This technique helps in agile development, without the need to create many concrete classes that will be used only in one component.
JDBC的具体实现是被隐式加载的,而且源代码很少直接引用这些具体类。
JDBC concrete implementations are loaded implicitly, and source code rarely references these concrete classes directly.
如果你想添加更多子类型,只需创建一个新的具体类,并使用它。
If you want to add more subtypes, simply create a new concrete class and use it.
EasyMock框架的一个主要缺点是不能模拟具体类——而只能模拟接口。
One major disadvantage of the EasyMock framework is that you can't mock concrete classes - only interfaces.
要映射两个具体类(Lease和Property),就要使用XML标签。
To map our two concrete classes (Lease and Property), we will use the XML tag.
正如上文所示,对具体类的查询只选择需要的数据,没有不必要的表连接和联合。
As shown above, queries on concrete classes only select the required data without unnecessary table joins or unions.
通常用这个属性查找在ApacheDS 中保存的具体类的实例。
You normally use this attribute type to find instances of a particular class stored in ApacheDS.
场景3:使用jMock和RMock 模拟带有非默认构造函数的具体类
Scenario 3: Use jMock and RMock to mock a concrete class with a nondefault constructor
在这种情况下最好是实施方法的抽象类而不是定义分别在你所有的具体类。
In this case it is better to implement the method in abstract class rather than defining it separately in all your concrete classes.
为创建一组相关或相互依赖的对象提供一个接口,而且无须指定它们的具体类。
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
首先,具体类所完成的大部分工作都在方法的文档字符串(docstring)中指定。
First, much of the work done by a concrete class is specified in the docstrings of methods.
为了让DI工作,必须拥有一个接口,可以把这个接口的具体类注入到需要的行为的消费者中。
For DI to work, you must have an interface whose concrete class you can inject into the consumer of the behavior you desire.
希夫:-最重要的,我们已经忘记的一点是我们需要使我们的具体类将由客户端调用。
Shiv: - One of the most important points we have forgotten is we need to make our concrete class which will be called by the client.
客户机类可被编码为只需要抽象类型,而把实现策略和结果留给在运行时传递给它们的具体类实例。
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.
通过进一步检查exception包并注意抽象到具体类的比率,可以派生出另一个度量:抽象性。
By further examining the exception package and noting the ratio of abstract to concrete classes, you can derive another metric: abstractness.
它现在不接受ICollaborator接口,而接受具体类实现(collaborator类)。
Instead of accepting an ICollaborator interface, it now accepts a concrete class implementation (the Collaborator class).
结合过程模拟的概念和应用,介绍了类库开发中采用的具体类、抽象类和层次类等典型类结构。
Combining with the concepts and applications of simulation, several typical class structures such as concrete, abstract and node are introduced.
应用推荐