Make methods that do not depend on instance fields, static?

Posted by m3th0dman on Programmers See other posts from Programmers or by m3th0dman
Published on 2013-10-29T08:02:44Z Indexed on 2013/10/29 10:17 UTC
Read the original article Hit count: 313

Filed under:
|
|
|
|

Recently I started programming in Groovy for a integration testing framework, for a Java project. I use Intellij IDEA with Groovy plug-in and I am surprised to see as a warning for all the methods that are non-static and do not depend on any instance fields. In Java, however, this is not an issue (at least from IDE's point of view).

Should all methods that do not depend onto any instance fields be transformed into static functions? If true, is this specific to Groovy or it is available for OOP in general? And why?

© Programmers or respective owner

Related posts about java

Related posts about object-oriented