Static reference

Hi All,

I am developing a small Java plugin for an application.

My plugin's main () gets intiated by the batch process.

Now in doing this i have methods called from main() which are

also coming as static.All the member variables which i need across the methods are therefore coming as Static.

I can do the same thing by distributing the logic into other classes

and avoid the static references.Now my concern is using too

many static references a Bad coding practice ? or how would

it affect the performance by memory wise etc.

[584 byte] By [java_jamboreea] at [2007-11-27 10:03:18]
# 1

Why do you feel that all the variables have to be static? Okay, so main is static but that does not mean this should effect the rest of the code. You should be creating an instance of your class and working with this. Static is not just bad use of memory, it is bad design. All your variables should be declared in the smallest scope possible.

_helloWorld_a at 2007-7-13 0:38:15 > top of Java-index,Java Essentials,Java Programming...
# 2
thanks mate that was the answer i was looking for....
java_jamboreea at 2007-7-13 0:38:15 > top of Java-index,Java Essentials,Java Programming...