Message
From
04/09/2006 14:51:24
 
 
To
04/09/2006 14:40:00
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01150471
Message ID:
01150769
Views:
43
>>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.

Shouldn't be any problems with that. I'm packing in now and have a site visit tomorrow so will be mostly incommunicado for the next 24hrs...
Good luck in the meantime,
Viv
Previous
Next
Reply
Map
View