1
I am working on a project and as a base I am using another for reference. However, in this other project almost all methods are declared as static
.
This is good practice?
What are the advantages or disadvantages I have in declaring a method as Static?
It is bad practice to use only static methods in a class?, When it makes sense to have only static methods and attributes in a class? and Main purpose of utility classes
– rray
Stackoverflow’s own double question. http://answall.com/questions/12651/quando-devemos-declarar-um-m%C3%A9todo-como-est%C3%A1tico
– Dante
Thanks for the references. But after reading all this I still get in doubt. Because according to them n is bad practice. And it has considerable gains in some cases. But I’ve never seen a whole system like this. So to me the first view seems n to be correct to create an entire system with Static methods!
– alan
If you still have a specific question, ask the question about that question in a specific way (some very specific point not answered). What was asked is already well answered in these other questions. You can also put a reward on one of them asking for more details.
– Maniero
More: http://answall.com/q/54012/101, http://answall.com/q/103796/101, http://answall.com/q/123974/101,
– Maniero
Thanks @bigown! I’m much more enlightened now and see q n will have problems using static methods. :)
– alan
Depends on how to use, yes, in other cases, no
– Maniero
Yes. I still intend to study a little further by sinking object orientation to clarify myself further and better apply the concepts.
– alan