-
Notifications
You must be signed in to change notification settings - Fork 44
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
Rename @PropertyNames to @FactoryProperties #41
Comments
Actually I also have thought about @PropertyNames and @ConstructorProperties. I didn't like it that two annotations are used for the same thing. My solution looks different to yours - but perhaps you agree with me? I would remove the use of the @ConstructorProperties annotation completely and instead only support @PropertyNames for both locations (Constructor & Factory Method). For the sake of backward compatability we could support the @ConstructorProperties annotation for a short while. I would prefer this instead of having two different annotations since both annotations just mean the same. One annotation is sufficient. Comments? |
Just another thought: The adjustment of @ParameterNames is unwieldy and error-prone when parameter positions are changed during a refactoring. Having a by-parameter annotation (like @QueryParam) would solve this. We could go into that direction... |
@ConstructorProperties is used for precisely what PB requires. If a class has (or needs) it, PB must follow the mappings given by @ConstructorProperties. I don't see how you could replace it, end-users would end up with a constructor that has both a PB-specific and @cp annotations which would be truly horrible. @PropertyNames applies the same contract to factory methods which makes sense. @FactoryProperties simply brings the name (and hence, expectation of usage) in line.
|
I am still not convinced that staying with Mostly is has to do with the fact that I find it really handy to have an annotation on a per-param basis. But I also see your point. Perhaps if we implemented the "implicit naming" feature (issue #42), then we possibly could expect that the need for annotating the parameters decreases anyway. Hmm... |
Well, let's go for it. (PS: I think I could introduce another parameter-based annotation later) |
@PropertyNames is specific to factory-method builders. I strongly favour @FactoryProperties, in keeping with @ConstructorProperties (principle of least surprise).
Marc
The text was updated successfully, but these errors were encountered: