Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: henrikbe on August 27, 2010, 06:25:30 pm

Title: Two questions about get and set functions
Post by: henrikbe 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
Title: Re: Two questions about get and set functions
Post by: Geert Bellekens on August 27, 2010, 07:48:07 pm
Henrik,

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

Geert
Title: Re: Two questions about get and set functions
Post by: Eve 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.
Title: Re: Two questions about get and set functions
Post by: henrikbe 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
Title: Re: Two questions about get and set functions
Post by: Eve on September 02, 2010, 08:25:50 am
Have you thought of searching our help file?