-
Notifications
You must be signed in to change notification settings - Fork 105
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
Reduce necessary visibilty of initialize in the ViewModel to package private #332
Comments
This is only true when the method is annotated with To be fully complient with the default JavaFX initialization logic we would need to invoke a protected/package/private initialize method only when the From my point of view the default behaviour with the annotation makes sense: As a developer If you make the method public you express that you expect it to be invoked from outside. The same is true if you add the annotation. It's a clear hint that you want this method to be invoked by the framework. For So from my point of view we have 4 options here:
An additional downside of 2) is that it's a breaking API change. If a developer already has a From my point of view it's not a big problem to make the initialize method public. For this reason I would prefer option 1). I'm sorry for @sirwindfield because you have already provided a pull request for this issue but I think this issue needs further discussion before we add new code. |
No problem at all. I am fine with it :) Didn't took that long either. I can understand your point of view here. Makes sense.
Two labels would be enough here is guess, something along the lines of |
Sorry, I totally missed this comment. Your proposal for a new annotation is what I mentioned in Point 3. This would be fine for me because it won't break existing code that doesn't has this annotation. |
…nitialize_ViewModel_method Added @initialize annotation for ViewModel to define initialize method of any visibility #332
public void initialize() {
openDialog();
}
in the ViewModel has to be public to be called. This is not necessary and the initialize method in FXML Views also works with package private visibility
The text was updated successfully, but these errors were encountered: