Hi,
On 11. Aug. 2006, at 16:19, Mike Schrag wrote:
> ..... One thing you can do is add a "// VALID" to the end of the
> binding line, which hints to binding validator that the line in
> question is actually NOT an error ... If this happens a lot,
> though, that can be pretty annoying.
Yes. We have a specific keypath (pointing to entries in a dictionary)
which is being used all over the place. I could have put "// VALID"
everywhere, but then I patched out local copy of WOLips to not check
that specific keypath. Maybe an option (regex?) in the preferences
which allows you to turn off specific keypaths?
> The check for implementing KVC is not a bad idea, except that
> WOComponent implements KVC, so if we did that check, you'd lose all
> WOComponent binding keys, which effectively means you lose ALL
> binding checks, because once you lose any binding in a key path,
> you can't check anything to the right of it.
I would like to add that different classes implement KVC in different
ways, so there could be different validation strategys for different
classes:
- WOComponent: KVC here calls methods defined in its own classes, so
the current validation strategy is fine (missing methods/fields are
flagged as Errors). Except when valueForKey() is overwritten, maybe
change that to Warnings.
- NSDictionary: As there is no way to know the contents of the
dictionary at compile time (except maybe in very special cases with
immutable dictionaries), either flag them as warnings or ignore (but
not errors)
- EOCustomObject: same as WOComponent, check for existance of methods/
fields. Downgrade to Warnings when KVC is overwritten.
- EOGenericRecord: subclass of EOCustomObject, which does NOT
overwrite KVC, but _keyGetBindingForKey() and friends instead. Not
exactly sure what to check here, methods/fields or EOEntity... ?
I have to admit that I didn't use the validation for some time now,
so I don't know how this stuff is implemented in WOLips at the moment.
Marc
This archive was generated by hypermail 2.0.0 : Mon Aug 14 2006 - 08:08:41 EDT