Re: Multiplicity Questions

Mark Fortner <[email protected]> Wed, 28 Mar 2012 09:33:05 -0700
Newsgroups gmane.comp.lang.uml.argouml.user
Message-ID <CAOwy01t4--ntb+TYR_X5G4oFdT6WiapLCX2nv=m_Nw3mCf3cZQ@mail.gmail.com>
------=_Part_14097_1898473970.1332952393645
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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?

Mark


On Wed, Mar 28, 2012 at 8:32 AM, Tom Morris <[email protected]> wrote:

> On Wed, Mar 28, 2012 at 11:06 AM, Mark Fortner <[email protected]>
> 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.
>
> Tom
>
> ------------------------------------------------------
>
> http://argouml.tigris.org/ds/viewMessage.do?dsForumId=449&dsMessageId=2941640
>
> To unsubscribe from this discussion, e-mail: [
> [email protected]].
>

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=449&dsMessageId=2941655

To unsubscribe from this discussion, e-mail: [[email protected]].
------=_Part_14097_1898473970.1332952393645
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks, Tom!=A0<div><br></div><div>I knew there had to be some UML-specific=
 thing that I needed to do to get the employeeList in the right place.<div>=
<br></div><div>As for generating the appropriate type, (ArrayLists vs Vecto=
rs), my thought was that I&#39;d simply generate:</div>
<div><br></div></div><blockquote style=3D"margin:0 0 0 40px;border:none;pad=
ding:0px"><div><div>List&lt;Employee&gt; employeeList;</div></div></blockqu=
ote><div><div><br></div><div>And let the user create the right-side of decl=
aration if they want after the code has been generated.</div>
<div><br></div><div>Is there currently a preference that allows the user to=
 specify what version of Java they want to use? Perhaps using the Java prof=
ile? Since Oracle doesn&#39;t support 1.4 anymore, is there a reason that w=
e would need to support the non-generic list?</div>
<div><br></div><div>Mark<br>
<br><br><div class=3D"gmail_quote">On Wed, Mar 28, 2012 at 8:32 AM, Tom Mor=
ris <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">tfmorris@gm=
ail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=3D"im">On Wed, Mar 28, 2012 at 11:06 AM, Mark Fortner &lt;<a hre=
f=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br>
&gt; Hi Linus,<br>
&gt; I created the association again, clicked on the link in the Properties=
 panel<br>
&gt; to go to the Department association end, and then clicked Private. =A0=
When I<br>
&gt; looked at the source tab, it still showed up as public. =A0Oddly enoug=
h, on<br>
&gt; the diagram we see &quot;-employeeList&quot; indicating that the assoc=
iation end is<br>
&gt; private.<br>
<br>
</div>I&#39;ve lost track of the ends now, but my impression from the origi=
nal<br>
message was that you were changing the visibility on the wrong<br>
association end. =A0Remember that it&#39;s the *far* end that you need to<b=
r>
change for things like visibility and navigability.<br>
<div class=3D"im"><br>
&gt; What&#39;s also odd is the fact that Employee also ends up with a publ=
ic Vector<br>
&gt; employeeList declaration.<br>
<br>
</div>Is the association navigable in both directions? (the default) =A0If =
so,<br>
you&#39;ll get data structures on both ends to allow you to get to the<br>
other end. =A0Set isNavigable to false on the end opposite where you<br>
want the data structure to disappear from.<br>
<div class=3D"im"><br>
&gt; I suspect changing Vectors into generified Lists, and fixing the<br>
&gt; Multiplicity=3D1 issue are probably trivial changes and I&#39;ll look =
into that<br>
&gt; within the next few days.<br>
<br>
</div>Support for UML Templates and Java generics is only partially<br>
implemented. =A0You could probably special case the code generation for<br>
this specific use case without generics support, but you might need to<br>
take backward compatibility into account (e.g. provide a preference<br>
setting for what type to generate).<br>
<br>
Note also that ArrayList and Vector have slightly different semantics,<br>
particularly vis a vis synchronization, so the two types aren&#39;t<br>
completely interchangeable.<br>
<br>
Tom<br>
<br>
------------------------------------------------------<br>
<a href=3D"http://argouml.tigris.org/ds/viewMessage.do?dsForumId=3D449&amp;=
dsMessageId=3D2941640" target=3D"_blank">http://argouml.tigris.org/ds/viewM=
essage.do?dsForumId=3D449&amp;dsMessageId=3D2941640</a><br>
<br>
To unsubscribe from this discussion, e-mail: [<a href=3D"mailto:users-unsub=
[email protected]">[email protected]</a>].<br>
</blockquote></div><br></div></div>

------=_Part_14097_1898473970.1332952393645--