Book a Demo

Author Topic: Code Generation  (Read 3395 times)

RickLaird

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Code Generation
« on: April 14, 2004, 10:12:00 am »
I testing the code generation mechanism in EA and have a question.

When I make a change to an operation's signature why does EA not update the operation I have changed?  What I see is that EA generates a new operation in the source code instead of updating the one I have changed.  And if I delete an operation in the model and then go through code generation why is the deletion of the operation in reflected in the code?  It means I have to go and manually clean out the code.  If I do not clean out the code and do a Synchronize Model the old operation is now back in the model.

Can someone help me better understand the process of Code generation in EA.

Thanks
Rick Laird

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Code Generation
« Reply #1 on: April 14, 2004, 03:49:39 pm »
Rick,

Think of it this way - EA is primarily a modelling tool not a code generator.  

Because of its great support for reverse engineering it treats the code as the truth and will only update it if you force it to do so - by setting the "overwrite existing source" flag in the forward engineering options.

Of course this means that any procedural code in the source file will be clobbered.  

Bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Barry_Pearce

  • EA User
  • **
  • Posts: 70
  • Karma: +0/-0
    • View Profile
Re: Code Generation
« Reply #2 on: June 24, 2004, 04:33:00 pm »
This is an interesting point.

Personally I only advocate forwards engineering and therefore the model is the truth - the code is merely the model + embellishments (known in the trade as code-that does-stuff).

Maybe we need a option to change the view point ;)

Christiaan

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Code Generation
« Reply #3 on: June 28, 2004, 09:21:24 am »
There are a lot of feature requests regarding code generation (inlcluding mine;) and hopefully sparx will implement them. Thinking EA is primarily a modeling tool and not a code generator does not solve much of your problems as a software engineer. If you want to be a productive modelliing tool in the software development process, code synchronization is a must.

regards,
Christiaan