Re: UML: Associations between classes and packages
- From: Matthias Kaeppler <nospam@xxxxxxxxxxxxxxx>
- Date: Tue, 24 May 2005 06:40:07 +0200
H. S. Lahman wrote:
Responding to Kaeppler...
I was wondering in how far it is allowed to mix class and package diagrams in UML.
Classes and packages in an OO context using UML are used for rather different things. Packages are usually employed to describe configuration management issues (e.g., which model elements -- like classes -- belong to which releases). Classes, OTOH, have problem space semantics for the solution.
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.
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.
Is that legal? And if so, what kind of line notation do I have to use, a simple dotted line?
I don't use Java, so I can't comment specifically. However, since JFrame seems to be a realize infrastructure I would guess the best way to represent it would be as an architectural subsystem using the <<subsystem>> stereotype. That effectively encapsulates it as a single Component with an interface and attributes that the other classes can access. (In UML the <<subsystem>> is defined as a stereotype of Component, which, in turn, is derived from Class.)
************* There is nothing wrong with me that could not be cured by a capful of Drano.
H. S. Lahman hsl@xxxxxxxxxxxxxxxxx Pathfinder Solutions -- Put MDA to Work http://www.pathfindermda.com blog: http://pathfinderpeople.blogs.com/hslahman (888)OOA-PATH
That means I would have to introduce JFrame as a class?
The problem is, that someone could argue I would then also have to introduce Object (in Java it's the implicit base class of all classes) for the sake of completeness and I will soon find myself remodelling half of the Java platform.
That's why I asked, whether it's a good idea in general to model classes of the platform or not.
-- Matthias Kaeppler .
- Follow-Ups:
- Re: UML: Associations between classes and packages
- From: H. S. Lahman
- Re: UML: Associations between classes and packages
- References:
- UML: Associations between classes and packages
- From: Matthias Kaeppler
- Re: UML: Associations between classes and packages
- From: H. S. Lahman
- UML: Associations between classes and packages
- Prev by Date: LASER 2005 Summer School - Software engineering for concurrent and real-time systems
- Next by Date: Re: J2EE Patterns: How many Controller(s), Dispatcher(s) to use with Composite View?
- Previous by thread: Re: UML: Associations between classes and packages
- Next by thread: Re: UML: Associations between classes and packages
- Index(es):
Relevant Pages
|