[Uml-devel] Java code generator, Association role support?

Brian Thomas thomas at adc.gsfc.nasa.gov
Fri Jan 17 06:12:07 UTC 2003


	Hi all,

	I recently became interested in the capabilities of Umbrello. Looking at the
	program I see that the Java code generation is still quite primative (a little digression
        here:  I've tried to access CVS to see if there has been any change since Nov, but the 
        sourceforge	cvs server wont let me in. All my "conclusions" come then from the rc1 code 
	I could get (the nightly snapshot shows no changes with rc1)]. That said, I am
	interested in adding the following:

	- Better support for generation of associations.  In particular:
		- use role name for fields in the class
		- multiplicity makes a difference in the type of field generated. In other words,
	          if multiplicity is "1+" a Vector field is generated rather than field with class of
                  the associated object (as it is now done).
                - put in some code to garbage collect (err. destroy) objects owned by the parent
                  object when the association to the child objects is "composition" type.
         - Java style accessor methods for both attributes and associations.  In particular:
                - get/setMethod for singular fields
                -add/remove/getList type methods for Vector fields
                - make fields related to associations default to "protected" rather than "private". In
                  the case that accessor methods arent desired, then make them "public" (I cant 
                 imagine why this isnt the default behavior).

       Finally, I see that the associationwidget class only has ONE role. This cant be correct (from
       my understanding of the UML spec). Two roles, one for each end of the association are always
      allowed. IF people are amenable, I would hack this into the code too (there are other missing parameters
      for associations, but this appears to me the most glaring from the standpoint of trying to generate
      some code). 

      I have already hacked in most of these changes, but comments are welcome. I can post diffs of my 
     code here, or to the responsible maintainer of the code generator software as desired.


								Thanks,

								=b.t.

-- 

  * Dr. Brian Thomas 
  * ADC NASA/Raytheon ITSS

  *   fax: (301) 286-1771
  * phone: (301) 286-6128

A bore is someone who persists in holding his own views after we have
enlightened him with ours.





More information about the umbrello-devel mailing list