Book a Demo

Author Topic: EA-Interface inheritance  (Read 2856 times)

tauberson

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
EA-Interface inheritance
« on: March 28, 2005, 11:58:42 am »
I am having an issue with interface
inheritance.  The issue is that I have an interface containing only properties.  The interface
is inherited by a base class which will implement the properties and set local member variables.
So far so good.  The issue is, once I create the local variable in the base class and set the property checkbox value to the name of the inherited property, I end up with two properties.  One which was just created and the other from the original inherited interface.  

My question is how can we instruct EA to utilize the inherited property in order to set the local member
Variable instead of creating a new property?



Code example generated in C#:

public string BirthCountry {

                 get{

                       return _birthCountry;
                 }

                 set{
                       _birthCountry = value;
                 }

           }

           public string IPerson.BirthCountry {
                 get{
                       return <unknown>;

                 }
                 set{
                       <unknown> = value;
                 }
           }

thomaskilian

  • Guest
Re: EA-Interface inheritance
« Reply #1 on: March 29, 2005, 01:41:01 am »
Not really an answer but you could try reverse engineering of what your expected code is and see what EA will produce.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: EA-Interface inheritance
« Reply #2 on: March 29, 2005, 02:14:00 pm »
If I understand your question correctly you have created an interface in EA with a property BirthCountry.

You realise that interface and implement the property.  Then to set the attribute associated with the property you create an attribute and check the property checkbox.  This results in a property being created.

I see two possible options to get around this problem.

1. Don't directly implement the interface property, just create the attribute and the property that it needs in the child class.

2. Implement the property, but don't create a new one.  Instead select the implemented property and create a new tagged value with the name "attribute_name" and the value should be the name of the matching attribute.

I hope this helps.

Simon