Re: Multiplicity Questions

Mark Fortner <[email protected]> Wed, 4 Apr 2012 07:32:58 -0700
Newsgroups gmane.comp.lang.uml.argouml.user
Message-ID <CAOwy01vOGLA3q+QfH3DHLW0ZjG0WHHANQi3CPLQBYeUtxbkuhA@mail.gmail.com>
------=_Part_13128_510258771.1333549981109
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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:

   - When I debug into the method I find that a call
   to Model.getFacade().isPublic(obj) is always returning true.  It is being
   passed an AssociationEndImpl object, and when you get its visibility it
   returns Public.  When I try to inspect the AssociationEnd all I get are a
   ton of MOF IDs, and maps and lots of useless crap but no attribute called
   visibility that I can inspect.

   - When I make a call to getName on the Association, it returns null for
   both association ends, despite the fact that one of the association ends is
   named.

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?

Mark


On Thu, Mar 29, 2012 at 8:11 AM, Mark Fortner <[email protected]> wrote:

> I've created an issue for this:
> http://argouml.tigris.org/issues/show_bug.cgi?id=6421
>
> If I get a chance this weekend, I'll take a look at the existing code for
> this.
>
> Cheers,
>
> Mark
>
>
>
> On Wed, Mar 28, 2012 at 9:33 AM, Mark Fortner <[email protected]> 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?
>>
>> 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=2944584

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

I&#39;ve fixed the multiplicity issues and altered the GeneratorJava class =
to return Lists instead of Vectors. =A0However, I can&#39;t seem to get the=
 generateVisibility method to give me the appropriate visibility. =A0Here&#=
39;s what&#39;s happening:<div>
<ul><li>When I debug into the method I find that a call to=A0Model.getFacad=
e().isPublic(obj) is always returning true. =A0It is being passed an Associ=
ationEndImpl object, and when you get its visibility it returns Public. =A0=
When I try to inspect the AssociationEnd all I get are a ton of MOF IDs, an=
d maps and lots of useless crap but no attribute called visibility that I c=
an inspect.<br>
<br></li><li>When I make a call to getName on the Association, it returns n=
ull for both association ends, despite the fact that one of the association=
 ends is named. =A0</li></ul><div>My thought is that the Property panel is =
setting some other attribute of the Association End to private. =A0But I ca=
n&#39;t really confirm this. =A0Does anyone have any suggestions for how to=
 proceed further?</div>
<div><br></div><div>Mark</div>
<br><br><div class=3D"gmail_quote">On Thu, Mar 29, 2012 at 8:11 AM, Mark Fo=
rtner <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">phidias5=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;ve created an issue for this:<div><a href=3D"http://argouml.tigris.or=
g/issues/show_bug.cgi?id=3D6421" target=3D"_blank">http://argouml.tigris.or=
g/issues/show_bug.cgi?id=3D6421</a></div><div><br></div><div>If I get a cha=
nce this weekend, I&#39;ll take a look at the existing code for this.</div>

<div><br></div><div>Cheers,</div><div><br></div><div>Mark<div><div class=3D=
"h5"><br>
<br><br><div class=3D"gmail_quote">On Wed, Mar 28, 2012 at 9:33 AM, Mark Fo=
rtner <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">

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>

<span><font color=3D"#888888">
<div><br></div></font></span><div><span><font color=3D"#888888">Mark</font>=
</span><div><div><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]" target=3D"_=
blank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">


<div>On Wed, Mar 28, 2012 at 11:06 AM, Mark Fortner &lt;<a href=3D"mailto:p=
[email protected]" target=3D"_blank">[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><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><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]" target=3D"_blank">[email protected]=
is.org</a>].<br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>

------=_Part_13128_510258771.1333549981109--