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

Remove commands should optionaly remove resources lazily #118

Open
zebrik opened this issue Jun 15, 2016 · 11 comments
Open

Remove commands should optionaly remove resources lazily #118

zebrik opened this issue Jun 15, 2016 · 11 comments

Comments

@zebrik
Copy link
Contributor

zebrik commented Jun 15, 2016

Since these commands are often used just for cleaning up after tests the lazy remove could be valid use case and the commands should be able to be configured to behave lazily.

@Ladicek
Copy link
Contributor

Ladicek commented Jun 15, 2016

Hmm, now that's an interesting idea. We could change all command implementations, and make sure that we don't miss anything in the future. That's not gonna work. Or there could be some global configuration -- I honestly don't like that idea very much, but it also makes a lot of sense (one of Creaper's goals is to help with testing). I'll have to think about that. Or you can provide some highly compelling arguments :-)

BTW the correct word here wouldn't be "lazy" but "lenient". "Lazy" is already used in Creaper in a different context and with a different meaning.

@zebrik
Copy link
Contributor Author

zebrik commented Jun 15, 2016

Rather than guaranteed feature I meant common (recommended ?) way how to implement removing commands. See #117 discussion.

@zebrik
Copy link
Contributor Author

zebrik commented Jun 15, 2016

I meant this issue as a suggestion how to enhance (some) existing commands and how to review upcoming ones.

@Ladicek
Copy link
Contributor

Ladicek commented Jun 15, 2016

OK, so we already have a similar convention: builders of the Add* commands often have a replaceExisting() method.

I'd suggest that builders of the Remove* commands would have a method called lenient() or onlyIfExists() or ignoreMissing() or something like that. Then, based on such flag, the command would either call Operations.remove or Operations.removeIfExists.

Would you agree with such solution?

@Ladicek
Copy link
Contributor

Ladicek commented Jun 15, 2016

I actually like ignoreMissing() the most, because it's symmetric with replaceExisting().

@zebrik
Copy link
Contributor Author

zebrik commented Jun 15, 2016

+1
I suggest ifExists()

@zebrik
Copy link
Contributor Author

zebrik commented Jun 15, 2016

no problem with ignoreMissing()

@rhatlapa
Copy link

Many Remove* commands don't use builders ATM. Thus we will need to maintain two constructors, one based on Builder and the current one in order to not break API.

Just saying. I am definitely for such option, I would find it handy as well.

@Ladicek
Copy link
Contributor

Ladicek commented Jun 15, 2016

I'd prefer adding builders for options like this. The existing constructors would have to be preserved, of course.

@rhatlapa
Copy link

I am also for builders for such options, I just wanted to point out the need for preserving current constructors.

@Ladicek
Copy link
Contributor

Ladicek commented Jun 15, 2016

Then we are in agreement and the only remaining thing is to find someone who will do it :-)

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