When importing C# source code, I've noticed that some dependencies don't get created by EA. I created a simple project to demonstrate the issue. When I import the source code into EA, it correctly resolves the following relationships:
[*]Inheritance (including interfaces)
[*]Composition (as associations)
[*]Dependencies on method arguments
[*]Dependencies on method return types
[/list]
Dependencies on method local instances (i.e., using the 'new' operator), however, are NOT created.Below is source code that demonstrates the problem. When EA imports the code, the "Detached" class is not connected to the "ISimple" interface even though there is a real dependency (and indeed "Detached" won't compile without the reference).
I've searched the documentation and options but I have not found a way to get EA to recognize dependencies on local instances. Am I missing something?
Peter
namespace Simple {
interface ISimple {
void Foo();
}
}
namespace Simple {
class Simple: ISimple {
public void Foo() {
}
}
}
namespace Simple {
class Factory {
public ISimple GetSimple() {
return new Simple();
}
}
}
namespace Simple {
class Client {
public void Bar(ISimple simple) {
simple.Foo();
}
}
}
namespace Simple {
class Composed {
public ISimple Simple;
}
}
namespace Simple {
class Detached {
public void Bar() {
ISimple simple = new Simple();
simple.Foo();
}
}
}