Re: Multiplicity Questions
Mark Fortner <[email protected]> Wed, 28 Mar 2012 08:06:58 -0700
| Newsgroups | gmane.comp.lang.uml.argouml.user |
|---|---|
| Message-ID | <CAOwy01srAntWCHs4qHUWg=zekM8GaoK1Vxn-1iBDc8bFBTkkdw@mail.gmail.com> |
------=_Part_13927_281888900.1332947222067 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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. What's also odd is the fact that Employee also ends up with a *public Vector employeeList* declaration. From a useability perspective, it would be nice if the association ends listed in the Properties panel include the names of the classes they terminate in. Even if the association names are unnamed, it makes it easier to select the right association end. I'll right these up in one or two issues. My usual MO when it comes to these things is to discuss the issue first on the user list (in case there's a workaround, or some UML weirdness that I don't understand), and then create an issue if necessary. If there's a quick code change that I can figure out, I usually attach a patch and talk it over with whoever the issue's assigned to. 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. Using other collections such as Maps and Sets would probably take longer to figure out, and would require someone with more UML expertise than me. As Bob suggested, we could use stereotypes, but is this the "standard" way of representing this in UML. If someone took the XMI for the model into a different application, would this kind of association be rendered properly, or generate the appropriate code? Cheers, Mark On Tue, Mar 27, 2012 at 11:37 PM, Bob Tarling <[email protected]> wrote: > All of these are relevant defects and change requesst. None of them can be > implemented in ArgoUML at the moment. > > The change to define a generic List should be an improved standard > behaviour for an anything to many relationship. Maybe we could even > recognise some stereotype to use Set instead when relevant. > > I think a close equivilent of MAP in UML is the qualifier value that can > be set an association-end. This should be an indication to the code > generator to create a Map instead. The qualifier would by the key for that > map. > > I think if you have set the multiplicity to 1 and our currently geting a > vector that should be raised as a defect. > > Please raise defects, enhancements as appropriate. > > As Linus says you are free to try to implement. Hopefully you will find > help on the dev list or maybe the subcomponent owner will come in to > implement. > > Regards > > Bob > > > On 27 March 2012 22:04, Mark Fortner <[email protected]> wrote: > >> I've been trying to figure out how the changing multiplicity between >> classes, effects the code that gets generated. >> >> Let's say that you have a class like Department. This class has multiple >> Employees. >> >> Department <>----- [1..*]Employee >> >> >> When I name the association to "employeeList", and add some >> documentation, and look at the source for the Department, I see this: >> >> /** >> * A list of employees in the Department. >> * @element-type Employee >> */ >> public Vector employeeList >> >> >> Ideally, I'd like to see *private List<Employee> employeeList*. At a >> minimum, is there anyway to display the generic type for the list? >> >> If I select the endpoint within Department, and set the visibility to >> Private, the code still shows up as public. >> >> Is there anyway of changing the type for an association? For example,*MultiMap<Skill, Employee> >> *. >> >> Also, when I add something that has a multiplicity of 1, I still get a >> Vector. Is there anyway of changing that? >> >> Regards, >> >> Mark >> > > ------------------------------------------------------ http://argouml.tigris.org/ds/viewMessage.do?dsForumId=449&dsMessageId=2941631 To unsubscribe from this discussion, e-mail: [[email protected]]. ------=_Part_13927_281888900.1332947222067 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Linus,<div>I created the association again, clicked on the link in the P= roperties panel to go to the Department association end, and then clicked P= rivate. =A0When I looked at the source tab, it still showed up as public. = =A0Oddly enough, on the diagram we see "-employeeList" indicating= that the association end is private.</div> <div><br></div><div>What's also odd is the fact that Employee also ends= up with a <b>public Vector employeeList</b> declaration.</div><div><br></d= iv><div>From a useability perspective, it would be nice if the association = ends listed in the Properties panel include the names of the classes they t= erminate in. =A0Even if the association names are unnamed, it makes it easi= er to select the right association end.</div> <div><br></div><div>I'll right these up in one or two issues. =A0My usu= al MO when it comes to these things is to discuss the issue first on the us= er list (in case there's a workaround, or some UML weirdness that I don= 't understand), and then create an issue if necessary. =A0If there'= s a quick code change that I can figure out, I usually attach a patch and t= alk it over with whoever the issue's assigned to. =A0</div> <div><br></div><div>I suspect changing Vectors into generified Lists, and f= ixing the Multiplicity=3D1 issue are probably trivial changes and I'll = look into that within the next few days. =A0</div><div><br></div><div>Using= other collections such as Maps and Sets would probably take longer to figu= re out, and would require someone with more UML expertise than me. =A0As Bo= b suggested, we could use stereotypes, but is this the "standard"= way of representing this in UML. =A0If someone took the XMI for the model = into a different application, would this kind of association be rendered pr= operly, or generate the appropriate code?</div> <div><br></div><div>Cheers,</div><div><br></div><div>Mark<br> <br><br><div class=3D"gmail_quote">On Tue, Mar 27, 2012 at 11:37 PM, Bob Ta= rling <span dir=3D"ltr"><<a href=3D"mailto:[email protected]">bob.ta= [email protected]</a>></span> wrote:<br><blockquote class=3D"gmail_quote" = style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> All of these are relevant defects and change requesst. None of them can be = implemented in ArgoUML at the moment.<div><br></div><div>The change to defi= ne a generic List should be an improved standard behaviour for an anything = to many relationship. Maybe we could even recognise some stereotype to use = Set instead when relevant.</div> <div><br></div><div>I think a close equivilent of MAP in UML is the qualifi= er value that can be set an association-end. This should be an indication t= o the code generator to create a Map instead. The qualifier would by the ke= y for that map.</div> <div><br></div><div>I think if you have set the multiplicity to 1 and our c= urrently geting a vector that should be raised as a defect.</div><div><br><= /div><div>Please raise defects, enhancements as appropriate.</div><div> <br></div><div>As Linus says you are free to try to implement. Hopefully yo= u will find help on the dev list or maybe the subcomponent owner will come = in to implement.</div><div><br></div><div>Regards</div><span class=3D"HOEnZ= b"><font color=3D"#888888"><div> <br></div><div> Bob</div></font></span><div class=3D"HOEnZb"><div class=3D"h5"><div><br><br= ><div class=3D"gmail_quote">On 27 March 2012 22:04, Mark Fortner <span dir= =3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank">phidi= [email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> <div>I've been trying to figure out how the changing multiplicity betwe= en classes, effects the code that gets generated.</div><div><br></div>Let&#= 39;s say that you have a class like Department. =A0This class has multiple = Employees. <div><br></div><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0= px"><div>Department <>----- [1..*]Employee</div></blockquote><div><br= ></div><div>When I name the association to "employeeList", and ad= d some documentation,=A0and look at the source for the Department, I see th= is:</div> <div><br></div><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0= px"><div>=A0 /**=A0</div><div>=A0 =A0* =A0A list of employees in the Depart= ment.</div><div>=A0 =A0* @element-type Employee</div><div>=A0 =A0*/</div><d= iv>=A0 =A0public Vector employeeList</div> </blockquote><div><br></div><div>Ideally, I'd like to see <b>private Li= st<Employee> employeeList</b>. =A0At a minimum, is there anyway to di= splay the generic type for the list? =A0</div><div><br></div><div>If I sele= ct the endpoint within Department, and set the visibility to Private, the c= ode still shows up as public.</div> <div><br></div><div>Is there anyway of changing the type for an association= ? =A0For example,<b> MultiMap<Skill, Employee></b>.=A0</div><div><br>= </div><div>Also, when I add something that has a multiplicity of 1, I still= get a Vector. =A0Is there anyway of changing that?</div> <div><br></div><div>Regards,</div><div><br></div><div>Mark</div> </blockquote></div><br></div> </div></div></blockquote></div><br></div> ------=_Part_13927_281888900.1332947222067--