这个函数就是DbProviderFactory类的一个虚方法,这个方法会在子类中将被重写, 而子类(SqlClientFactory)中的代码类内容如下(位于System.Data.SqlClient.SqlClientFactory)
基于20个网页-相关网页
在这种情况中,您可以填充一个子类清单,而不用验证表单的其他内容。
In this case, it lets you populate a subcategory list without validating the rest of the form.
该异常的抛出,表明代码企图把对象的类型转换成一个子类,而该对象并不是这个子类的实例。
Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance.
Factory 方法模式是一个创建的模式,它定义一个用来创建对象的接口,而让子类来决定实例化哪个类。
The Factory Method Pattern is a creational pattern that defines an interface for creating an object but lets subclasses decide which actual class to instantiate.
应用推荐