Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# 2.0 Return DataReader object
Message
De
09/03/2012 18:41:05
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01537785
Message ID:
01537876
Vues:
32
An interface says what a class can do, but not how it does it. For example, IDataReader has a Read method that takes no parameters and returns a bool. IDataReader doesn't say how it does the read, but any class that implements IDataReader will have that method. Classes that implement the interface such as SqlDataReader provide the details on how the Read is actually done.

Programming to an interface means that you use the interfaces instead of the classes. Since anything that implements the interface will have the same set of functions and properties, you can do things like substitute the SqlDataReader with an OleDbDataReader with minimal adjustments to your code.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform