Author Topic: Programming with EA  (Read 3794 times)

nfactorial

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Programming with EA
« on: September 12, 2003, 12:33:37 pm »
I'm new to both EA and UML so I'm not sure if this is actually a part of the intended responsibilities,
I'd like to associate source code with a method inside EA and have EA output the source code in the
implementation. I tried putting source code inside the 'Behaviour' section of the operation properties
dialog but it never appeared during sourcecode generation (I guess I'm trying to do something that
isn't a part of the applications domain?).

n!

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: Programming with EA
« Reply #1 on: September 30, 2003, 11:32:07 pm »
Hi n!

The behaviour field is really intended to provide some comments within the body of the function on intial generation.  Code and comments within function bodies however, is not currently reversed or synchronized by EA.

If you are only interesting in forward generating initial code stubs, you could "bend" the behaviour field to your purpose.  Override the default code generation template for OperationBody change the following lines:

$behaviour = %WRAP_COMMENT(opBehaviour, "40", "\t", "//")%
%if $behaviour != ""%
$behaviour\n\n
%endIf%

to

%opBehaviour%

Now it will just dump the behaviour field directly between the curly braces. (Refer to the help file for more details on modifying code generation templates)

Note: EA currently ignores function bodies- so you won't be able to change the behaviour field in EA and have it update in the source file and vice versa.

Regards,
Ben