I have inherited a load of beans and other class files from a previous developer now he has done some strange things which I just would like to make sure I understand what he is/was doing.
Most of his functions (sorry All) of his functions in non ejb files are set to public static This means that you don't need to create an instance of the class to access the function which means he was not using proper OOP techniques, suggesting he was not doing things in the correct manner.
I would be better creating an instance of the class and then using the functions in the correct manner? What are peoples views on this - I can see how it has made it quicker to call utility functions but the correct way should be to instantiate a class and call the functions from there?
Hey,
It mostly depends on what the static operations have to do. If they don't use any instance variables (e.g via getters, setters) they're utilities and thus static. Although it's not seems to be OO-approach by some I don't see any other way to sort it out other than declaring them as 'public static'.
Show us a sample method with its accompanying class and we'll discuss it in the detail.
Michael Forster
Jacek
