Re: UML: Associations between classes and packages



Robert C. Martin wrote:
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

Well, thanks! I'll do that.

--
Matthias Kaeppler
.



Relevant Pages

  • Re: Modeling a multilayer network with packages
    ... > I need assistance with UML modeling. ... Topological elements within each package are ... Subsystem as a specialization of Component rather than Package because ... The class interface defines the Signals the class will accept. ...
    (comp.object)
  • Re: UML: Associations between classes and packages
    ... >diagrams in UML. ... UML does not put a constraint upon this. ... >to the swing package. ... You drive the notation, don't let the notation drive you. ...
    (comp.object)
  • Re: Kernel source packages..
    ... Many thanks to David, NN_il_Confusion and martin for their suggestions, ... I'm still a bit of a newbie with the Debian package management stuff. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: how to load a set of 10000 xml files to a sql table?
    ... close the tasks and make sure non are selected, click package -> properties ... >> Martin, ... >> I have just written code for an ACTIVEX controled DTS that does exactly ... > Do you start the code with a ActiveX Control in a dts package as described ...
    (microsoft.public.sqlserver.xml)
  • Re: Bad update - X11 corrupted - dependency hell
    ... Martin Stone wrote: ... > Dick Brown wrote: ... >> there's another package that I need to install first? ...
    (Fedora)