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

remove public Fields access #88

Open
meltzow opened this issue Jun 24, 2015 · 0 comments
Open

remove public Fields access #88

meltzow opened this issue Jun 24, 2015 · 0 comments

Comments

@meltzow
Copy link
Collaborator

meltzow commented Jun 24, 2015

using public fields in classes are bad practice. Is is very hard to use a class if every field and method is public, because everything is changeable and useable. We need a encapsulation of functions.
With Eclipse refactoring support, generation of getters and setter are possible. A good workflow is, change the field to private (without refactoing) and use quickfixes to use the getters/setters.
While refactoring please take some seconds and think about the fields and his visibility. Private is not the only way. We are implementing a framework which needs to be extends with overriding classes. Somethings there is a need for protected fields.

see more info: https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant