• Advertisement
Sign in to follow this  

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

This topic is 4502 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement