I've been using UML for a while and I've read few articles, books, forums about it but I still don't REALLY understand when two classes should be connected with association line (a simple line or arrow (or are these not the same?)). I'll provide three examples - can you tell me which one will cause the two classes to be in this relationship?
1.
//a field of OtherClass
public class MainClass
{
private OtherClass other;
}
2.
//method argument
public class MainClass
{
public void Action(OtherClass other)
{ }
}
3.
//method return value
public class MainClass
{
public OtherClass Action()
{ }
}
4.
//used inside a method
public class MainClass
{
private Something something;
public void Action()
{
OtherClass other = something.GetOtherClass();
}
}