You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We already discussed why MetaProperty.set(Object, Object) is not MetaProperty.set(Object, P): because frameworks will routinely deal with MetaProperty<?> making set(Object, ?) unusable; (~> details).
I guess the answer for why MetaBean and MetaProperty are not generic in the bean's type (i.e. MetaBean<B> and MetaProperty<B, P>) is along the same lines but I still can't really come up with it.
Especially if the corresponding methods are either using object (like get(Object) or set(Object, Object) or wildcards (like Class<?> MetaProperty.declaringType()), I can't see a reason against it. Or on favor for that matter: MetaProperty<P> could as well be "ungeneric" . Why the middle ground?
The text was updated successfully, but these errors were encountered:
My previous experience showed that they caused more pain than gain. However, it is something we should try and see how it works out. So long as use in frameworks isn't impeded and it could provide benefit to some, its worth a go.
Now that #4 is merged I consider trying this out. I'd basically create two branches and implement both the more and the less generic version. Up- and downsides could be discussed in the pull requests.
Do you think now is a good time or should I wait until some more code exists, namely implementations of MetaBean and the builders for MetaProperty?
We already discussed why
MetaProperty.set(Object, Object)
is notMetaProperty.set(Object, P)
: because frameworks will routinely deal withMetaProperty<?>
makingset(Object, ?)
unusable; (~> details).I guess the answer for why
MetaBean
andMetaProperty
are not generic in the bean's type (i.e.MetaBean<B>
andMetaProperty<B, P>
) is along the same lines but I still can't really come up with it.Especially if the corresponding methods are either using object (like
get(Object)
orset(Object, Object)
or wildcards (likeClass<?> MetaProperty.declaringType()
), I can't see a reason against it. Or on favor for that matter:MetaProperty<P>
could as well be "ungeneric" . Why the middle ground?The text was updated successfully, but these errors were encountered: