title: How can I get a precise callgraph for a web Application using spring FrameWork by soot SPARK？
body: <p>I want to get a precise callgraph (using soot SPARK) when analysising a web Application using spring FrameWork, but I have one big problem to solve:
  Spring use DI (Dependency Injection) to manage beans , which means we don't need to create an Object. For this instance, I can't get precise callgraph (using SPARK) for some interface.</p>
  <p>Example:
  When I use soot to get the call graph by SPARK( mainClass = AnimalMain.main(String[] args)), it can't find the implement class of &quot;Animal pig&quot; and &quot;Animal human&quot;, so the result don't contains any edge about &quot;pig.eat()&quot;. So it is not practical for Web Applications using Spring FrameWork。</p>
  <p>How can I get a precise callgraph ？</p>
  <pre><code>public class AnimalMain {
  @Autowired
  Animal pig;
  
  @Autowired
  Animal human;
  
  Tree pineTree = new PineTree();
  
  public static void main(String[] args) {
      AnimalMain animalMain = new AnimalMain();
      animalMain.eat();
  }
  
  void eat() {
      pig.eat();
      pineTree.grow();
  }
  }
  
  </code></pre>
  <pre><code>public interface Animal {
  void eat();
  }
  </code></pre>
  <pre><code>@component(value = &quot;pig&quot;)
  public class Pig implements Animal {
  
  @Override
  public void eat() {
      System.out.println(doEat());
  }
  
  private String doEat() {
      return &quot;pig eat&quot;;
  }
  }
  
  </code></pre>
  <pre><code>@component(value = &quot;human&quot;)
  public class Human implements Animal {
  @override
  public void eat() {
  System.out.println(&quot;human eat ……&quot;);
  }
  }
  </code></pre>