Re: Multiplicity Questions

Linus Tolke Tigris <[email protected]> Wed, 28 Mar 2012 06:53:43 +0200
Newsgroups gmane.comp.lang.uml.argouml.user
Message-ID <CAPumN3vt0yJxPtQmBgXU-6ccaK7Ko5by=3ES-TDxDC10Rs3SUg@mail.gmail.com>
------=_Part_11759_149467589.1332910446203
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello Mark!

I think you should point out that this is a Java generation question.
Because we completely separate implementations for each language this kind
of thing might work differently for C++, C#., PHP and SQL.

For Java, ideally the generation would create different code depending on
the multiplicity and you would want to control the array/vector/list-type
used when realizing links with multiplicity bigger than 1. I think it is
now fixed to a Vector that is probably not a good choice in most cases
since generics were introduced as you point out.

When I test to set the association end to visibility private I notice that
it changes to private. Please check this again!

I am not sure where it would be natural to have a Map generated. I guess it
would be for association classes or associations with three or more ends
but I don't think that is supported in the code generation.

As a developer of ArgoUML you are most welcome to make the improvements you
suggest here. It is a much-needed addition.

        /Linus



2012/3/27 Mark Fortner <[email protected]>

> 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=2941324

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

Hello Mark!<div><br></div><div>I think you should point out that this is a =
Java generation question. Because we completely separate implementations fo=
r each language this kind of thing might work differently for C++, C#., PHP=
 and SQL.</div>

<div><br></div><div>For Java, ideally the generation would create different=
 code depending on the multiplicity and you would want to control the array=
/vector/list-type used when realizing links with multiplicity bigger than 1=
. I think it is now fixed to a Vector that is probably not a good choice in=
 most cases since generics were introduced as you point out.</div>

<div><br></div><div>When I test to set the association end to visibility pr=
ivate I notice that it changes to private. Please check this again!</div><d=
iv><br></div><div>I am not sure where it would be natural to have a Map gen=
erated. I guess it would be for association classes or associations with th=
ree or more ends but I don&#39;t think that is supported in the code genera=
tion.</div>

<div><br></div><div>As a developer of ArgoUML you are most welcome to make =
the improvements you suggest here. It is a much-needed addition.</div><div>=
<br></div><div>=A0 =A0 =A0 =A0 /Linus</div><div><br></div><div><br><br><div=
 class=3D"gmail_quote">

2012/3/27 Mark Fortner <span dir=3D"ltr">&lt;<a href=3D"mailto:phidias51@gm=
ail.com">[email protected]</a>&gt;</span><br><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x">
<div>
I&#39;ve been trying to figure out how the changing multiplicity between cl=
asses, 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 Emplo=
yees.
<div><br></div><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0=
px"><div>Department &lt;&gt;----- [1..*]Employee</div></blockquote><div><br=
></div><div>When I name the association to &quot;employeeList&quot;, 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&#39;d like to see <b>private Li=
st&lt;Employee&gt; 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&lt;Skill, Employee&gt;</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>

------=_Part_11759_149467589.1332910446203--