473,549 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Performance of Dynamically Loaded Assemblies

I have a core web service that acts as a gateway for several third
party web services. Each one of the third party web services has it's
own "interface" class derived from a main interface. When the main web
service receives a request it will load the appropriate class with
Activator.Creat eInstance. Currenty all classes are compiled into a
monolithic assembly.

I want to be able to move each "interface" to its own assembly. The
end result is that I would like to add a new interface without
recompiling and redploying the whole assembly. I want to be able to
add a new assembly for each new interface, and dynamically load the
assembly when a request of that type is received.

The question that I have is about performance. The main web service
will be very busy and will be processing thousands of request per hour.
Am I sacrificing a great amount of performance by doing this? Is
there a way to do this without sacrificing performance?

Thanks,

Brian Gabriel
br***********@g mail.com

Feb 1 '06 #1
2 1672
Brian,

It sounds like your interface design is not too good if you are going to
do this. If you want to create a new interface and have it loaded into your
main assembly, then how will your main assembly know how to use the
interface? The only option you have at that point is to use reflection, and
that is going to kill you in the long run, I think.

What you really want to do is use ONE base interface which supports the
operations across all (or broken up in some way where you can have a clearly
defined interface which you can reference) and then have all of the
different providers implement it.

You don't have to compile all the classes into one assembly. If
anything, have one assembly that has the interface definitions. Your loader
assembly will have a reference to this, as will the implementation
assemblies. Then, you can split out the implementations to different
assemblies, however you want. As long as they implement the same interface,
you will be fine.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<br***********@ gmail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I have a core web service that acts as a gateway for several third
party web services. Each one of the third party web services has it's
own "interface" class derived from a main interface. When the main web
service receives a request it will load the appropriate class with
Activator.Creat eInstance. Currenty all classes are compiled into a
monolithic assembly.

I want to be able to move each "interface" to its own assembly. The
end result is that I would like to add a new interface without
recompiling and redploying the whole assembly. I want to be able to
add a new assembly for each new interface, and dynamically load the
assembly when a request of that type is received.

The question that I have is about performance. The main web service
will be very busy and will be processing thousands of request per hour.
Am I sacrificing a great amount of performance by doing this? Is
there a way to do this without sacrificing performance?

Thanks,

Brian Gabriel
br***********@g mail.com

Feb 1 '06 #2
Brian,
In addition to Nicholas' excellent advice, you should keep in mind that if
your WebService is very busy that once an assembly is loaded into its
AppDomain it stays loaded. So from a performance standpoint, it may actually
be better to have fewer larger assemblies since the main "performanc e hit" is
when the assembly is loaded the first time.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"br***********@ gmail.com" wrote:
I have a core web service that acts as a gateway for several third
party web services. Each one of the third party web services has it's
own "interface" class derived from a main interface. When the main web
service receives a request it will load the appropriate class with
Activator.Creat eInstance. Currenty all classes are compiled into a
monolithic assembly.

I want to be able to move each "interface" to its own assembly. The
end result is that I would like to add a new interface without
recompiling and redploying the whole assembly. I want to be able to
add a new assembly for each new interface, and dynamically load the
assembly when a request of that type is received.

The question that I have is about performance. The main web service
will be very busy and will be processing thousands of request per hour.
Am I sacrificing a great amount of performance by doing this? Is
there a way to do this without sacrificing performance?

Thanks,

Brian Gabriel
br***********@g mail.com

Feb 1 '06 #3

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

Similar topics

3
2965
by: lanky_tx | last post by:
Hi All, We have an automated build and test environment using NAnt and Nunit. Some of our assemblies are being strong named by modifying the AssemblyInfo.cs and having csc compile it. Some of these strong named assemblies are being dynamically loaded into the runtime. We store the metadata information about the strong named assemblies in...
1
1931
by: Robert Vasquez | last post by:
I would like my application to be able to load modules dynamically and release them once they aren't needed. For example in c++ I would load a dll containing the required function, run it, then release the dll after it's no longer needed. What are my options in c#? From what I have read so far I can load assemblies containing the required code...
1
5000
by: Benjamin | last post by:
Hi, I'm currently writing a Web Services that interacts with a database. To allow me to use not just one database provider (for example, I could use MS Access, SQL Server or MySQL), the Web Service dynamically loads up an assembly that implements an Interface I called IDatabase. To load the assembly and create an object, I wrote this...
0
1319
by: Verane | last post by:
Hi all, I am working with C# and Visual studio 2003. What I want to do is the following : I have 3 assemblies, let call them A.exe, B.dll and C.dll. I want to dynamically load B and C when A is loaded. B and C are statically referencing A. Those three projects are in the same solution called mySolution.
1
1021
by: Ashish | last post by:
hi all, Iam trying to investigate some serious memory problems and ways to optimize them in our web application. some of the information i collected using the performance monitor, is that number of assemblies loaded per appdomain is large, we have a lot of pages which are using number of user controls, some of the documentation i read in...
0
1081
by: Konstantin Gonikman | last post by:
Hi, I just played around with WebResource and embeding .js and .css files into my dlls. All works perfectly except following: As I try to embed any WebResources in assemblies that are loaded dynamically from my code (with Assembly.Load() ), WebResource.axd fails to find these resources (FileNotFoundException). Any ideas of work-around?....
2
1260
by: Ravi | last post by:
We have an application which dynamically loads an assembly and creates instances of classes. For this we have written a factory class which reflects the assembly and creates the classes and returns the created objects as plain objects. The caller method casts the object returned by the object factory into appropriate class object and uses it....
2
5095
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application = Windows Forms class B = a singleton hosted within A. B is responsible for dynamically loading classes X, Y, and Z.
1
1360
by: Jordan S. | last post by:
I plan to load an assembly during application startup, and load that assembly via reflection (i.e., it isn't referenced in the application's assembly manifest). The assembly will be loaded into the application's default app domain, with code like this: using System.Reflection; Assembly loadedAssembly = Assembly.LoadFile(pathToMyAssembly); ...
0
7554
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7751
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7992
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7511
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5119
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1973
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1087
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.