I have been putting it off, but I think i need to become better versed in
delegates. I have been reading about them and I am unable to discern how to
use them or when to use.
It would seem to me, at least in one instance, that you would define a
delegate in a parent object to allow child objects to access in threaded
applications, code reusability, or as plain call-backs. But how.
Lets say you have a pop server class and a session class. The pop server
will want to know when a session authenticates so that it can prepare
information for the rest of the session. We need the pop server to complete
this task before completing the authentication process, but we do not want
the rest of the sessions to wait for this to complete. So I was thinking,
have the pop server perform the authentication, prepare information, return
the result.
public class popserver
'Create our delegate
public delegate function Authenticate(SessionID as string, UserName as
string, Password as string)
'Create our delegate handler
public function DoAuthenticate as Authenticate
return bResult
end function
end class
public class Session
'Consume our deleagate
'But how
end class
TIA