FaqREGenericCollectionMembers

When reverse engineering generic types, UML represents the generic instance as a derivation classifier. So, when a data member is an instance of a generic type, an association is created between the owning class and a derivation classifier. In NetBeans 5.5, UML do not treat collections any differently than any other generic type. So, if a data member is a collection instance, UML will still create an assocition between the owning class and a derivied classifier. There is an enhancement request to make reverse engineering handle collections in a more intuitive mannor.

NetBean 6

The enhancement request has been integrated into the NetBeans 6 code base. When a data member that is an instance of a generic is used, the association will be between the owning classifier and the type contained in the collection. This fix also works with parameter types.

Example 1

import java.util.ArrayList;

public class A
{
  private ArrayList < B > b = null;
}

public class B
{
}

Reverse Engineering will now create a model that has an association between class A and class B. The association end that is connected to the class B will have a multiplicity of 0..*.

Image:single-dim-collection_FaqREGenericCollectionMembers.png

Example 2

import java.util.ArrayList;

public class A
{
  private ArrayList < ArrayList < B > > b = null;
}

public class B
{
}

Reverse Engineering will now create a model that has an association between class A and class B. The association end that is connected to the class B will have a multiplicity of 0..*, 0..*.

Image:double-dim-collection_FaqREGenericCollectionMembers.png

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo