the differences between component diagram and package diagram
Asked Answered
E

3

18

What is the differences between component diagram and package diagram?

I use Papyrus for system modeling

Edifice answered 11/12, 2012 at 20:28 Comment(0)
C
17

Component diagram typically employed to illustrate interfaces. So a component might be a class or it might be a collection of classes.

A package diagram is a mechanism for you to group together related UML items, think of it as acting like (file system) directory/folder for UML.

Chessa answered 12/12, 2012 at 6:16 Comment(3)
thank you @Chessa for clarification .in the case of component diagram does this mean that the interface represent the operation of class if we consider the component as a class?Edifice
Yes, an interface could be single class or collection of classes. Whatever you need to make a clear point.Chessa
thank you Mr. @Chessa you can say an interface could be a single abstract class or collection of abstract classes?Edifice
A
6

I reference Michael Feathers the author of "Working Effectively with Legacy Code" (Prentice Hall 2005)

In UML, components are groups of classes that are deployed together and packages are a general grouping device for model elements. Packages can group any model elements, even things like use cases, but in practice they usually group classes, so components and packages tend to be synonymous.

From a forum posting

Antihalation answered 13/11, 2015 at 1:33 Comment(0)
N
2

Component diagram shows an encapsulated class and its interfaces, ports and internal structure consisting of nested components and connectors. It addresses the static design implementation view of a system.

Package diagram shows the decomposition of model itself into organizational units and their dependencies.

from UML 2 User Guide

Packages are grouping things. Components are replaceable parts of system. Usually packages are identified in the analysis model and components in design model. Component diagrams are used in component based development

Nowhere answered 8/10, 2014 at 7:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.