Anything Wrong With "preloading" Assemblies?

R

Robert Cramer

I am needing to create a sort of "plug-in architecture" whereby different
Web sites I maintain on the same server have slightly different
functionality. Some Web sites will need to use the functionality in some
assemblies, while others will get similar functionalilty from different
assemblies.

What I was thinking about doing - and I'd apprecaite your feedback on this -
is to load the assemblies required by a particular site into the site's
default application domain, and do this loading during Application_Start. I
would load the assemblies via Reflection (e.g., Assembly.Load()).

Two benefits of doing it this way:
1. I can have all the logic in one place... this is the logic that
determines which assemblies to load for the current site.

2. A minor benefit is that when members from a given assembly are eventually
required, the assembly is already loaded, thereby helping with runtime
performance.

Are there any significant downsides to doing it this way, or reasons I
should not preload these assemblies? Any "gotchas" I should account for?

Thanks!
 
H

Holger Kreissl

Hello Robert

i dont see any problems here. The only thing to discuss is the preload
instead of load on demand. But that depends on your specific
architecture. But i am looking forward to read some other opinions about
that.
Greetings,
holger
 
R

Robert Cramer

<snip>

RE:
<< The only thing to discuss is the preload instead of load on demand. But
that depends on your specific architecture >>

In my case I have a few HTTP handlers per Web site that are not traditional
..ASPX pages (they don't even inherit Page). It is the selection of the
particular subset of special handlers [to load for a given site] that I
would like to perform during Application_Start. For me this selection is the
primary motivation. I have to do it somewhere and would prefer to NOT run
that logic potentially many times, which would be the case if I were to go
with a load-as-needed implementation. The performance of having them pre
loaded is of secondary importance, although it's certainly a benefit.

-RC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top