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

Implement GlobalScope, BuildScope and TestScope #4

Open
bsutton opened this issue Jan 7, 2022 · 0 comments
Open

Implement GlobalScope, BuildScope and TestScope #4

bsutton opened this issue Jan 7, 2022 · 0 comments

Comments

@bsutton
Copy link

bsutton commented Jan 7, 2022

Consider implementing the noted classes.

GlobalScope - replacement for getit but interacts with TestScope

  • a singleton with a method called guse()

BlockScope - replacement for provider but interacts with TestScope

  • a provider replacement with a method called 'buse()'

XXXTestScope
The intent of TestScope is to alter the behaviour of other scopes when unit testing.

GlobalScope
as a singleton gs presents problems when running unit tests as each test may need a different set of settings.

To alter GlobalScope's behaviour during unit tests add a GlobalTestScope.
If a GlobalScope detects a GlobalTestScope on the stack (or in the build context?) then the values of the GlobalTestScope are
used in preference to the GlobalScope.
We need to consider the fact that a GlobalScope is called on the call stack as well as the build stack so we need to work out how to inject the GlobalTestScope into both of these.

BuildScope
Same as GlobalScope but we are on the build stack.

Scope
the same IOC but just for the call stack.
We could possibly allow these to be nested with the highest level scope taking precedence (essentially we are reversing the priority).

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