Re: VB 6 -> C# Classes technical note...
From: Dmitriy Lapshin [C# / .NET MVP] (x-code_at_no-spam-please.hotpop.com)
Date: 12/09/04
- Next message: jam: "Re: Console application process question"
- Previous message: Dmitriy Lapshin [C# / .NET MVP]: "Re: calling methods of components running in windows service"
- In reply to: SpotNet: "VB 6 -> C# Classes technical note..."
- Next in thread: SpotNet: "Re: VB 6 -> C# Classes technical note..."
- Reply: SpotNet: "Re: VB 6 -> C# Classes technical note..."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 9 Dec 2004 10:44:24 +0200
Hello,
No, they are not equal. Public Not Creatable means that the class interface
is visible to the clients, but the clients cannot instantiate the class.
It's rather like a regular class with a private constructor in C#.
Speaking of factories, you can either make them fully static, or you can
implement the Singleton pattern - in which case there will be only one
static property returning the sole instance of the class, but the rest of
properties and methods will be non-static.
-- Sincerely, Dmitriy Lapshin [C# / .NET MVP] Bring the power of unit testing to the VS .NET IDE today! http://www.x-unity.net/teststudio.aspx "SpotNet" <SpotNet@msnews.grp> wrote in message news:%2301B7Ua3EHA.2788@TK2MSFTNGP15.phx.gbl... > > Hello NewsGroupies, > > Not a problem nor a show stopper, just want to ask whether a public not > creatable class in VB6 equates to a class of static members in C# (or > static > class in the new C# to come). Just built a whole lot of interface classes > in > C# and want to allocate the interface to the appropriate implementation > via > a 'factory' class, which in VB6 was done using a Public Not Creatable > class. > > I know it works using statics just asked for self clarification. > > Many thanks and Regards, > SpotNet. > >
- Next message: jam: "Re: Console application process question"
- Previous message: Dmitriy Lapshin [C# / .NET MVP]: "Re: calling methods of components running in windows service"
- In reply to: SpotNet: "VB 6 -> C# Classes technical note..."
- Next in thread: SpotNet: "Re: VB 6 -> C# Classes technical note..."
- Reply: SpotNet: "Re: VB 6 -> C# Classes technical note..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|