Book a Demo

Author Topic: Operations for Multi-Objects  (Read 2916 times)

DaveSykes

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Operations for Multi-Objects
« on: December 04, 2003, 02:16:30 pm »
I am currently evaluating EA, and am trying to find a way to have a message on a collaboration diagram being sent to a multi-object. For example, a find(id) message that would return the instance in the multi-object collection that matches id. I can only see a way of sending a message to an individual instance. I cannot also see a way of adding in a multiplicity marker (* :) on to the message to say send the message to all of the items in the collection. Am I missing something, or is this functionality not available yet, it looks like from searching this forum that multi-object has only just been added.

Thanks

Dave Sykes

jps

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Operations for Multi-Objects
« Reply #1 on: December 05, 2003, 09:08:15 am »
Dave,

Assuming you have the two objects on your collaboration diagram:

1. On the object you want to be the collection, right-click and choose Multi-Object (I know, it looks like you already figured this out).
2. Create an association/link between your sender and the receiver (collection/Multi-Object).
3. Right-click the association/link and choose Association Properties.
4. On the Target Role tab set the multiplicity to the desired multiplicity (* for the entire collection of course).
5. Click Ok to close the dialog.
6. Right-click the association and choose Add message from :Sender to :Receiver.
7. Enter find() for the Message and id for the Parameters.
8. Choose the check-box labeled Is Iteration.
9. Click Ok to close the dialog.

Hopefully this is everything you were looking for.

Cheers! :)

James

DaveSykes

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Operations for Multi-Objects
« Reply #2 on: December 06, 2003, 01:45:52 pm »
James,

Thanks for the reply, I'll give this a go, and see how it works. It looks correct on the diagram, but I'm not sure how it looks in the generated code yet.

Thanks

Dave Sykes