You could go for the FactoryMethod pattern where the ConcreteProducts
constructor is "internal", and the method the creates them is in the
same assembly (or module).

If youre happy to go with a single static method to create the
ConcreteProducts, instead of a Creator/ConcreteCreater instance, then
youd be happy with the constraint that new ConcreteProducts would have
to be in the same assembly.

The FactoryMethod Product participant is your IMyInterface.

See the following URL for more information on the Factory pattern:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/h
tml/factopattern.asp

Jonni

-----Original Message-----
>From: Michael Potter <[EMAIL PROTECTED]>
>Sent: Wed, 31 Jul 2002 19:11:10 -0700
>
>I have a static method that will return an object of
>IMyInterface. It will create the best 1 of many
>mutually exlusive objects that implement IMyInterface.
> The object created depends upon the available
>hardware resources.
>
>The objects should not be created outside of the one
>static function. How do I hide the constructor of the
>objects (that implement IMyInterface) from the rest of
>the world and yet, allow them to be exposed to the one
>static creation method?
>
>Any ideas?
>Mike P

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to