Re: UML: Associations between classes and packages



On Sun, 22 May 2005 14:00:46 +0200, Matthias Kaeppler
<nospam@xxxxxxxxxxxxxxx> wrote:

>Hi,
>
>I was wondering in how far it is allowed to mix class and package
>diagrams in UML.

You have my permission to mix them as much as is necessary to get your
point ac cross.

UML does not put a constraint upon this. Nor should it.
>
>Example:
>Say I have a class which inherits from javax.swing.JFrame. It would be
>stupid to introduce the class JFrame with its huge interface into the
>model, since it's part of the platform anyway.

Don't confuse UML with the tools that draw it. If a tool makes it
inconvenient to do something that you would like to do, you should
reconsider the tool.

>But somehow I have to model the relationship between my custom Frame
>class and JFrame, so I thought I'd just draw a dependency from my class
>to the swing package. But the I'd have both classes and packages
>together in one diagram.

That's allowable.

>Is that legal? And if so, what kind of line notation do I have to use, a
>simple dotted line?

Sure. Or create a stereotype on the dependency
<<class-to-package dependency>>

You drive the notation, don't let the notation drive you.



-----
Robert C. Martin (Uncle Bob) | email: unclebob@xxxxxxxxxxxxxxxx
Object Mentor Inc. | blog: www.butunclebob.com
The Agile Transition Experts | web: www.objectmentor.com
800-338-6716


"The aim of science is not to open the door to infinite wisdom,
but to set a limit to infinite error."
-- Bertolt Brecht, Life of Galileo
.



Relevant Pages

  • Re: UML Question (Object <-> ObjectFinder?)
    ... ER diagrams, Data flow diagrams, and ... The official notation for SM today is a subset ... It doesn't even use any stereotypes that aren't defined in UML. ... >> So long as the subclasses are substitutable, ...
    (comp.object)
  • Re: Humble opinion on UML
    ... I am not a real developer, but I use it sporadically since 1998 and I ... Even if one decides to employ OO techniques for a small application, it is even less likely that UML would be worthwhile for anything other that informal communication or sketching out design ideas. ... Activity Diagrams have been largely replaced by Abstract Action Languages because they are much easier to modify. ...
    (comp.object)
  • Re: Is UML appropriate for embedded systems ?
    ... Sequence diagrams are a good help in specifying ... The company I work for uses Rose for smartcard operating systems (a few ... The use of UML for our purpose is not obvious. ... usecases, but IMHO not for OSes or VMs ...
    (comp.arch.embedded)
  • Re: UML: Is it allowed to introduce custom stereotypes on classes? What about methods?
    ... >{enumeration} after the class name. ... I know UML knows such things as, ... >modelling methods as abstract or even static, ... understand these diagrams, understands the diagrams. ...
    (comp.object)
  • Re: Class Design Tools?
    ... you draw diagrams of your code ... light understanding of UML class diagrams. ... I do not answer questions on behalf of my employer. ... >> programmer helping programmers. ...
    (microsoft.public.dotnet.general)