Book a Demo

Author Topic: Package diagrams Vs Class Diagrams  (Read 11333 times)

umlinfo

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Package diagrams Vs Class Diagrams
« on: April 03, 2007, 03:11:21 pm »
Hi,
 I am new to UML and trying to design my ptoject using EA. Can someone tell me how a class diagram is different from a package diagram ? The elements in my design will be mainly classes and enumerations.
Thanks.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Package diagrams Vs Class Diagrams
« Reply #1 on: April 03, 2007, 04:58:27 pm »
What part of the EA Help (under "UML Diagrams") is unclear about the two types of UML diagram?

Paolo

Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

umlinfo

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Package diagrams Vs Class Diagrams
« Reply #2 on: April 03, 2007, 05:32:52 pm »
Both Class and Package diagrams have the same diagram elements and diagram connectors. Say, I create a package diagram with 10 classes, how is this diffrent from creating a class diagram with the same 10 classes?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Package diagrams Vs Class Diagrams
« Reply #3 on: April 03, 2007, 06:09:49 pm »
Did you read the Help?  Notwithstanding that the same elements may be applied, their purpose is different...

Do you understand that?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

umlinfo

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Package diagrams Vs Class Diagrams
« Reply #4 on: April 04, 2007, 04:28:03 am »
Thanks for the reply again. If I directly define my classes in a package diagram, is it same as a class diagram? Is a package diagram meaningful only on the top level of the design or is it a totally different view of the design (different from the class diagram view of the project) If they are different, how are they different?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Package diagrams Vs Class Diagrams
« Reply #5 on: April 04, 2007, 04:39:56 am »
Quote
Thanks for the reply again. If I directly define my classes in a package diagram, is it same as a class diagram? Is a package diagram meaningful only on the top level of the design or is it a totally different view of the design (different from the class diagram view of the project) If they are different, how are they different?
You define your classes in the repository, not the diagram.  With very few limitations, you can place any model element (in the broswer) onto any type of diagram.

Package Diagrams (not unnaturally - and as the Help says) are used to reflect the organization of packages and their elements, and provide a visualization of their corresponding namespaces.  So they have Package elements on them.

Class Diagrams (not unnaturally - and as the Help says) illustrate relationships between classes and interfaces.  So they have Class and Interface elements on them.

Sounds pretty straight forward to me...  If you still have questions - keep asking.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: Package diagrams Vs Class Diagrams
« Reply #6 on: April 06, 2007, 10:45:29 pm »
And something form UML Superstructure Specification 2.1.1:

Class diagram
The following nodes and edges are typically drawn in a class diagram:
• Association
• Aggregation
• Class
• Composition
• Dependency
• Generalization
• Interface
• InterfaceRealization
• Realization
Package diagram
The following nodes and edges are typically drawn in a package diagram:
• Dependency
• Package
• PackageExtension
• PackageImport

Just note the word typically.
Jan 'Bary' Glas

M1ke

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Package diagrams Vs Class Diagrams
« Reply #7 on: April 08, 2007, 12:07:55 pm »
It doesn't really matter if you create a class diagram with 10 classes or a package diagram, the resulting model elements are the same. The difference is that a package diagram is better suited when you want a higher level of abstraction or don't want to show unnecessary detail.

Mike

umlinfo

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Package diagrams Vs Class Diagrams
« Reply #8 on: April 09, 2007, 05:58:22 am »
I got the answer now....Thanks everyone .