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

Implementing Singleton Pattern #21

Open
alisherafat01 opened this issue Dec 5, 2016 · 4 comments
Open

Implementing Singleton Pattern #21

alisherafat01 opened this issue Dec 5, 2016 · 4 comments

Comments

@alisherafat01
Copy link

Hi, i was thinking that why you haven't implemented singleton pattern for this utility class, so that we can load this class just one time in whole application.
is there any special reason?
(i know that built-in shared preferences object uses singleton pattern by default)

@kcochibili
Copy link
Owner

kcochibili commented Dec 8, 2016

That is a good idea.
I initially did not do it because I didn't know about singleton at that time, and I didn't feel the need to add such behavior.
I will explore the possibilities, and add it if it doesn't break the simplistic idea I created this project on.

@iRYO400
Copy link

iRYO400 commented Mar 28, 2017

Upvote!

@kcochibili
Copy link
Owner

Singleton pattern is mainly used for objects that hold data that is needed across the application. Tinydb currently does not hold much data, its more like a messenger to the default android Shared Preferences.
That is why I have not yet merged the pull request.
Expand my view/understanding, if you think i'm wrong..

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

3 participants