Book a Demo

Author Topic: Couple of Newbie questions on code generation  (Read 2401 times)

scruffyduck

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Couple of Newbie questions on code generation
« on: August 14, 2005, 11:12:57 am »
Hi All

I am new to EA and have been evaluating over the past couple of days.  I mainly develop in VB.NET.  I have a couple of questions - please excuse me if they are very newbie  :)

I am testing based on a new application - firstly when I generate code for a class which I have designated as an interface the code generated is for a must inherit class rather than an interface definition. I am using the interface stereotype and defining the class as virtual so I may be doing the wrong thing anyway.

Also I noticed in the code editor that it refers to overrides etc related to opTag.  Are code templates only for reverse engineering?  if not how would I specify an overrideable function or method in the model?

thanks in advance

Jon
« Last Edit: August 14, 2005, 11:13:25 am by scruffyduck »
Jon

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Couple of Newbie questions on code generation
« Reply #1 on: August 14, 2005, 03:38:16 pm »
You'll need to use the Interface Element as opposed to the class element with the stereotype of interface.  They are different things and the code templates expect an interface element and will ignore the stereotype.

Code Templates are actually only for forward engineering.  To specify an overrideable function, select it and open the tagged values window.  Click the button to add a new tag.  Set the Tag (name) to "Overrideable" and the value to "true".

Simon

scruffyduck

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Couple of Newbie questions on code generation
« Reply #2 on: August 14, 2005, 11:27:44 pm »
Thanks Simon

That has sorted out the interface but I am not sure I am doing the right thing with tags.  

There seems to be no way to specify a tag for a specific operation and I tried adding the tag 'Overrides' with the value True and regeneratingthe code - nothing happens.

Is it possible to assign such a tag to an individual operation? and what amd I still doing wrong

Thanks in advance

Edit:  OK I am half way there - I have found out how to add a tag to an operation - am I correct that the code generator will only add the override keyword if the class IS inheriting from another class?

Edit2: I have found that I can specify these using the advanced button on the operation entry dialog



Jon
« Last Edit: August 15, 2005, 09:11:54 am by scruffyduck »
Jon