Re: Polymorphic UML sequence diagrams

Re: Polymorphic UML sequence diagrams

From: Andrea Baruzzo <>
Date: Wed, 18 Oct 2006 18:09:44 +0200
Message-ID: <>
Hi Robert,
please to meet you again after MoDELS06! :-)

On 10/18/06, Robert France <> wrote:
> Not sure what you mean by a "polymorphic ... scenario". Can you give a
> more descriptive example? Do you want the lifelines to be roles that can
> be played by different instances (not necessarily of the same class)?
> Or are you trying to model program-level polymorphic calls?
This one. I try to describe a general scenario in which an indefinite
number of instances of derived classes execute the same method
(without mention explicity all of them in a sequence diagram as single
instances).  Consider the classical example concerning a list of 25
geometrical objects. I want to show a scenario in which, *for each of
them*, I play the method draw().

My hidden goal is to reason about the compliance of a such scenario
with respect to the Liskov substituibility principle, provided the OCL
specifications for the Shape hierarchy classes. (Shape is only an
example). It is possible to reason about this issue even only at
textual level, considering the class diagram for class definitions,
and the OCL specifications as class contracts. But considering that
LSP describes (indirectly) a dynamic scenario, I would expect to see
also some sort of sequence diagrams to describe this situation, so I
am reasoning about the sequence diagram's expressive power.


Dr. Andrea Baruzzo
Laboratorio di Intelligenza Artificiale
Room SSSH, 2nd floor, Stecca Sud
UniversitÓ degli Studi di Udine,
Via delle Scienze 206, 33100 Udine
Office: +39 0432 558435
Received on Wed 18 Oct 2006 - 17:09:47 BST