I've fixed the multiplicity issues and altered the GeneratorJava class to return Lists instead of Vectors.  However, I can't seem to get the generateVisibility method to give me the appropriate visibility.  Here's what's happening:
My thought is that the Property panel is setting some other attribute of the Association End to private.  But I can't really confirm this.  Does anyone have any suggestions for how to proceed further?


On Thu, Mar 29, 2012 at 8:11 AM, Mark Fortner <phidias51@gmail.com> wrote:
I've created an issue for this:

If I get a chance this weekend, I'll take a look at the existing code for this.



On Wed, Mar 28, 2012 at 9:33 AM, Mark Fortner <phidias51@gmail.com> wrote:
Thanks, Tom! 

I knew there had to be some UML-specific thing that I needed to do to get the employeeList in the right place.

As for generating the appropriate type, (ArrayLists vs Vectors), my thought was that I'd simply generate:

List<Employee> employeeList;

And let the user create the right-side of declaration if they want after the code has been generated.

Is there currently a preference that allows the user to specify what version of Java they want to use? Perhaps using the Java profile? Since Oracle doesn't support 1.4 anymore, is there a reason that we would need to support the non-generic list?


On Wed, Mar 28, 2012 at 8:32 AM, Tom Morris <tfmorris@gmail.com> wrote:
On Wed, Mar 28, 2012 at 11:06 AM, Mark Fortner <phidias51@gmail.com> wrote:
> Hi Linus,
> I created the association again, clicked on the link in the Properties panel
> to go to the Department association end, and then clicked Private.  When I
> looked at the source tab, it still showed up as public.  Oddly enough, on
> the diagram we see "-employeeList" indicating that the association end is
> private.

I've lost track of the ends now, but my impression from the original
message was that you were changing the visibility on the wrong
association end.  Remember that it's the *far* end that you need to
change for things like visibility and navigability.

> What's also odd is the fact that Employee also ends up with a public Vector
> employeeList declaration.

Is the association navigable in both directions? (the default)  If so,
you'll get data structures on both ends to allow you to get to the
other end.  Set isNavigable to false on the end opposite where you
want the data structure to disappear from.

> I suspect changing Vectors into generified Lists, and fixing the
> Multiplicity=1 issue are probably trivial changes and I'll look into that
> within the next few days.

Support for UML Templates and Java generics is only partially
implemented.  You could probably special case the code generation for
this specific use case without generics support, but you might need to
take backward compatibility into account (e.g. provide a preference
setting for what type to generate).

Note also that ArrayList and Vector have slightly different semantics,
particularly vis a vis synchronization, so the two types aren't
completely interchangeable.



To unsubscribe from this discussion, e-mail: [users-unsubscribe@argouml.tigris.org].