Hi folks,
This is a thread from rose_forum but it was general enough
to cross-post to OTUG. Please, when replying, try to keep
it to OTUG <[EMAIL PROTECTED]>.
"Angay, Huseyin (Huseyin)** CTR **" wrote:
> > >
> > > (3) You are illustrating a pattern:
> > > That's the hard bit. You need to show both the interface and its
> > > implementation. I got round this until now by showing the implementing
> > > class's instance and a note saying that it implements an interface. I
> > > welcome a better suggestion.
> >
> > What about my suggestion above?
> >
> It's fine for showing who does what, but will not illustrate why things are
> happening that way.
> One of the most important elements of a design pattern is the clever use of
> polymorphism and interfaces. When you strip those out, you end up showing
> the implementation but you don't capture why that implementation really
> works well.
> The solution that I apply uses the same principle as yours. You rely on the
> name, I rely on a note. Both solutions get close, but I don't think they
> illustrate the point well enough.
> As an example, try illustrating the Template pattern (parent class dictates
> the sequencing of operations that produce the overall result; the subclasses
> implement the specific variations for the operations): if you know the
> pattern, the diagram's pretty straightforward to follow and understand; if
> you don't know it, you are not any more enlightened than before.
> Things get even hairier with patterns like Strategy that rely purely on
> polymorphism. THere is no code in the parent class (so you can't even show
> the parent).
>
> Anyway, that last point's probably more theoretical than real. Most patterns
> need further explanation in text somehow.
Definitely. Our workgroup studied the GOF patterns and we decided
that the "traceability" (which pattern is instantiated) was through
naming and a file header comment.
However, it is a general problem people including myself have when
it comes to abstract base classes and sequence diagrams. I think
there is no simple solution.
An idea sprung to my mind, to extend the sequence diagram like
this:
__________ ____________________ _________________
| c:Caller | | <<abstract>>MyBase |<|-----| a:MyImplementor |
---------- -------------------- -----------------
| | |
|------------------->+-------------------------->|
| | |---....does something
| | |
| | |
| | |
The key is the generalization symbol between object (ouch!)
and type and that the message goes to MyBase but then
immediately to "a".
The problem is that MyBase is a type and not an instance.
I don't know if it has been discussed before, but it would
illustrate our point(s), wouldn't it? Hopefully there is a
more semantically correct solution, but what we want is to
show both type and instance on the same diagram.
/Peter
--
Peter Lindgren Bachelor of Computer Engineering
ERIEYE C2 Software Design http://www.ericsson.com/erisoft
Get your own AWACS: http://www.ericsson.se/microwave/2-Products/erieye.asp
--- Opinions above, expressed or implicit, are my personal opinons only ---
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************