0% found this document useful (0 votes)
96 views8 pages

Package Diagrams: Massimo Felici Room 1402, JCMB, KB 0131 650 5899 Mfelici@inf - Ed.ac - Uk

Package design needs to balance diverse needs Easier to build and test Better tracking and property transparency Working at a stable overview without the noise of low-level details Less conflict between distributed teams Easy refactoring and extension Vulnerable to changes (in other packages) 2004-2006 SEOC - Lecture Note 08 4 Importing and Accessing Packages Creates relationships between classes of the same name merge is a directed relationship

Uploaded by

api-26462544
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views8 pages

Package Diagrams: Massimo Felici Room 1402, JCMB, KB 0131 650 5899 Mfelici@inf - Ed.ac - Uk

Package design needs to balance diverse needs Easier to build and test Better tracking and property transparency Working at a stable overview without the noise of low-level details Less conflict between distributed teams Easy refactoring and extension Vulnerable to changes (in other packages) 2004-2006 SEOC - Lecture Note 08 4 Importing and Accessing Packages Creates relationships between classes of the same name merge is a directed relationship

Uploaded by

api-26462544
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Package Diagrams

Massimo Felici
Room 1402, JCMB, KB
0131 650 5899
mfelici@inf.ed.ac.uk
Rationale
ƒ Provide a way to group ƒ Package design needs to
related UML elements balance diverse needs
and to scope their • Easier to build and test
names • Better tracking and
property transparency
ƒ Provide a way to • Working at a stable
visualize dependencies overview without the
between parts of your noise of low-level details
system • Less conflict between
• Vulnerable to changes (in distributed teams
other packages) • Easy refactoring and
ƒ Provide support for extension
analysis
ƒ Determine compilation
order

© 2004-2006 SEOC - Lecture Note 08 2


Representation of Packages
ƒ Packages contain different
elements (packages too)
ƒ A UML package establishes a
namespace
• To specify the context of a
UML, you provide the fully-
scoped name
• packageName::className
• In Java, a fully-scoped name
corresponds to specify the
Java package
ƒ It is possible to specify
visibility for owned and
imported elements
• public or private
• No elements – no
assumptions about the
package’s content

© 2004-2006 SEOC - Lecture Note 08 3


Element Visibility
ƒ Elements with public visibility are accessible
outside the package
ƒ Elements with private visibility are available
only to other elements inside the package
ƒ In Java, public and private visibilities
correspond to a class being public or private
to a Java package
ƒ If the public keyword is absent, then the
class is private to the package

© 2004-2006 SEOC - Lecture Note 08 4


Importing and Accessing Packages
ƒ <<import>>: Elements
of imported packages Target Packages
are available without
qualification in the
importing package
• public visibility
• private visibility
• Import specific elements,
rather than the whole
package
ƒ <<access>>:Accessing
packages whereas gives
private visibility to the
imported elements

© 2004-2006 SEOC - Lecture Note 08 5


Merging Packages
ƒ Creates relationships between classes of the same
name
ƒ Merge is a directed relationship
ƒ Rationale: the evolution from UML 1.x to UML 2.0 -
extending a base concept of elements without
renaming
ƒ Some Rules for package merge
• Private members are not merged
• Merging classes are generalized to corresponding merged
ones
• Maintain package scope for reference to classes
• Classes outside the intersection of packages are unchanged
• Subpackages are added, if they don’t exist
• Merge extends to subpachages with the same names
• Merge acquires imported elements

© 2004-2006 SEOC - Lecture Note 08 6


Package Dependencies
ƒ Structuring a Project with
Packages
ƒ Packages group UML
elements and organize a
logical system during design
and implementation
ƒ Manage Dependencies
• Directed dependency graphs
• Avoid cyclical package
dependencies
• Organize and allocate
project work to different
teams - Different groups
can work on different
packages without
destabilizing each other

© 2004-2006 SEOC - Lecture Note 08 7


Use Case Packages
ƒ Using packages to
organize use cases
ƒ Organize the functional
behavior of a system
ƒ Highlight which actors
interact with which
portions of the system

© 2004-2006 SEOC - Lecture Note 08 8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy