Book a Demo

Author Topic: Accessors for associations with no multiplicity  (Read 3669 times)

Yves.

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Accessors for associations with no multiplicity
« on: November 13, 2008, 09:24:22 am »
When generating Java code from a model using associations with TargetRole set and "1" multiplicity, the resulting code is equivalent to an attribute having the type of the association's target class along with the TargetRole used as the attribute name. But, my current understanding is that only property type attributes will generate proper accessors. Is there a mean to tell the code generator to gererate the accessors for such association generated attributes?
Thanks,

Yves.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Accessors for associations with no multiplicit
« Reply #1 on: November 13, 2008, 02:25:49 pm »
A transform can generate accessors.  Other than that, the only accessor generated by EA are when pressing the 'Property' checkbox on the attributes dialog.

Yves.

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Accessors for associations with no multiplicit
« Reply #2 on: November 14, 2008, 02:34:01 am »
Thanks Simon,

So, I understand that such a Transform has not been developped by Sparx so far. Right? If so, any plan to do so since it seems to me that this is a rather common requirement when generating code?

Thanks,
Yves.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Accessors for associations with no multiplicit
« Reply #3 on: November 14, 2008, 09:01:25 am »
No, EA has a built in transform for Java.