Book a Demo

Author Topic: Two questions about get and set functions  (Read 3411 times)

henrikbe

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Two questions about get and set functions
« on: August 27, 2010, 06:25:30 pm »
Hi,

say I have a class containing a (private) attribute "value". By checking the "Propery" checkbox, EA can automatically create functions getvalue() and setvalue(v).

Simplest questions first: Can I instruct EA to capitalize the attribute name in these functions? I prefer "getValue()" over "getvalue()"...

Another question: Can EA create similar function for associations? Say I have a class A with a (private) 1:1 association to a class B, can EA give me a function "getB()" in A?

Henrik

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Two questions about get and set functions
« Reply #1 on: August 27, 2010, 07:48:07 pm »
Henrik,

You can edit the code generation templates via Settings|Code Generation Templates

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Two questions about get and set functions
« Reply #2 on: August 30, 2010, 08:40:36 am »
Tools | Options | Source Code Engineering | Capitalized Attribute Name for Properties.

If you want the same thing for associations you'll have to use a transformation.
« Last Edit: August 30, 2010, 08:41:12 am by simonm »

henrikbe

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Two questions about get and set functions
« Reply #3 on: September 01, 2010, 08:34:14 pm »
Quote
Tools | Options | Source Code Engineering | Capitalized Attribute Name for Properties.

If you want the same thing for associations you'll have to use a transformation.

OK,

thank you for your reply. As a complete newbie, I don't even know what a transformation is. Is there anything like a tutorial on how to do this anywhere on the web?

Henrik

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Two questions about get and set functions
« Reply #4 on: September 02, 2010, 08:25:50 am »
Have you thought of searching our help file?