Book a Demo

Author Topic: Generating Association/Aggregation/Composition  (Read 4932 times)

xartex

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Generating Association/Aggregation/Composition
« on: January 01, 2008, 08:35:57 pm »
Generating code, can EA generate Generic Collection relationship for Composition and Aggregation? For example, after specifing 'List' as the Aggregation collection, and 'Child' as the item of the collection, can EA generate code like:  

class Parent{
  public List<Child> Children;
}

And for reverse engineering, can EA automatically set the relationships for Aggregation and Composition?

Do I need any plug-in to support these features? Is there any available?

Thanx.

David Dufour

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Generating Association/Aggregation/Composition
« Reply #1 on: February 29, 2008, 03:35:36 am »
hi,

along with your question : did you get EA to generate the proper using statement for your classes using generics, like :

"using System.Collections.Generic;"

I can't seem to figure out how to add this statement when a List<T> is used due to aggregation/association usage.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Generating Association/Aggregation/Composition
« Reply #2 on: February 29, 2008, 08:31:19 am »
First question:
See http://www.sparxsystems.com/EAUserGuide/index.html?settingcollectionclasses.htm

Reverse engineering does not create any links from this, and only creates associations, never aggregations or compositions.

Second question:
In the code generation dialog (for a single class) there is two fields for the imports needed.  If you put the extra using statement in there EA will generate it out.  (When generating the entire file)
« Last Edit: February 29, 2008, 08:32:18 am by simonm »