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

Generics for 'MetaBean' and 'MetaProperty' #6

Open
nipafx opened this issue Dec 15, 2014 · 3 comments
Open

Generics for 'MetaBean' and 'MetaProperty' #6

nipafx opened this issue Dec 15, 2014 · 3 comments

Comments

@nipafx
Copy link
Collaborator

nipafx commented Dec 15, 2014

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?

@jodastephen
Copy link
Owner

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.

@nipafx
Copy link
Collaborator Author

nipafx commented Jan 4, 2015

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?

@jodastephen
Copy link
Owner

Lets try the full generics version, <B> on MetaBeans and <B,P> on MetaProperty, as its basically the "right" thing.

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