Sitelet https://github.com/scaldi/scaldi/pull/71
Skip to content

New Injector with check for ambiguous bindings - #71

Open
bilyush wants to merge 1 commit into
scaldi:masterfrom
bilyush:master
Open

bilyush wants to merge 1 commit into
scaldi:masterfrom
bilyush:master

Conversation

@bilyush

@bilyush bilyush commented Aug 14, 2016 •

Copy link
Copy Markdown

Related to #69
I would propose to allow the user specify the behaviour: should the error be thrown in ambiguous case or not. The proposed trait can be stacked into Modules, where that make sence, and at the same time do not affect the existing implementations. Thanks @Mironor for the initial effort (#70)

Qustions:

  • that would not throw an exception for RawInjector
  • how to override the binding for AmbiguousAwareInjector in tests? IMO there is not need to do it. The idea to eliminate ambiguous cases even in tests
  • InjectorWithLifecycle has no final methods. Why are they final?

Looking forward for @OlegIlyenko and @Mironor feedback and discussion.

@Mironor

Mironor commented Aug 15, 2016

Copy link
Copy Markdown
Contributor

Hi bilyush,

As said by @OlegIlyenko , this needs to be moved lower in the hierarchy (in Injectable or Injector).

But the question is mainly what to do with test modules? They are overwriting the basic value in the main module using the thing we are trying to fix. One of the solutions may be the creation of the separated TestModule that will be able to overwrite main module's dependencies without throwing an exception.

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

Successfully merging this pull request may close these issues.

3 participants