Information générale
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Network:
Windows 2003 Server
Yes, you should. Interfaces just guarantees that an object has a specific set of methods and properties defined. You then add the code as needed to each method and set the properties just like you would, without an interface.
If you want to use the code from another object, a lot of times I like to use composition, instead of inheritence. It offers a more flexible design and you can compose any number of classes.
Aloha,
James
>I currently have the BasePath property defined in my base page class and I set it in OnLoad() event to be the full URL path to the root of my website (using Request.ServerVariables). Then I can build paths to different subfolders in my website no matter what server my sight is running on.
>
>I have not used Interfaces yet. Would I be able to access Request.ServerVariables in the get() method of my property if I were to define it in an Interface?
>
>Matt
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement