SlideShare a Scribd company logo
1 of 27
UNIT I UML DIAGRAMS
Introduction to OOAD – Unified Process –
UML diagrams – Use Case – Class Diagrams–
Interaction Diagrams – State Diagrams –
Activity Diagrams –
Package, component and Deployment Diagrams.
Package Diagram
A diagram that shows packages of classes and
the dependencies among them
Introduction
– A UML construct that enables us to organize model elements, such as
classes, into groups.
– Namespace (i.e., all members should have unique names)
• Package diagram
– UML diagram which shows packages and dependencies b/w them.
• A dependency exists b/w 2 elements
.
Purpose of Package Diagram
• Create a package diagram to:
1. Depict a high-level overview of your requirements
2. Depict a high-level overview of your architecture/design
3. To logically modularize a complex diagram.
4. To organize programming source code.
• When to use a Package Diagram
– Used strictly for logical modularization
– When the application is very large
– Usually done in the design phase of a project
Notations - Package Representation
• Packages
– Represented as file folders
– Can contain other packages, creating hierarchy
Package org.hibernate
Members of the package may be shown
within the boundaries of the package
Package Types, some members
within the borders of the package
Package Representation
Members of the package may be
shown outside of the package
Notations - Element Visibility
• If an element that is owned by a package has visibility,
– It could be only public or private visibility.
(Protected or package visibility is not allowed)
• Visibility of a package element may be indicated by
– Preceding the name of the element by a visibility symbol
("+" for public and "-" for private)
All elements of Library Domain package
are public except for Account
Public elements of a package are always accessible
outside the package through the use of qualified names.
An element is owned by the package within which it is defined, but may be
referenced in other packages. In that case, the element name is qualified by
the package name using the pathname format PackageName::ElementName
Package Indication without Package Diagram
Relations
• Dependency
• Implementation
• Import / access
• Merge
Dependency
• Package A depends on package B
– if A contains a class which depends on a class in B
• Graphic representation:
There should be no cycles in the dependencies
Fish depends on water
Implementations
• Meaningful if multiple variants are present
• One element (client)
 Implements the behavior that the other element (supplier) specifies.
Importing
• Importing means accessing the elements of source by target.
• Importing grants a one-way permission
– For the elements in one package to access the elements in another
package.
• If A’s package imports B’s package,
– A can now see B, although B cannot see A.
Import / access
• To understand the import / access relation b/w packages
– We need to know how elements can reference each other
– What does an element import / access mean
– How this notion can be generalized to packages
Fully Qualified Name
• Fully qualified name:
– A globally unique identifier of a package, class, attribute, method.
• Fully qualified name is composed of
– Qualifier (all names in the hierarchic sequence above the given element) &
– The name of the given element itself
• Fully Qualified Name Notation in UML
p::A::foo
p::r::C
Element can refer to other elements
That are in its own package without using
fully qualified names
Element Import / Access
• Element import allows
– An element in another package to be referenced using its name without
a qualifier
– <<import>>
imported element within importing package is public
– <<access>>
imported element within importing package is private
Example on Element Import / Access
Public import of PageInfo element from Domain package.
Private import of SortInfo element from Domain package.
Example on Element Import / Access
Example on Element Import / Access
Example on Element Import / Access
Example on Element Import / Access
Package Import
• A package import is a directed relationship
– That identifies a package whose members are to be imported
• A Package Import relationship
– Drawn from a source Package to a Package whose contents are to be
imported.
Private members of a target Package (Package2) cannot be imported.
Visibility of a Package Import
• Visibility of a Package Import
– Could be either public or private.
• Keyword «access» is shown to indicate private visibility.
Private import of Presentation package
Public import of Domain package.
Package Merge
• A package merge is a directed relationship b/w 2 packages
– That indicates that content of one package is extended by the contents of
another package.
– i.e., contents of the two packages are to be combined.
• Package merge is similar to generalization
– Source element conceptually adds the ch.s of target element to its own ch.s
resulting in an element that combines the characteristics of both
Package Merge
• Package merge can be viewed as an operation
– That takes the contents of two packages and produces a new package
that combines the contents of the packages involved in the merge.
Example on Package Merge

More Related Content

What's hot

1. introduction to uml
1. introduction to uml1. introduction to uml
1. introduction to umlPRABU M
 
Data Designs (Software Engg.)
Data Designs (Software Engg.)Data Designs (Software Engg.)
Data Designs (Software Engg.)Arun Shukla
 
Component diagram
Component diagramComponent diagram
Component diagramAbdul Manan
 
Basic Structural Modeling
Basic Structural ModelingBasic Structural Modeling
Basic Structural ModelingAMITJain879
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignHaitham El-Ghareeb
 
Identifying classes and objects ooad
Identifying classes and objects ooadIdentifying classes and objects ooad
Identifying classes and objects ooadMelba Rosalind
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologiesAmith Tiwari
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationshipsPooja mittal
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbolsKumar
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGERaval Chirag
 
Use case Diagram
Use case Diagram Use case Diagram
Use case Diagram Rahul Pola
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software EngineeringManish Kumar
 
Component and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewComponent and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewRajiv Kumar
 

What's hot (20)

UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
1. introduction to uml
1. introduction to uml1. introduction to uml
1. introduction to uml
 
Ooad unit – 1 introduction
Ooad unit – 1 introductionOoad unit – 1 introduction
Ooad unit – 1 introduction
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
 
Data Designs (Software Engg.)
Data Designs (Software Engg.)Data Designs (Software Engg.)
Data Designs (Software Engg.)
 
Component diagram
Component diagramComponent diagram
Component diagram
 
Basic Structural Modeling
Basic Structural ModelingBasic Structural Modeling
Basic Structural Modeling
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Identifying classes and objects ooad
Identifying classes and objects ooadIdentifying classes and objects ooad
Identifying classes and objects ooad
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologies
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationships
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbols
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGE
 
Use case Diagram
Use case Diagram Use case Diagram
Use case Diagram
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software Engineering
 
Component and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewComponent and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief Overview
 
UML
UMLUML
UML
 

Similar to 09 package diagram (13)

package diagram.pptx
package diagram.pptxpackage diagram.pptx
package diagram.pptx
 
uml reference package_diagram
uml reference package_diagramuml reference package_diagram
uml reference package_diagram
 
Java packages oop
Java packages oopJava packages oop
Java packages oop
 
Packages in java
Packages in javaPackages in java
Packages in java
 
Package Diagram
Package DiagramPackage Diagram
Package Diagram
 
Unit-4 Day1.pptx
Unit-4 Day1.pptxUnit-4 Day1.pptx
Unit-4 Day1.pptx
 
Java package
Java packageJava package
Java package
 
Packages
PackagesPackages
Packages
 
Uml2
Uml2Uml2
Uml2
 
packages in java & c++
packages in java & c++packages in java & c++
packages in java & c++
 
Packages
PackagesPackages
Packages
 
Package scopeis the range of visibility for aparticular element or c.pdf
Package scopeis the range of visibility for aparticular element or c.pdfPackage scopeis the range of visibility for aparticular element or c.pdf
Package scopeis the range of visibility for aparticular element or c.pdf
 
Packages
PackagesPackages
Packages
 

More from Baskarkncet

02 well formed and valid documents
02 well formed and valid documents02 well formed and valid documents
02 well formed and valid documentsBaskarkncet
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structureBaskarkncet
 
11 deployment diagrams
11 deployment diagrams11 deployment diagrams
11 deployment diagramsBaskarkncet
 
10 component diagram
10 component diagram10 component diagram
10 component diagramBaskarkncet
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagramBaskarkncet
 
07 interaction diagrams
07 interaction diagrams07 interaction diagrams
07 interaction diagramsBaskarkncet
 
06 class diagrams
06 class diagrams06 class diagrams
06 class diagramsBaskarkncet
 
03 unified process
03 unified process03 unified process
03 unified processBaskarkncet
 

More from Baskarkncet (20)

Unit_I.pptx
Unit_I.pptxUnit_I.pptx
Unit_I.pptx
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Unit 1
Unit 1Unit 1
Unit 1
 
HCI
HCIHCI
HCI
 
03 x files
03 x files03 x files
03 x files
 
03 namespace
03 namespace03 namespace
03 namespace
 
02 xml schema
02 xml schema02 xml schema
02 xml schema
 
02 well formed and valid documents
02 well formed and valid documents02 well formed and valid documents
02 well formed and valid documents
 
00 introduction
00 introduction00 introduction
00 introduction
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
11 deployment diagrams
11 deployment diagrams11 deployment diagrams
11 deployment diagrams
 
10 component diagram
10 component diagram10 component diagram
10 component diagram
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagram
 
07 interaction diagrams
07 interaction diagrams07 interaction diagrams
07 interaction diagrams
 
06 class diagrams
06 class diagrams06 class diagrams
06 class diagrams
 
05 use case
05 use case05 use case
05 use case
 
03 unified process
03 unified process03 unified process
03 unified process
 
02 uml
02 uml02 uml
02 uml
 
04 uml diagrams
04 uml diagrams04 uml diagrams
04 uml diagrams
 
01 introduction
01 introduction01 introduction
01 introduction
 

Recently uploaded

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 

Recently uploaded (20)

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 

09 package diagram

  • 1. UNIT I UML DIAGRAMS Introduction to OOAD – Unified Process – UML diagrams – Use Case – Class Diagrams– Interaction Diagrams – State Diagrams – Activity Diagrams – Package, component and Deployment Diagrams.
  • 2. Package Diagram A diagram that shows packages of classes and the dependencies among them
  • 3. Introduction – A UML construct that enables us to organize model elements, such as classes, into groups. – Namespace (i.e., all members should have unique names) • Package diagram – UML diagram which shows packages and dependencies b/w them. • A dependency exists b/w 2 elements .
  • 4. Purpose of Package Diagram • Create a package diagram to: 1. Depict a high-level overview of your requirements 2. Depict a high-level overview of your architecture/design 3. To logically modularize a complex diagram. 4. To organize programming source code. • When to use a Package Diagram – Used strictly for logical modularization – When the application is very large – Usually done in the design phase of a project
  • 5. Notations - Package Representation • Packages – Represented as file folders – Can contain other packages, creating hierarchy Package org.hibernate Members of the package may be shown within the boundaries of the package Package Types, some members within the borders of the package
  • 6. Package Representation Members of the package may be shown outside of the package
  • 7. Notations - Element Visibility • If an element that is owned by a package has visibility, – It could be only public or private visibility. (Protected or package visibility is not allowed) • Visibility of a package element may be indicated by – Preceding the name of the element by a visibility symbol ("+" for public and "-" for private) All elements of Library Domain package are public except for Account Public elements of a package are always accessible outside the package through the use of qualified names.
  • 8. An element is owned by the package within which it is defined, but may be referenced in other packages. In that case, the element name is qualified by the package name using the pathname format PackageName::ElementName
  • 9. Package Indication without Package Diagram
  • 10.
  • 12. Dependency • Package A depends on package B – if A contains a class which depends on a class in B • Graphic representation: There should be no cycles in the dependencies Fish depends on water
  • 13. Implementations • Meaningful if multiple variants are present • One element (client)  Implements the behavior that the other element (supplier) specifies.
  • 14. Importing • Importing means accessing the elements of source by target. • Importing grants a one-way permission – For the elements in one package to access the elements in another package. • If A’s package imports B’s package, – A can now see B, although B cannot see A.
  • 15. Import / access • To understand the import / access relation b/w packages – We need to know how elements can reference each other – What does an element import / access mean – How this notion can be generalized to packages
  • 16. Fully Qualified Name • Fully qualified name: – A globally unique identifier of a package, class, attribute, method. • Fully qualified name is composed of – Qualifier (all names in the hierarchic sequence above the given element) & – The name of the given element itself • Fully Qualified Name Notation in UML p::A::foo p::r::C Element can refer to other elements That are in its own package without using fully qualified names
  • 17. Element Import / Access • Element import allows – An element in another package to be referenced using its name without a qualifier – <<import>> imported element within importing package is public – <<access>> imported element within importing package is private
  • 18. Example on Element Import / Access Public import of PageInfo element from Domain package. Private import of SortInfo element from Domain package.
  • 19. Example on Element Import / Access
  • 20. Example on Element Import / Access
  • 21. Example on Element Import / Access
  • 22. Example on Element Import / Access
  • 23. Package Import • A package import is a directed relationship – That identifies a package whose members are to be imported • A Package Import relationship – Drawn from a source Package to a Package whose contents are to be imported. Private members of a target Package (Package2) cannot be imported.
  • 24. Visibility of a Package Import • Visibility of a Package Import – Could be either public or private. • Keyword «access» is shown to indicate private visibility. Private import of Presentation package Public import of Domain package.
  • 25. Package Merge • A package merge is a directed relationship b/w 2 packages – That indicates that content of one package is extended by the contents of another package. – i.e., contents of the two packages are to be combined. • Package merge is similar to generalization – Source element conceptually adds the ch.s of target element to its own ch.s resulting in an element that combines the characteristics of both
  • 26. Package Merge • Package merge can be viewed as an operation – That takes the contents of two packages and produces a new package that combines the contents of the packages involved in the merge.