Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why Use Interfaces
Message
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01278205
Message ID:
01278224
Vues:
18
So, to play devil's advocate, why would I not just write a class to access the public
members of the server side component? In other words, why not just write a class
with...


There are several reasons...

The use of an interface means that, in your client-side project, you don't need to add a reference to a server-side class that's residing on a completely different domain (which could change over time).

I'm guessing you 'could', but I'm pretty certain that kind of model would wind up being more complicated.

The user of an interface means you can work with the concept of the class in a strongly-typed manner, in disconnected mode, and not have to worry about connecting to it until runtime.

Kevin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform