Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Consider improving naming for validation modes #17

Open
siemensikkema opened this issue Feb 8, 2018 · 1 comment
Open

Consider improving naming for validation modes #17

siemensikkema opened this issue Feb 8, 2018 · 1 comment

Comments

@siemensikkema
Copy link
Contributor

I'm not really a fan of the current validation modes names:

form.makeFieldset(inValidationMode: .all)
form.makeFieldset(inValidationMode: .none)
form.makeFieldset(inValidationMode: .nonNil)

(The same holds for the validate method.)

One alternative could be to remove the argument label:

form.makeFieldset(.all)
form.makeFieldset(.none)
form.makeFieldset(.nonNil)

or be a bit more explicit:

form.makeFieldset(validating: .allFields)
form.makeFieldset(validating: .noFields)
form.makeFieldset(validating: .onlyNonNilFields)

or change the names in such a way that they describe the typical use cases:

form.makeFieldset(.forNewEntity)
form.makeFieldset(.noEmptyEntity)
form.makeFieldset(.forUpdatedEntity)

@steffendsommer @BrettRToomey @martinlasek what do you think?

@steffendsommer
Copy link
Contributor

I think this reads quite well:

form.makeFieldset(validating: .allFields)
form.makeFieldset(validating: .noFields)
form.makeFieldset(validating: .onlyNonNilFields)

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

No branches or pull requests

2 participants