Book a Demo

Author Topic: Prevent generation of non abstract fields  (Read 2673 times)

chilescot

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Prevent generation of non abstract fields
« on: August 12, 2004, 11:33:38 pm »
Hi there. I have an abstract class that contains one abstract method and another method which has been implemented.

I have a class that implements this abstract class.

My probem is that although the diagram indicates that i am only going to implement the non abstract method in the implementation class, the actual code generated always includes the non abstract method from the abstract class - which i don't want to do.

I have a number of non abstract methods in my abstract base class that i do not want to override, whilst i only have a few abstract methods.

Is there anyway for the code generation to NOT create instances of methods which are not abstract??? I have tried UML to code and vice versa, and although i can almost get it, the product seems to insist on writing every method!

thanks,
Steven
http://stevenlivingstone.com

TrtnJohn

  • EA User
  • **
  • Posts: 176
  • Karma: +0/-0
    • View Profile
Re: Prevent generation of non abstract fields
« Reply #1 on: August 13, 2004, 01:32:07 pm »
Are these two classes associated by a generalization?  If so you can select the Class and then select the Override Implementation ...  menu entry from the Element menu on the EA Main Menu to select which method to provide implementation for.

chilescot

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Prevent generation of non abstract fields
« Reply #2 on: August 14, 2004, 01:45:05 am »
Hi - yes, graphically speaking that is what happens. However, those that you do not want to provide the implementation for in the derived class (which are not abstract in the abstract class) are still output when the class is generated.

So in an abstract class I may have:

public abstract string myMethod();

public string MyImplementedMethod()
{
    return("ok");
}


My dervied class need only implement myMethod(), by the source code generates both and i can't find a way to supress this.

steven