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

Better define behaviour of Clear() on NonEmptyCollectionImpl #18

Open
hectorjsmith opened this issue Jun 12, 2020 · 0 comments
Open

Better define behaviour of Clear() on NonEmptyCollectionImpl #18

hectorjsmith opened this issue Jun 12, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hectorjsmith
Copy link
Collaborator

Requirement

  • Design how the Clear method should operate on a NonEmptyCollectionImpl class and implement any necessary changes. The current implementation throws an exception.
  • Document the method to clearly define the behaviour.

Value Proposition

Better defining the behaviour makes the class easier to use.

Design Ideas

There are a few options:

  1. Throw an exception (as it does today) - it does not make sense to clear a non-empty collection
  2. Fail silently - Just leave the collection as it is
  3. Somehow transform the collection into an empty collection
@hectorjsmith hectorjsmith added enhancement New feature or request help wanted Extra attention is needed labels Jun 12, 2020
@hectorjsmith hectorjsmith changed the title Design clear behaviour for NonEmptyCollectionImpl Better define behaviour of Clear() on NonEmptyCollectionImpl Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant