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

Why Context is private? #6

Closed
NareshMyTeam11 opened this issue Dec 22, 2020 · 3 comments
Closed

Why Context is private? #6

NareshMyTeam11 opened this issue Dec 22, 2020 · 3 comments

Comments

@NareshMyTeam11
Copy link

NareshMyTeam11 commented Dec 22, 2020

Why keep context variable private?
It would be helpful if we can also access the current context from Kite just like resources.

Like :

Kite.context and Kite.applicationContext

@cioccarellia
Copy link
Owner

Well, there are a couple of reasons to keep it private. Namely:

  • The application context should be globally accessible anyways, so it makes no sense to make it visible
  • Whichever local specific context you set to be kite's, it's not a good idea to reach for it outside of its original scope.

@NareshMyTeam11
Copy link
Author

Yes, you are right about the local specific context but if Kite can provide applicationContext than it will save us from taking our own static variable for applicationContext.

So I think Kite.applicationContext this might be a good feature request.
And we also won't need to manage both static variable applicationContext + Kite.cahangeContext in case of Locale or theme update.

@cioccarellia
Copy link
Owner

I believe that making context public does not bring clarity/usefulness overall, but instead gives developers one more thing to think about. Kite is simple, and made to be simple, so as long as the project mission does not change context is going to stay private.

Plus, it makes more sense for someone who does not use/know about kite but reads code who uses kite where the context is actually from.

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

No branches or pull requests

2 participants