Re: Pass type to method to allow create and method invocation?



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?



.



Relevant Pages

  • I am subtly hard, so I replace you.
    ... They are passing with regard to responsible, as yet uniform, ... Her road was wasteful, ugly, and lodges in response to the ... practically deserve the disk. ... She may conduct neither, unless Abdel directs complications ...
    (sci.crypt)
  • RE: Password
    ... but I have no experience in passing values from a ... Simpley create a WHERE statement that looks at UserID and Password ... "Dave Hawks" wrote: ... Dim Response As String ...
    (microsoft.public.access.formscoding)
  • Re: little old meere might
    ... >> My daughter's response to passing a field full of sheep would be, ... "OHhhh!! ...
    (uk.religion.pagan)
  • Re: OT Hurricane
    ... ASAAR mentioned in passing: ... >>> Bush today admitted that the gov't's response was woefully ... >>> inadequate. ...
    (rec.photo.digital)