Re: Pass type to method to allow create and method invocation?
- From: "Grant Schenck" <schenckg@xxxxxxxxxxxxx>
- Date: Fri, 17 Aug 2007 15:06:52 -0400
No because the class needs to be able to create instances of the specified
type in response to external events (in this case, phone calls.)
So, this class is to monitor one line or port of a phone system's
interactive voice response unit. The class wants to respond to inbound
calls by creating a script object to interact with the caller (the script
spins off a thread) FOR EACH CALL.
--
Grant Schenck
"UL-Tomten" <tomten@xxxxxxxxx> wrote in message
news:1187368343.230170.310340@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 17, 4:59 pm, DeveloperX <nntp...@xxxxxxxxxxxxx> wrote:
Would that work? I read that as TScript must implement TScriptBase,
but we're passing in a class of type Type which does not.
Well, I would certainly recommend against passing a Type, because it
seems like something you would only do if late binding was your only
option. I got the impression your class hierarchy and its uses was
known at runtime, in which case the compiler and the CLR could do all
that work for you. But since I haven't the faintest clue about what
the bigger picture is, maybe a Type is what you need.
My knowledge might be muddied by the fact that it's a type of type
Type and Type might expose something that where understands...
No, I was only assuming a usage along the lines of, say:
DoExecute<ScriptCallInbound>(myScriptCallInbound);
Instead of passing a Type to DoExecute() and creating an instance
inside the method, wouldn't it make more sense to create an instance
outside the method and pass that?
.
- Follow-Ups:
- Re: Pass type to method to allow create and method invocation?
- From: UL-Tomten
- Re: Pass type to method to allow create and method invocation?
- References:
- Re: Pass type to method to allow create and method invocation?
- From: DeveloperX
- Re: Pass type to method to allow create and method invocation?
- From: UL-Tomten
- Re: Pass type to method to allow create and method invocation?
- Prev by Date: Re: Pass type to method to allow create and method invocation?
- Next by Date: Re: Problem inserting dates to SQL Server
- Previous by thread: Re: Pass type to method to allow create and method invocation?
- Next by thread: Re: Pass type to method to allow create and method invocation?
- Index(es):
Relevant Pages
|