Chapter 3 Building Structural Diagrams


Understanding the generated code

When you define an implementation class, association implementation details are always generated in the origin and/or destination classes of the navigable association.

Generation uses specific documentation comment tags to store association information. These documentation comment tags gather all the required details to be able to recreate the association upon reverse engineering. The documentation comment tags are processed during reverse engineering in order to make round-trip engineering possible.

The following documentation tags are used:

WARNING! 

Caution
Make sure you do not modify these tags in order to preserve round-trip engineering.

In Java

The javadoc tag syntax is used /**@tag value*/.

In the following example, the tag @pdRoleInfo is used to store association implementation details, and @pdGenerated is used to indicate that the getter method is automatically generated and should not be reverse engineered.

   /**@pdRoleInfo name=Person coll=java.util.Collection impl=java.util.LinkedList mult=1..* */
   public java.util.Collection employee;
   /** @pdGenerated default getter */
 public java.util.Collection getEmployee()
   {
      if (employee == null)
         employee = new java.util.HashSet();
      return employee;
   }
...

In C#

The documentation tag ///<tag value /> is used.

In the following example, the tag <pdRoleInfo> is used to store association implementation details, and <pdGenerated> is used to indicate that the getter method is automatically generated and should not be reverse engineered.

   ///<pdRoleInfo name='Person' coll='System.CollectionsArrayList' impl='java.util.LinkedList' mult='1..*' type='composition'/>
   public java.util.Collection employee;
   ///<pdGenerated> default getter </pdGenerated>
...

In VB .NET

The documentation tag "<tag value /> is used.

In the following example, the tag <pdRoleInfo> is used to store association implementation details, and <pdGenerated> is used to indicate that the getter method is automatically generated and should not be reverse engineered.

   "<pdRoleInfo name='Person' coll='System.CollectionsArrayList' impl='java.util.LinkedList' mult='1..*' type='composition'/>
   public java.util.Collection employee;
   "<pdGenerated> default getter </pdGenerated>
...

 


Copyright (C) 2006. Sybase Inc. All rights reserved.