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

Include boolean flag for automatic Validation when constructing a JointGridContainer or even any Entity #751

Open
t-ober opened this issue Feb 16, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@t-ober
Copy link
Contributor

t-ober commented Feb 16, 2023

We have a lot of ValidationUtils that check assets and participants for validity of attributes (can be called by ValidationUtils.check() for any entity and delegates to the respective method). It would be nice to be able to trigger them automatically when creating a JointGridContainer by for example including a boolean flag validate. Which could be set to False by default to not break existing code.

This could even be done for every entity.

@t-ober t-ober added good first issue Good for newcomers enhancement New feature or request labels Feb 16, 2023
@sebastian-peter
Copy link
Member

Maybe the solution would be to make validation better known in the documentation?
If we want such a flag, I think it should not be used as a parameter to the constructor of JointGridContainer (constructors should just do what their name says), but as a flag in the methods that build the container.

@t-ober
Copy link
Contributor Author

t-ober commented Feb 16, 2023

Isn't it quite common in constructors to check the arguments that are passed for validity?

But I agree if we would pass that somehow as an argument we would have a single argument that isn't supposed to be an attribute of the object but a modification of the construction.

In any case we definitely should make that more popular. We do not even use it in Simona at the moment.
-> ie3-institute/simona#460

@sebastian-peter
Copy link
Member

Ok reading more into what seems to be convention around constructors and validation, I'd be fine doing it in the constructor or close to it

@sebastian-peter sebastian-peter removed the good first issue Good for newcomers label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants