I'm working on a class diagram for an existing application (C#) and I'm struggling with the following.
Say you have two classes A
and B
. Class B
contains a method foo
that returns a list of A
objects::
public class A { string V {get; set;} }
public class B {
string W {get; set;}
public List<A> foo(JObject bar) { /* do something */ }
}
What is the relationship that A
has with B
in this case when this is modelled in UML?
At first I thought this would be a one-to-many relationship where the method returns a list (one or more...) of A
. Because when you have a list attribute in a class, it is usually a one-to-many relationship. However, I don't know if this is the same case.
In the application, the A
class is only used through the method foo()
, so it would also be weird to connect it to nothing, as it would then just be a standalone class which I think is wrong too.