Author Topic: develop a specific plugin to interpret C# annotati  (Read 2638 times)

nlecart

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
develop a specific plugin to interpret C# annotati
« on: March 16, 2012, 12:37:14 am »
Hello,

We bought EA to support all our software conception.
But we are facing a problem with the reverse capacity of EA.
In our C# code we use c# annotation to specify relationship between classes

For example, to specify a composition relation between a person class and a PersonStatus class, we code this like that:
////composition
     
#region PersonStatus
        [OwnedObject(typeof(PersonStatus), Constants.CatBSOStatus,
               new string[] { CreateRoles},
               new string[] { ReaderRoles },
               new string[] { UpdateRoles },
               new string[] { DeleteRoles },
               false,
               Constants.CatOwnedObjectsDisplayOrder + 1,
               "PersonStatusOwnership",
               true, false, false)]
        public string statusID{ get; }

        #endregion PersonStatus


This means that a Person object can contain 0..N PersonStatus objects

//relationship
#region Person Address Relation
        [RelationAttribute(typeof(PersonAddress),            Constants.PersonAddressRelation,
            Constants.AddressRelationshipLabel,
            new string[] { CreateRoles},
               new string[] { ReaderRoles },
               new string[] { UpdateRoles },
               new string[] { DeleteRoles },
            true,
            typeof(BSOAddress),
            Constants.CatRelationshipsDisplayOrder + 0,
            true)]
        public string PersonAddressID { get; set; }
        #endregion Person Address Relation


This means that a person object can be link to 0..N PersonAdress objects

From this code, we would like EA :
-      to generate a UML aggregation link between Person and PersonAdress
-      to generate a UML composition link between  Person PersonStatus

have you ever experienced this ?

can the SDK of EA can help us to develop such a behavior?

Thank you very much for your help

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: develop a specific plugin to interpret C# anno
« Reply #1 on: March 16, 2012, 05:23:58 pm »
Sure using the EA API it should be possible to go over the code after reverse engineering the code, and add the required relations.
If you are looking for a place to start:
Tutorial: Create your first C# Enterprise Architect addin in 10 minutes
If you are looking for examples:
https://github.com/GeertBellekens

Geert

nlecart

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: develop a specific plugin to interpret C# anno
« Reply #2 on: March 28, 2012, 03:08:08 am »
Thank you Geert,

I will analyse your inputs.