Book a Demo

Author Topic: Class Diagram: Class Collection  (Read 2717 times)

insight974

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Class Diagram: Class Collection
« on: November 06, 2008, 07:50:15 am »
Hello everyone! I am pretty new to the product. I have a question, let's say that I have a class "Book", and of course the collection class Books. Ho do you represent the collections here. ANd how do you represent the property that gets the collection itself? Any help will be greatly appreciated.

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Class Diagram: Class Collection
« Reply #1 on: November 06, 2008, 11:10:28 pm »
Hi'ya....  Drag an association from the collection to the item, give the Item role end a name and change the multiplicity to many.  As shown below.




Does that solve the problem.

Kevin [smiley=happy.gif]

insight974

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Class Diagram: Class Collection
« Reply #2 on: November 06, 2008, 11:36:47 pm »
Hi!!
Thanks for your reponse. So, I was doing it correctly. THe issue came when I saw the EA example where they have both the item and the collection in only one square. I was wondering if that is a better way to do it.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Class Diagram: Class Collection
« Reply #3 on: November 06, 2008, 11:49:43 pm »
If you want to use a single 'square' to show everything, try...

Set the multiplicity of the attribute to show it as a collection (at least visibly). After saving the attribute click the Advanced - I think that's the correct name; I don't have EA on this machine - and set it to be a collection (with appropriate properties) using the dialog.

HTH, David
No, you can't have it!