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

Configure should not care about default lifecycle #716

Open
bnordli opened this issue Jan 7, 2017 · 0 comments
Open

Configure should not care about default lifecycle #716

bnordli opened this issue Jan 7, 2017 · 0 comments

Comments

@bnordli
Copy link
Contributor

bnordli commented Jan 7, 2017

See ProCoSys#16. Related to #686, but pulled out as a separate bug because of the somewhat breaking changes.

It started with a bug that Configure.DiscoverAndConfigure was hard coded to using BindingLifecycle.Transient, but ended with the realization that Configure does not have to deal with a default lifecycle at all, because

Either

  1. .DiscoverAndConfigure is used, and then the container is created by an ICanCreateContainer. This method can easily set the lifecycle on the container before returning, or
  2. any .With(IContainer container ...) method is used, and then the lifecycle can be set before this method is called.

In the end, the Configure class can be simplified a lot.

The breaking changes are the removal of the Container methods with BindingLifecycle parameters, a compile time change. (If wanted, these can instead be kept and obsoleted, but I don't think that is needed.)

bnordli added a commit to bnordli/Bifrost-statoil that referenced this issue Jan 7, 2017
Instead clients should set the default lifecycle on the container either
before returning from ICanCreateContainer.CreateContainer or before the call to Configure.With.

Original issue: ProCoSys#16
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