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

Hide the RetentionManager in the API? #31

Closed
psh opened this issue Feb 3, 2019 · 2 comments
Closed

Hide the RetentionManager in the API? #31

psh opened this issue Feb 3, 2019 · 2 comments

Comments

@psh
Copy link
Contributor

psh commented Feb 3, 2019

I believe that it would be possible to hide the RetentionManager from the public API and treat it as an implementation detail, so users would only need to supply a retention period and internally the ChuckCollector manages an instance of it.

collector = ChuckCollector(this)
        .showNotification(true)
        .retentionManager(RetentionManager(this, ChuckCollector.Period.ONE_HOUR))

becoming

collector = ChuckCollector(this)
        .showNotification(true)
        .retentionPeriod(ChuckCollector.Period.ONE_HOUR)

I am assuming that you would always want to use the same context for both the collector and the retention manager. Can you imagine any circumstance where this wouldn't be the case and the exposed constructor would be useful?

Do you feel this would be a good way to evolve the API?

Do you want to develop this feature yourself?
Yes, I'd be happy to.

@cortinico
Copy link
Member

Hey @psh

This shoulds like a good idea to me :)
Please note that we also recently migrated all the retention mechanism to Room, so it should be easier to integrate with your proposal. Would be happy/free to code this feature?

cortinico added a commit that referenced this issue Aug 7, 2019
* Hid the RetentionManager in the api in favor of passing a retentionPeriod instead.
* Fixed indentation based on library:ktlintMainSourceSetCheck report
@cortinico
Copy link
Member

Closed by #36

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

2 participants