Re: Polymorphic UML sequence diagrams



Re: Polymorphic UML sequence diagrams

From: Andrea Baruzzo <andrea.baruzzo_at_gmail.com>
Date: Sat, 21 Oct 2006 18:35:53 +0200
Message-ID: <5db912070610210935j7a7e0d44n9309876507cbf503@mail.gmail.com>
Thank you Vladimir for your comments. I have read the updated version
of the specifications (april 2006) and I have now a better feeling
about how to address this issue, even if the same specifications
probably lacks of a good example (using a diagarm).

Best regards,
Andrea

On 10/19/06, Vladimir Mencl <mencl@nenya.ms.mff.cuni.cz> wrote:
> I think this is possible with UML2.0(+) Interactions.
>
> The situation you are describing consists of two issues: calling
> delivering a single call to multiple objects, and having a polymorphic
> collection of descendants receiving the calls.
>
> For the first part, UML allows you to have a Lifeline representing a
> _multivalued_ structural feature of the classifier (e.g., a collection
> association).  Here, UML says that "arbitrary representative of the
> multivalued ConnectableElement is chosen." (pg 511 of ptc/06-04-02), but
> you can also provide a _selector_ expression to choose the correct element.
>
> This, combined with a _loop_ CombinedFragment, allows you to iterate over
> the whole collection association.
>
> As for polymorphism - there are no restrictions explicitly mentioned, and
> an instance of a subclass should be usable in a collection typed by its
> ancestor.  Hence, the problem you described should be solvable this way.
Received on Sat 21 Oct 2006 - 17:35:59 BST