Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Major mixup in two ASP.NET transactions
Message
De
04/09/2006 14:40:00
 
 
À
04/09/2006 14:34:50
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01150471
Message ID:
01150767
Vues:
40
>Not quite. The sample I gave used the constructor (New() in VB if IRRC). Ordinary methods aren't quite the same. Defining ordinary methods as static means they can be called without instantiating the actual object: So given:
>public class Framework
>{
>      public static string SayHello()
>      {
>        return "Hello";
>      }
>}
>This method could be used like:
>string s = Framework.SayHello();
>// Rather than:
>f = new Framework();
>string s = f.SayHello();
>// In fact this wouldn't be legal....
>
>Lots of native examples of this behaviour in the .NET framework; Guid.NewGuid() is a classic example....

Thanks, I will have to see if I can switch Initialize() to a New() approach. If yes, then I would have something interesting here.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform