Book a Demo

Author Topic: How to create a Class Diagram  (Read 25391 times)

tantra

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
How to create a Class Diagram
« on: May 30, 2010, 01:24:49 am »
I'm beginner in this field.




I have build the class diagram, but I'm so confuse with PRIORITY ( I need to put priority 1 to 5).
Can you suggest to me anytihing else



thnx for help...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to create a Class Diagram
« Reply #1 on: May 31, 2010, 03:58:25 pm »
You will need an enumeration for Priority, and use that as the type of your attribute Contract.priority
The enumeration Priority should then contain the values 1-5 (without a type)


Geert

tantra

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: How to create a Class Diagram
« Reply #2 on: June 01, 2010, 08:47:07 am »
Hi Geert,

I've set priority, the priority is the value at 1-5, can you tell me specifically what to do.

Thank you for helping me
« Last Edit: June 01, 2010, 09:07:35 am by Tantra »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How to create a Class Diagram
« Reply #3 on: June 01, 2010, 08:58:47 am »
Quote
I don't know where lies Contract.priority because I am new in UML (am learning), can you tell me where is located Contract.priority, lacking only a priority from 1 to 5 the application is or should rule the other thing
In your class "Contract" you have an attribute "priority: int". That should be "priority: Priority".
The Sparx Team
[email protected]

tantra

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: How to create a Class Diagram
« Reply #4 on: June 01, 2010, 09:50:58 am »
Hi, now is it OK?


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to create a Class Diagram
« Reply #5 on: June 01, 2010, 12:55:50 pm »
No,

The class Priority should be an enumeration.
Look in the toolbox. There should be an icon for enumeration.
Drag that onto your class diagram and add the values 1-5 via the attributes.

Geert

tantra

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: How to create a Class Diagram
« Reply #6 on: June 01, 2010, 08:05:47 pm »
Quote
No,

The class Priority should be an enumeration.
Look in the toolbox. There should be an icon for enumeration.
Drag that onto your class diagram and add the values 1-5 via the attributes.

Geert


Hi,
Now is it OK?


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to create a Class Diagram
« Reply #7 on: June 01, 2010, 08:48:54 pm »
No, you now have a class with the name "enumeration".
You need an enumeration with the name "Priority".

Please lookup "enumeration" in your UML book/course (or even in the EA help file)

Geert

metamorphium

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: How to create a Class Diagram
« Reply #8 on: June 01, 2010, 09:16:34 pm »
you'll want to do something like this:



You'll also want to name your enum more reasonably. :) Like "Low, Medium, High" instead of "Priority1" etc. :)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to create a Class Diagram
« Reply #9 on: June 01, 2010, 09:55:40 pm »
Typically you wouldn't add a type to your enumeration literals.
So you would have attributes with priority1 as name, but without a type.
The fact that you can assign something like an integer to an enumeration value is a programming construct, but not supported in UML.

Geert

metamorphium

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: How to create a Class Diagram
« Reply #10 on: June 01, 2010, 10:03:37 pm »
However the EA documentation speaks otherwise:

http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/addingenumerationstagstost.htm

Or am I gettin something wrong?

beginner

  • Guest
Re: How to create a Class Diagram
« Reply #11 on: June 01, 2010, 10:14:21 pm »
The ordinal value for the enum is typically supplied by the compiler (much later then). It might start from 0 or 1. But you're free to add numbers if you so wish.

b.

P.S. What is this here? An UML lecture? To the thread creator: go and do your homework first...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to create a Class Diagram
« Reply #12 on: June 01, 2010, 10:47:07 pm »
Quote
P.S. What is this here? An UML lecture? To the thread creator: go and do your homework first...

What do you think she is trying to do ;D

Geert

tantra

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: How to create a Class Diagram
« Reply #13 on: June 01, 2010, 11:03:34 pm »
I build this diagram, can you tell me exactly what I do for the diagram be OK?




Thank you for helping me

beginner

  • Guest
Re: How to create a Class Diagram
« Reply #14 on: June 02, 2010, 05:07:55 am »
Read the requirements detailed in your specification. Do you think that all of the are fulfilled? I don't.

b.