473,388 Members | 1,207 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Anything Wrong With "preloading" Assemblies?

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!

Jun 27 '08 #1
4 1385
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
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!

--
Holger Kreissl
..NET Software Developer
http://kreissl.blogspot.com/
Jun 27 '08 #2
<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

Jun 27 '08 #3
I'm not all warm and fuzzy about this approach to tell you frankly. I think
your working set will grow large which will result in page faults and
performance issues. You can't really unload an assembly so it sits around
hogging memory and resources. Anyway you go with modern code would isolate
the logic so your benefit in item 1 is not a distinct advantage.

I'd suggest a redesign to work around the working set issue. Use inheritance
and a class hierarchy to 'point' to the functionality. When it is required,
you would load it inside an app domain. app domains can be unloaded and are
a lot lighter than assemblies so essentially, you would have one assembly
that knows where the functionality of each plug in is.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------


"Robert Cramer" <A@B.comwrote in message
news:OY**************@TK2MSFTNGP03.phx.gbl...
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!

Jun 27 '08 #4
This --
http://www.eggheadcafe.com/articles/20041204.asp
--might give you some ideas along this line of thought. The original concept
was developed by my friend and fellow MVP, J. Ambrose Little.
-- Peter
To be a success, arm yourself with the tools you need and learn how to use
them.

Site: http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://ittyurl.net
"Robert Cramer" wrote:
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!

Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bob | last post by:
I usually use some "pre-load" code in my pages to preload graphics that will be swapped. But, I'm thinking that rather than the long, repetitive, once, for each graphic hardcoded stuff like this: ...
1
by: Stacey | last post by:
Hi, I'm hoping for a bit of advise-- I have a (relatively, from the point-of-view of this dilettante) complex script that attempts to preload certain images in order to trigger one of a series of...
4
by: Scott Johnson | last post by:
Hi! Is there a way to "preload" a form using a thread or something else so that my user doesn't have to wait 5 seconds (initializing time) between forms? Some of these forms have tab strips with...
3
by: emilper | last post by:
Hi, while using mod_php in apache: If I am including one .inc file in one page, does it get compiled and kept in memory so when I include the same file in another page on the same server, the...
1
by: mmcc128 | last post by:
Currently using the "document.images" to "preload" images - not for future pages, but for the page being loaded. I got it from http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm Its a...
4
by: illegal.prime | last post by:
Hi all, I'm getting unexpected results when trying to preload assemblies into an AppDomain I'm creating. Upon creation of the AppDomain - I attach an AssemblyResolve to both my current AppDomain...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.