1
General Board / Re: Sequence Diagram - How to model C#-events?
« on: April 10, 2006, 08:23:57 am »
Hello Bruce, hello David,
thank you very much for your long and detailed answers.
I think I should have been more specific in my question.
ClassA implements a hardware-component which receives messages/signals from the "outer world". ClassA translates these messages/signals to the event MyEvent. ClassB is a kind of "listener" and invokes HandleMyEvent when the event MyEvent is raised.
I want to describe for some specific scenarios how a message/signal from the "outer world" enters into the software-system and it "spreads" out. I want to show which objects are activated at what time and how they pass the information invoking the methods of other objects.
I think the Sequence Diagram is just the appropriate instrument to accomplish that. In order to show the the connection between the event ClassA.MyEvent and ClassB.HandleMyEvent I draw an arrow from an instance of ClassA to an instance of ClassB like ClassA would do a "normal" invocation of ClassB.HandleMyEvent. (When this arrow crosses a thread-boundary I mark it as asynchronous.) But this arrow gives me only part of what it's happening: The arrow tells me that ClassB.HandleMyEvent is invoked, but it doesn't tell me that the cause of the invocation was the firing of ClassA.MyEvent.
Do you think that there are more appropriate means in UML than the Sequence Diagram to represent what I want?
Juergen
thank you very much for your long and detailed answers.
I think I should have been more specific in my question.
ClassA implements a hardware-component which receives messages/signals from the "outer world". ClassA translates these messages/signals to the event MyEvent. ClassB is a kind of "listener" and invokes HandleMyEvent when the event MyEvent is raised.
I want to describe for some specific scenarios how a message/signal from the "outer world" enters into the software-system and it "spreads" out. I want to show which objects are activated at what time and how they pass the information invoking the methods of other objects.
I think the Sequence Diagram is just the appropriate instrument to accomplish that. In order to show the the connection between the event ClassA.MyEvent and ClassB.HandleMyEvent I draw an arrow from an instance of ClassA to an instance of ClassB like ClassA would do a "normal" invocation of ClassB.HandleMyEvent. (When this arrow crosses a thread-boundary I mark it as asynchronous.) But this arrow gives me only part of what it's happening: The arrow tells me that ClassB.HandleMyEvent is invoked, but it doesn't tell me that the cause of the invocation was the firing of ClassA.MyEvent.
Do you think that there are more appropriate means in UML than the Sequence Diagram to represent what I want?
Juergen