Book a Demo

Author Topic: Function usage relation in class diagram  (Read 6258 times)

Stringer

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Function usage relation in class diagram
« on: September 10, 2007, 11:31:37 pm »
I use some class on other class's function only. What connection type is best to describe that in the class diagram?

Simplified example source:

class A
{
  public string Name;
}

// Example 1, used in parameter
class B
{
  public void PrintName(A Temp)
  {
      Console.WriteLine(Temp.Name);
  }
}

// Example 2, used privately inside the function
class B
{
  public void PrintName()
  {
      A Temp=new A();
      Console.WriteLine(A.Name);
  }
}
« Last Edit: September 11, 2007, 12:13:32 am by Stringer »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Function usage relation in class diagram
« Reply #1 on: September 11, 2007, 02:36:30 am »
That would be a dependency.

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Function usage relation in class diagram
« Reply #2 on: September 15, 2007, 05:32:18 pm »
And you can elect to have argument types automatically parsed to generate the dependency for you.  Nature exactly where you net this from within EA (will get back to you when I'm "back at a machine with EA on).

What would possible be helpfull is automatic dependancy generation from within operation bodies... ie
MyClass ....
MyOp()
{
String msg = "Hello World";
console.writeline(msg);
}

With a dep line drawn from MyClass to String... but I'm kinda resigned to a long wait
Kevin

« Last Edit: September 15, 2007, 05:33:54 pm by badboyabout »