If you only have a concrete class, you can create an interface from the class, change your application code to program to the interface, and then proceed as described above.
如果您只有一个具体的类,那么您可以从类中创建一个接口,您的应用程序代码改写为接口,然后按照前面的描述继续进行。
A class (whether abstract or concrete) that implements an interface does not really inherit anything from the interface it implements.
一个类(不管是抽象的还是具体的)实现一个接口并不真正从它实现的接口继承任何东西。
The concrete DAO class contains logic for accessing data from a specific data source.
具体的dao类包含访问特定数据源的数据的逻辑。
应用推荐