Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discover entry-points via codegen #13

Open
benjamin-bader opened this issue Jul 3, 2013 · 1 comment
Open

Discover entry-points via codegen #13

benjamin-bader opened this issue Jul 3, 2013 · 1 comment

Comments

@benjamin-bader
Copy link
Owner

Pros:

  • remove stupid Injects = new[] { typeof(Foo) } boilerplate

Cons:

  • Inheritance complicates this
  • Container.Add complicates this
    • At some point, we have to determine just what modules are being added
    • The common pattern of base.OnCreate { Container.Add(GetModules()).Inject(this, GetType()); } seems hard to analyze reliably
  • Generics? Ugh
@benjamin-bader
Copy link
Owner Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant