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

[design] when to validate objects #17

Closed
wlandau opened this issue Sep 19, 2020 · 1 comment
Closed

[design] when to validate objects #17

wlandau opened this issue Sep 19, 2020 · 1 comment

Comments

@wlandau
Copy link
Member

wlandau commented Sep 19, 2020

Thanks for drafting the design document, @lawremi.

Early on, you wrote:

Initializing an instance of a class will:

  1. Create the prototype, by either adding the class label to the parent instance or constructing an empty S4SXP,
  2. Merge any given property values, and
  3. Validate and return the result.

I like that we have a dedicated place for validation, but perhaps we should touch base about when we want it to happen. Just concerned about the potential overhead of validating on every initialization.

@mmaechler
Copy link
Collaborator

Good point. Has been quite relevant for S4, too.
I don't know the pre-history, but IIRC, it was important that you could incrementally build an object in a way that validation would not yet happen during the build up.

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

2 participants