Sign in to follow this  
Toolmaker

[.net] .NET delegates/events and UML?

Recommended Posts

I'm currently designing an online game in UML(Not, not an MMO dammit!) and I'm going to write it in C#, but I have _NO_ idea whatsoever on how to model .NET events. For instance, the server has a Client class. When a connection is accepted, a new instance will be spawned. The lobby server then sets a bunch of delegates to the client, such as Join, Disconnect, ChatMessage, Command. In normal C++, it would just call lobbyServer->OnJoin(username), but in this case, it's a delegate. How would I model this? Still as I did in the following sequence diagram? Toolmaker

Share this post


Link to post
Share on other sites
The raising of an event is still just a method call. But there are a couple of things to look out for:
1. There has to be a registration for the event (button.click += this.button_click)
2. Check whether the handling of the event is on the same thread. This would cause a half arrow that returns immediately.

Cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this