instance variable as a means for passing method args


Performance and scalability: instance variable as a means for passing method args

  1. if methA() needs to call methB() passing variable "a" as argument, instead of making syntax of methB as methB(a), an instance variable is declared which would be updated by methA() and methB(). my personal opinion is not to use instance variables as a way of passing arguments. ( Please suggest plus & minus points. Thanks, Hari Sujathan
  2. Isn't that covered in the first ten pages of every intro to OO programming book? It's retarded. Of course you shouldn't do that. Instance variables and method arguments are completely different concepts. It's also not thread safe.
  3. If your are working alone thats fine but when multiple entities access your class you will be under a serious spell of multithreaded demon.Think....the things you are talking of are ages old and simple forgotten.No need to dig graves. cheers,
  4. Yes, use of instance variables is concern when using threaded apps. Also ejbs, tapestry etc.. heap size increase. From performance point also I believe it slows down things. any more comments?