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

Validations must allow parametrization #7

Open
fpuga opened this issue Oct 26, 2012 · 5 comments
Open

Validations must allow parametrization #7

fpuga opened this issue Oct 26, 2012 · 5 comments

Comments

@fpuga
Copy link
Member

fpuga commented Oct 26, 2012

We will need validations to check if a value is between two numbers. Right now it's not possible to implement this.

We need rules like

between

@oandregal
Copy link
Contributor

Thinking out loud here for further reference:

after a 1-minute research, I see no obvious way to create such a rule (as well as other interesting ones, ie: the UNIQUE), because those rules use values only known in executing time. The case you suggest, for example, may need to know the values of other fields in the same form, which may vary depending on the user actions. I though we could benefit from something like DomainValues, but it may be not enough as it caches the values every time a form is opened.

Plus -and not sure yet if both are related- we need to provide a way for the developer to hook their own checks into isSaveable().

@fpuga
Copy link
Member Author

fpuga commented Nov 28, 2012

I agree with have the hooks.

But the user case that i'm pointed in this case is about fixed values set in the xml

@oandregal
Copy link
Contributor

If the value is know and no change along the life of the app, it's easy.

In such a case, I'd bet for having 3 independent and compatible new rules (for example <EQUALS>, <MIN> and <MAX>) which allow us to implement all use cases for ranges: "x greater than y", "x greater or equals than y", "x lower than y", "x between min and max", etc. Would need assessing how that may be related to the validation of data types such as integer_positive or double_positive, which would make easier the XML parsing.

May be useful reviewing how SLD implements and concatenate rules and filters for inspiration.

@fpuga
Copy link
Member Author

fpuga commented Nov 28, 2012

I agree with your approach.

I'm bit scary of reinvent the wheel as there are thousands of domain specific language over there and we are creating another one.

@oandregal
Copy link
Contributor

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

No branches or pull requests

2 participants