Yes all agents implement an IDeliveryAgent interface and we have a library
of standard agents living in the Vodafone.Standard.DeliveryAgents namespace
hence we need to XML file identify the agent class within the namespace.

I suppose instead of having to declare the class within the XML file we
could use an extended attribute, it's something we'll look into to see if it
helps. Also should I put the assemblies within the GAC? Maybe as you suggest
the actual identification of the agent the user passed could be the complete
Assembly::ClassName like we had for COM monikers.

I must admit that this is all a bit new for me
Thanks for the suggestions/questions.

Robert.



-----Original Message-----
From: Erick Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 7 May 2002 10:06
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Anybody Monikers?


> For what it's worth what I'm trying to do is allow the user to specify a
> delivery agent (something capable of transfering data from point to point,
> email, FTP, http etc) so in an XML file/database they're allowed to have
> something like <AGENT>FTP</AGENT> or <AGENT>EMAIL</AGENT> (a little bit
more
> complicated than this but in the COM world this was a moniker string)

In your example, I assume that there is a AGENT interface. If this is true,
couldn't you use this:

IAgent myAgent =
(IAgent)System.Reflection.Assembly.Load("mycorp.emailagent");

>
> we simply passed this string to getobject and we had a delivery agent. now
> in .Net we can't do it that way anymore so we have a class factory that
maps
> the names of agents to assembly and classes within the assembly. Is this
to
> best solution.

Are you talking about mapping a simple name to a class name? So if you asked
for an "EMAIL" object, you would get an instance of RR.Agent.Email? This
seems like a perfect place for attributes and reflection. I'm not an expert
on attributes, but if you were to mark your class with the agent name you
wanted, you could then use reflection in your factory to find the class with
a particular agent name.

Erick

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.


**********************************************************************"
This correspondence is for the named person's use only. It may
contain confidential or legally privileged information or both. "
No confidentiality or privilege is waived or lost by any "
mistransmission.  If you receive this correspondence in error, please
immediately delete it from your system and notify the sender.  You
must not disclose, copy or rely on any part of this correspondence
if you are not the intended recipient.

Any views expressed in this message are those of the individual sender,
except where the sender expressly, and with authority, states them to
be the views of Vodafone.

This email has been checked for viruses.
**********************************************************************************************

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to