Re: Multiplicity Questions
Mark Fortner <[email protected]> Thu, 29 Mar 2012 08:11:17 -0700
| Newsgroups | gmane.comp.lang.uml.argouml.user |
|---|---|
| Message-ID | <CAOwy01sR3rLE6Ukayv=HEq6EQ3U_o+DhSH-wDgN+YLBgNJf7FA@mail.gmail.com> |
------=_Part_1936_728483987.1333033884381 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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=2942061 To unsubscribe from this discussion, e-mail: [[email protected]]. ------=_Part_1936_728483987.1333033884381 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've created an issue for this:<div><a href=3D"http://argouml.tigris.or= g/issues/show_bug.cgi?id=3D6421">http://argouml.tigris.org/issues/show_bug.= cgi?id=3D6421</a></div><div><br></div><div>If I get a chance this weekend, = I'll take a look at the existing code for this.</div> <div><br></div><div>Cheers,</div><div><br></div><div>Mark<br> <br><br><div class=3D"gmail_quote">On Wed, Mar 28, 2012 at 9:33 AM, Mark Fo= rtner <span dir=3D"ltr"><<a href=3D"mailto:[email protected]">phidias5= [email protected]</a>></span> wrote:<br><blockquote class=3D"gmail_quote" styl= e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-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'd simply generate:</div> <div><br></div></div><blockquote style=3D"margin:0 0 0 40px;border:none;pad= ding:0px"><div><div>List<Employee> 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't support 1.4 anymore, is there a reason that w= e would need to support the non-generic list?</div> <span class=3D"HOEnZb"><font color=3D"#888888"> <div><br></div></font></span><div><span class=3D"HOEnZb"><font color=3D"#88= 8888">Mark</font></span><div><div class=3D"h5"><br> <br><br><div class=3D"gmail_quote">On Wed, Mar 28, 2012 at 8:32 AM, Tom Mor= ris <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_= blank">[email protected]</a>></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 <<a href=3D"mailto:p= [email protected]" target=3D"_blank">[email protected]</a>> wrote:<br= > > Hi Linus,<br> > I created the association again, clicked on the link in the Properties= panel<br> > to go to the Department association end, and then clicked Private. =A0= When I<br> > looked at the source tab, it still showed up as public. =A0Oddly enoug= h, on<br> > the diagram we see "-employeeList" indicating that the assoc= iation end is<br> > private.<br> <br> </div>I'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's the *far* end that you need to<b= r> change for things like visibility and navigability.<br> <div><br> > What's also odd is the fact that Employee also ends up with a publ= ic Vector<br> > employeeList declaration.<br> <br> </div>Is the association navigable in both directions? (the default) =A0If = so,<br> you'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> > I suspect changing Vectors into generified Lists, and fixing the<br> > Multiplicity=3D1 issue are probably trivial changes and I'll look = into that<br> > 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't<br> completely interchangeable.<br> <br> Tom<br> <br> ------------------------------------------------------<br> <a href=3D"http://argouml.tigris.org/ds/viewMessage.do?dsForumId=3D449&= dsMessageId=3D2941640" target=3D"_blank">http://argouml.tigris.org/ds/viewM= essage.do?dsForumId=3D449&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> ------=_Part_1936_728483987.1333033884381--