Yes. Here's the premise. We have a messaging system so that all of our trading machines can talk to each other using MSMQ. The messaging system (GOURMET) is generic and context free. All the messages are passed as interfaces (IRemoteMessage.)
Each application that wants to speak remotely creates its own class that implements IRemoteMessage in its own library. With the exception of the central trading framework application (TKS,) nearly all of our applications are distributed as libraries that are loaded dynamically at runtime. These include applications with specific trading logic and applications like GOURMET, which provide services for the trading logic applications. For any given workstation, we have no idea what applications a trader might be running other than TKS. When the GOURMET system is receiving messages, it's getting self-describing XML nodes that contain all of their own metadata. Using this metadata, it attempts to deserialize into a clone of the object that was sent on the other end of the line. But, not all of the messages it receives will be of recognizable types. A given machine might not have the appropriate assembly or the appropriate assembly version to recreate the class that generated the message. Since GOURMET can be handling up to 500 messages per second, it has to be very efficient. Two artitectural directives are to avoid using exceptions to determine the absence of a library and to avoid loading unnecesary assemblies into memory. This includes all executables since we know that any executable is either (a) already running or (b) outside of the domain of meaningful messages for the currently running application. --Jekke -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of David Lanouette Sent: Wednesday, January 04, 2006 5:37 PM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] Is this System.Assembly an executable or a library? Jekke, I don't think I understand. Why do you think you need to explicitly load the assembly. Are you loading classes using reflection? On 1/4/06, Jekke Bladt <[EMAIL PROTECTED]> wrote: > If the assembly in question is a library, I want to be able to load it > into memory before creating a class out of it. This is for a system that > sends messages of various types over MSMQ in serialized XML with no way > of guaranteeing that the listener will already have the assembly loaded. > > The only assemblies we could guarantee would be running are the > executable and the messaging library (aka GOURMET.) Since message types > are defined in the executable, GOURMET, and third-party libraries, we're > trying to avoid trying to load either GOURMET or the executable at > runtime (when they are guaranteed to already be loaded.) > > --Jekke > > -----Original Message----- > From: Discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of Eric Means > Sent: Wednesday, January 04, 2006 4:42 PM > To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM > Subject: Re: [ADVANCED-DOTNET] Is this System.Assembly an executable or > a library? > > > System.IO.Path.GetExtension(Assembly.GetModules()[0].FullyQualifiedName) > would work similarly. > > From a practical perspective, I'm not sure there's much difference > between > an EXE assembly and a DLL assembly, except that the EXE contains a shim > to > kick off the .Net core and start the EXE's Main() function. Out of > curiousity, why do you need to know? > > On 1/4/06, David Lanouette <[EMAIL PROTECTED]> wrote: > > > > I doubt that this is the best way, but... > > > > if (Assembly.GetExecutingAssembly().Location.EndsWith(".dll")) > > Console.WriteLine("Dll"); > > else > > Console.WriteLine("exe"); > > > > > > > > > > > > On 1/4/06, Jekke Bladt <[EMAIL PROTECTED]> wrote: > > > All-- > > > > > > Is there a straightforward way to determine from an Assembly object > > > whether it is an executable or a library? > > > > > > TIA > > > > > > --Jekke > > > > > > =================================== > > > This list is hosted by DevelopMentor(r) http://www.develop.com > > > > > > View archives and manage your subscription(s) at > > http://discuss.develop.com > > > > > > > > > -- > > ______________________________ > > - David Lanouette > > - [EMAIL PROTECTED] > > > > =================================== > > This list is hosted by DevelopMentor(r) http://www.develop.com > > > > View archives and manage your subscription(s) at > > http://discuss.develop.com > > > > > > -- > Eric Means > [EMAIL PROTECTED] > http://www.randomtree.org/eric/ > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com > -- ______________________________ - David Lanouette - [EMAIL PROTECTED] =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com