471,570 Members | 942 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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.CreateInstance. 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***********@gmail.com

Feb 1 '06 #1
2 1598
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.com

<br***********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.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.CreateInstance. 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***********@gmail.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 "performance 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.CreateInstance. 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***********@gmail.com

Feb 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Robert Vasquez | last post: by
reply views Thread by Verane | last post: by
1 post views Thread by Ashish | last post: by
reply views Thread by Konstantin Gonikman | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

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.