Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generics Question
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01278651
Message ID:
01278698
Vues:
20
Hey, Kevin,

One more thing, before I shut down for the day and do some drinking and finish my next CoDe article... (not necessarily in that order!)

Best way to learn Generics, like most things, is to see them from different angles. So in addition to the article I mentioned...

1) Suppose you have a Customer class (with properties for name, ID, etc.), and you want to create a .NET List. You do something like this...
List<CustomerClass> oCustomerList = new List<CustomerClass>();
The angle brackets indicate where you specify the type.

2) In WCF, there's a class called ChannelFactory - it's a factory class that creates communication channels of any interface type, so that WCF clients to send messages to different service endpoints on the back-end. So you can say something like...
ChannelFactory<ICustomer> customersFactory = new ChannelFactory<ICustomer>("Customer");
You can then use that customersFactory object to communicate with your back-end classes.


Again, start with simple examples, and then try to find as many different types of examples, so that you can really see how powerful Generics are.

Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform