Hello I have 2 classes in a parent child relationship.
The parent has the child, so this indicates the need for an aggregation relationship.
However, the parent also sets properties on the child, so I want to clearly indicate this in UML as well.I thought about connecting the parent to the child with an aggregation connector as well as a dependency (dotted arrow) connector.
Does this seem like a reasonable approach for this scenario or would you do this differently?
On Apr 18, 2013 5:08 PM, "dotnetguy" <andrew.d....@gmail.com> wrote:
>
> Composition is 1:1 whereas a repeater will by definition have many rows which indicates aggregation.
No, Composition is 1:Many.
>
> Using the dotted dependency arrow in addition to the aggregation symbol shows that the parent actively sets properties on the child.
>
> This is a very effective visual metaphor that effectively illustrates the relationship for a casual viewer of the diagram.
>
> However, this may violate proper UML conventions. Not sure if there is a proper way to do this in UML that illustrates the relationship and interaction as well to the casual viewer?
Define "proper" :-)
It's probably not how most people would do it (from what you've said, Composition would cover it).
However: the purpose is communication. If using your convention works for you and your stakeholders then don't be a slave to the language police. As long as you both/all understand the same thing from the diagram then don't be afraid to step outside convention. That said, you're going to have some extra work and perhaps some increased visual noise if the diagram gets big.
Personally i'd probably go with composition from what you've told us. Provided of course all parties interpreted it the same way. But if your idiom works for you & yours then stick with it.
Hth.
- Scott.
>
>
>
> On Tuesday, April 16, 2013 1:21:31 PM UTC-7, dotnetguy wrote:
>>
>> Hello I have 2 classes in a parent child relationship.
>>
>> The parent has the child, so this indicates the need for an aggregation relationship.
>>
>> However, the parent also sets properties on the child, so I want to clearly indicate this in UML as well.
>>
>> I thought about connecting the parent to the child with an aggregation connector as well as a dependency (dotted arrow) connector.
>>
>> Does this seem like a reasonable approach for this scenario or would you do this differently?
>>
I'm guessing some of you guys are familiar with .NET WebForms.
I'm working on a WebForm that has a user control with a repeater. And that repeater has a child user control that the parent sets property values on.
It sounds to me as though the appropriate UML construct to use in this situation is to depict the repeater as an association class connecting the user control on the WebForm with the child control.
This is conditional on whether the modelling tool you use supports this and avoids the need to create two relationships. The other plus is that it is valid UML.
Sent from my smartphone
Gus Nkwocha