You dont necessarily need to do it. Actually, its pretty stupid advice in my opinion, because it encourages you to mark it as static
, while you might not want it static !
Static methods
just make the method
accessible even without instanciating
an object
.
Consider the following snippet :
Foo _bar = new Foo();
_bar.RandomMethod();// not necessarily static
Foo.RandomMethod();//Foo is the class, and RandomMethod is static.
My advice would be, dont follow that message, and just do as your design is telling you :).
If you feel its right to require
an object
, dont mark it as static
. If you find its coherent to be able to call this method
without an object
, mark is as static