Login | Register
My pages Projects Community openCollabNet

Discussions > users > Re: [argouml-users] Multiplicity Questions

Discussion topic

Back to topic list

Re: [argouml-users] Multiplicity Questions

Author phidias
Full name Mark Fortner
Date 2012-03-28 08:07:00 PDT
Message 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?



On Tue, Mar 27, 2012 at 11:37 PM, Bob Tarling <bob dot tarling at gmail dot com> 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 <phidias51 at gmail dot com> 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

« Previous message in topic | 4 of 9 | Next message in topic »


Show all messages in topic

[argouml-users] Multiplicity Questions phidias Mark Fortner 2012-03-27 14:04:24 PDT
     Re: [argouml-users] Multiplicity Questions linus Linus Tolke 2012-03-27 21:54:05 PDT
     Re: [argouml-users] Multiplicity Questions bobtarling Bob Tarling 2012-03-27 23:37:18 PDT
         Re: [argouml-users] Multiplicity Questions phidias Mark Fortner 2012-03-28 08:07:00 PDT
             Re: [argouml-users] Multiplicity Questions tfmorris Tom Morris 2012-03-28 08:32:54 PDT
                 Re: [argouml-users] Multiplicity Questions phidias Mark Fortner 2012-03-28 09:33:12 PDT
                     Re: [argouml-users] Multiplicity Questions phidias Mark Fortner 2012-03-29 08:11:23 PDT
                         Re: [argouml-users] Multiplicity Questions phidias Mark Fortner 2012-04-04 07:32:59 PDT
                             [argouml-dev] Re: [argouml-users] Multiplicity Questions bobtarling Bob Tarling 2012-04-04 09:54:33 PDT
Messages per page: