By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,569 Members | 1,630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,569 IT Pros & Developers. It's quick & easy.

One more try on Delegates

P: n/a
Hello everyone,

I am attempting to learn more about delegates and their role in VB.Net.

Say you have a service class (Server) and a client session class (Client).
When a consumer makes contact with the the service (say via sockets), the
server will spawn a new client instance and have it deal with the consumer
directly. The first thing you would want the consumer to do is present
credentials and authenticate. The server knows how to connect to the
database, and so it should be the one responsible for the authentication.

One approach to take would be to create a property in the client that points
to the server

friend writeonly property Server as Server
end property

function Authenticate(Username, Password) as boolean
if server.authenticate(UserName, Password) then
end if
end function

I am fine with that type of logic, but wouldn't this be a good use of a
delegate function? If so, how would I make use of such a concept. If not,
what are delegate functions really for?

Thanks for the help
Apr 6 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.