benjamin-bader / stiletto

Fast Dependency Injection for .Net, Mono, and MonoTouch
http://stiletto.bendb.com
Apache License 2.0
43 stars 14 forks source link

Discover entry-points via codegen #13

Open benjamin-bader opened 11 years ago

benjamin-bader commented 11 years ago

Pros:

Cons:

benjamin-bader commented 11 years ago

This needs some deep thought. The API would be so much more usable, but only if codegen actually works beyond the 80% case. For example, how to support this;

public T Get<T>()
{
    return this.Container.Get<T>();
}

Naively, we could just search the whole world for calls to Get, and look at their generic arguments. And what if those arguments are themselves generic? How deeply should we look?