> I am writing an application that will handle plugins, every plugin will have
> a lot of "utilities" that the user can select from and execute.
[quoted text clipped - 9 lines]
> footprint and as my application has a lot of utilities, my overall resource
> usage will be dramatically high.
Why? The footprint from the classes themselves is likely to be
insignificant compared with the *instances* of the classes - and there,
the number of different classes you've got is pretty much irrelevant.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
ernesto bascón pantoja - 14 Sep 2005 23:57 GMT
So, do you consider that implement this solution with subclass of Utility
should be a better solution instead of using a lot of delegates?
ernesto
ernesto bascón pantoja <ebasconp@gmail.com> wrote:
> I am writing an application that will handle plugins, every plugin will
> have
[quoted text clipped - 12 lines]
> resource
> usage will be dramatically high.
Why? The footprint from the classes themselves is likely to be
insignificant compared with the *instances* of the classes - and there,
the number of different classes you've got is pretty much irrelevant.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jon Skeet [C# MVP] - 15 Sep 2005 00:02 GMT
> So, do you consider that implement this solution with subclass of Utility
> should be a better solution instead of using a lot of delegates?
I'd use each where it's appropriate. I wouldn't *force* deriving from
Utility though - why not use an interface, then you can derive from
Utility where it makes sense to do so, but implement the interface in a
different way where things are different?

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
>Talking with another developer, he suggested me that I should not create a
>subclass for every Utility that I have, because every class has a big
>footprint and as my application has a lot of utilities, my overall resource
>usage will be dramatically high.
How many are "a lot"? Tens, hundreds, thousands?
I wouldn't worry about it unless you have actual profiling and memory
usage data that indicates it's a problem.
Now, if you want to reduce the memory footprint of your app, perhaps
you should consider a design where you don't have to load the plugin
assemblies until they are actually needed. Or will the user actually
use all "utilities"?
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
ernesto bascón pantoja - 14 Sep 2005 23:45 GMT
Hi Mattias:
>>Talking with another developer, he suggested me that I should not create a
>>subclass for every Utility that I have, because every class has a big
[quoted text clipped - 3 lines]
>
> How many are "a lot"? Tens, hundreds, thousands?
Maybe thousands (I will have plugins with near one hundred utilities).
> I wouldn't worry about it unless you have actual profiling and memory
> usage data that indicates it's a problem.
[quoted text clipped - 3 lines]
> assemblies until they are actually needed. Or will the user actually
> use all "utilities"?
The user will not use all utilities at the same time, but all the utilities
must be instantiated the first time to get registered into the application
data base, so, the next time the application will be executed, only the
really needed plugins will get loaded, but.... what for the first time? I
could provide a kind of "UtilityInfo" class that could contain the
information needed to allow the utility to get registered into my app, but
it makes the utility development more complex, I guess.
> Mattias