Book a Demo

Author Topic: Bug in C# code generation?  (Read 2233 times)

M.SoddSliver

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Bug in C# code generation?
« on: November 07, 2005, 12:25:19 am »
I'm currently doing a project involving MDA.

Firstly i defined my platform independent model. Below i've made a sample diagram with a car entity.

Next step was transforming the platform independent model to a C# platform specific model:



The C# source code that will be generated from this model does not work. Code is shown below. The names of the private attributes are the same as the generated properties of the class, so the class will not compile. Is this a bug, or has it a special purpose?

namespace Logical Model {

public class Car {



private uint year;


private int wheelCount;


private string modelName;



public Car(){



}



~Car(){



}



public virtual void Dispose(){



}



public uint year{



get{




return year;



}



set{




year = value;



}


}



public int wheelCount{



get{




return wheelCount;



}



set{




wheelCount = value;



}


}



public string modelName{



get{




return modelName;



}



set{




modelName = value;



}


}


}//end Car

}//end namespace Logical Model

M.SoddSliver

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Bug in C# code generation?
« Reply #1 on: November 07, 2005, 12:37:27 am »
Another question. Is it possible to change the name of the attribute during the transformation to a C# model?

I've found the code for transforming attributes, but what do i need to add?

Attribute
{
 %TRANSFORM_REFERENCE()%
 %TRANSFORM_CURRENT("scope","type")%
 scope=%qt%%attScope == "Public" ? "Private" : value%%qt%
 type=%qt%%CONVERT_TYPE("C#",attType)%%qt%
}


Edit: This question is solved :)
« Last Edit: November 07, 2005, 02:51:50 am by M.SoddSliver »