Book a Demo

Author Topic: Attribute as reference and multiplicity  (Read 6189 times)

Rogier van Stapele

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Attribute as reference and multiplicity
« on: December 10, 2006, 02:28:01 pm »
If an attribute of a class is defined as "By Reference" and it has a multiplicity, how should it be implemented?

Is it an array of pointers or is it a pointer to an array?

thomaskilian

  • Guest
Re: Attribute as reference and multiplicity
« Reply #1 on: December 10, 2006, 02:33:58 pm »
Just from my stomach I'd say pointer to array as it is one association to a multiplicity. Else you would need to draw multiple assocs for the array of pointers. YMMV

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Attribute as reference and multiplicity
« Reply #2 on: December 10, 2006, 04:17:31 pm »
My preference would be that the "By Reference" applies to each element of the collection (where an array is a collection type) rather than to the collection itself.

Rogier van Stapele

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Attribute as reference and multiplicity
« Reply #3 on: December 11, 2006, 01:19:24 pm »
Personally I agree with Simon that it means a collection of pointers. The datatype is basically a pointer, with multiplicity as an additional specification.

But how would I specify a reference to an array in EA?

sl@sh

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Attribute as reference and multiplicity
« Reply #4 on: February 02, 2007, 04:09:07 am »
A bit late to respond, but I only just joined this forum, and would be interested in an answer myself.

My first idea would be to assign a multiplicity of 0..1 to the source end of the relation, but I'm not sure this would always work - the reference might be mandatory after all...
« Last Edit: February 02, 2007, 04:09:29 am by sl@sh »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Attribute as reference and multiplicity
« Reply #5 on: February 02, 2007, 05:06:46 am »
Quote
Personally I agree with Simon that it means a collection of pointers. The datatype is basically a pointer, with multiplicity as an additional specification.
I agree
Quote
But how would I specify a reference to an array in EA?
Create a code snippet and reverse engineer it...

That's a good indication... ;)

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