Topic
  • 3 replies
  • Latest Post - ‏2008-05-27T00:51:23Z by SystemAdmin
SystemAdmin
SystemAdmin
1130 Posts

Pinned topic Which diagram to use to show different outcomes based on event sequences?

‏2008-05-22T13:31:50Z |
Hi

I'm fairly new to UML, and want to model a given use case (update order), which could have different outcomes depending on a given sequence of events from two objects interacting asynchronously.

For example, one out come is where message (m1) from object 1 is sent before a message (m2) is received from object 2.

The other outcome is when the same message (m1) from object 1 is sent after the message (m2) is received from object 2.

At the moment I think I need two separate sequence diagrams to show both possible scenarios. Would that be the best approach?

Thanks
Updated on 2008-05-27T00:51:23Z at 2008-05-27T00:51:23Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1130 Posts

    Re: [uml] Which diagram to use to show different outcomes based on event sequences?

    ‏2008-05-22T22:03:13Z  
    What you are referring to is asynchronous processing.
    Here is one way to do it:
    Take a look at the message numbering format on a communications diagram. You
    can number the messages on a sequence diagram if you like. Use an uppercase
    letter at the beginning of the message ID to identify the thread.
    Scott

    On Thu, May 22, 2008 at 8:31 AM, uml wrote:

    Hi

    I'm fairly new to UML, and want to model a given use case (update order),
    which could have different outcomes depending on a given sequence of events
    from two objects interacting asynchronously.

    For example, one out come is where message (m1) from object 1 is sent
    before a message (m2) is received from object 2.

    The other outcome is when the same message (m1) from object 1 is sent after
    the message (m2) is received from object 2.

    At the moment I think I need two separate sequence diagrams to show both
    possible scenarios. Would that be the best approach?

    Thanks

    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com

    What you are referring to is asynchronous processing.
    Here is one way to do it:
    Take a look at the message numbering format on a communications diagram. You can number the messages on a sequence diagram if you like. Use an uppercase letter at the beginning of the message ID to identify the thread.
    Scott

    On Thu, May 22, 2008 at 8:31 AM, uml <disadmin@us.ibm.com> wrote:
    Hi



    I'm fairly new to UML, and want to model a given use case (update order), which could have different outcomes depending on a given sequence of events from two objects interacting asynchronously.



    For example, one out come is where message (m1) from object 1 is sent before a message (m2) is received from object 2.



    The other outcome is when the same message (m1) from object 1 is sent after the message (m2) is received from object 2.



    At the moment I think I need two separate sequence diagrams to show both possible scenarios. Would that be the best approach?



    Thanks

    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com


    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com
  • SystemAdmin
    SystemAdmin
    1130 Posts

    Re: [uml] Which diagram to use to show different outcomes based on

    ‏2008-05-26T10:48:00Z  
    What you are referring to is asynchronous processing.
    Here is one way to do it:
    Take a look at the message numbering format on a communications diagram. You
    can number the messages on a sequence diagram if you like. Use an uppercase
    letter at the beginning of the message ID to identify the thread.
    Scott

    On Thu, May 22, 2008 at 8:31 AM, uml wrote:

    Hi

    I'm fairly new to UML, and want to model a given use case (update order),
    which could have different outcomes depending on a given sequence of events
    from two objects interacting asynchronously.

    For example, one out come is where message (m1) from object 1 is sent
    before a message (m2) is received from object 2.

    The other outcome is when the same message (m1) from object 1 is sent after
    the message (m2) is received from object 2.

    At the moment I think I need two separate sequence diagrams to show both
    possible scenarios. Would that be the best approach?

    Thanks

    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com

    What you are referring to is asynchronous processing.
    Here is one way to do it:
    Take a look at the message numbering format on a communications diagram. You can number the messages on a sequence diagram if you like. Use an uppercase letter at the beginning of the message ID to identify the thread.
    Scott

    On Thu, May 22, 2008 at 8:31 AM, uml <disadmin@us.ibm.com> wrote:
    Hi



    I'm fairly new to UML, and want to model a given use case (update order), which could have different outcomes depending on a given sequence of events from two objects interacting asynchronously.



    For example, one out come is where message (m1) from object 1 is sent before a message (m2) is received from object 2.



    The other outcome is when the same message (m1) from object 1 is sent after the message (m2) is received from object 2.



    At the moment I think I need two separate sequence diagrams to show both possible scenarios. Would that be the best approach?



    Thanks

    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com


    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com
    Thanks Scott,

    It seems though that with a Communications Diagram, I can indicate several asynchronous messages executed in different threads, but this diagram can't indicate different outcomes if one thread finishes before another.

    Imagine an order management system talking to a separate inventory system. The order system sends the order request (asynchronously) to the inventory system. In the time between receiving the reply from the inventory system, the order system continues to work on that order. If some of those tasks occur before receiving the inventory system reply, then you would have outcome 1, otherwise outcome 2.
    Should I use guards to test for the reply from the inventory system?
    Nick
  • SystemAdmin
    SystemAdmin
    1130 Posts

    Re: [uml] Which diagram to use to show different outcomes based on

    ‏2008-05-27T00:51:23Z  
    Thanks Scott,

    It seems though that with a Communications Diagram, I can indicate several asynchronous messages executed in different threads, but this diagram can't indicate different outcomes if one thread finishes before another.

    Imagine an order management system talking to a separate inventory system. The order system sends the order request (asynchronously) to the inventory system. In the time between receiving the reply from the inventory system, the order system continues to work on that order. If some of those tasks occur before receiving the inventory system reply, then you would have outcome 1, otherwise outcome 2.
    Should I use guards to test for the reply from the inventory system?
    Nick
    Nick,
    Guards are what I was thinking about. But the real question to ask is: "Is
    it possible to not care about the response from the inventory management
    system until some other interesting event occurs?" If not, then perhaps you
    are trying to solve a synchronous problem with asynchronous techniques. This
    can be problematic. If on the other hand, you can redesign your solution to
    turn the order management system into a sequence of processes separated by
    wait states, you might find that the response from the inventory management
    system is not needed by order management until after one of those wait
    states. In which case your problem is solved. If you have truly asynchronous
    behavior between the two systems, then the process that sent the original
    message to the inventory system will not care about the response.
    I hope that helps,
    Scott

    On Mon, May 26, 2008 at 5:48 AM, uml wrote:

    Thanks Scott,

    It seems though that with a Communications Diagram, I can indicate several
    asynchronous messages executed in different threads, but this diagram can't
    indicate different outcomes if one thread finishes before another.

    Imagine an order management system talking to a separate inventory system.
    The order system sends the order request (asynchronously) to the inventory
    system. In the time between receiving the reply from the inventory system,
    the order system continues to work on that order. If some of those tasks
    occur before receiving the inventory system reply, then you would have
    outcome 1, otherwise outcome 2.

    Should I use guards to test for the reply from the inventory system?
    Nick

    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com

    Nick,
    Guards are what I was thinking about. But the real question to ask is: "Is it possible to not care about the response from the inventory management system until some other interesting event occurs?" If not, then perhaps you are trying to solve a synchronous problem with asynchronous techniques. This can be problematic. If on the other hand, you can redesign your solution to turn the order management system into a sequence of processes separated by wait states, you might find that the response from the inventory management system is not needed by order management until after one of those wait states. In which case your problem is solved. If you have truly asynchronous behavior between the two systems, then the process that sent the original message to the inventory system will not care about the response.
    I hope that helps,
    Scott

    On Mon, May 26, 2008 at 5:48 AM, uml <disadmin@us.ibm.com> wrote:
    Thanks Scott,



    It seems though that with a Communications Diagram, I can indicate several asynchronous messages executed in different threads, but this diagram can't indicate different outcomes if one thread finishes before another.




    Imagine an order management system talking to a separate inventory system. The order system sends the order request (asynchronously) to the inventory system. In the time between receiving the reply from the inventory system, the order system continues to work on that order. If some of those tasks occur before receiving the inventory system reply, then you would have outcome 1, otherwise outcome 2.


    Should I use guards to test for the reply from the inventory system?


    Nick

    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com


    _______________________________________________
    uml mailing list
    uml@lists.ca.ibm.com
    Unsubscribe:uml-leave@lists.ca.ibm.com