Using static methods in JavaBeans

Hi:

I am creating several beans as part of my application. Is it ok, to make all of them static (no global variables are used) and access in JSP's and Servlets as XXBean.method(var1, var 1). Is this a problem ? (vs creating a new XXBean and using it in every page/servlet).

I have gut feeling that static methods are better and give better memory usage and performance - as oppose in other scenario I am creating a new Bean for every page access - could not verify. and not sure not creating (new Bean) would give any problems.

Thanks for sharing.

[574 byte] By [rpaturia] at [2007-10-2 23:14:25]
# 1
Learn the JavaBean tutorial before you start to develop it.
sasi2103a at 2007-7-14 6:28:42 > top of Java-index,Desktop,Developing for the Desktop...
# 2
Try the following forum (about JSP technology) http://forum.java.sun.com/forum.jspa?forumID=45
UncleSAMa at 2007-7-14 6:28:42 > top of Java-index,Desktop,Developing for the Desktop...
# 3

I think you mixed up JavaBeans and Enterprise JavaBeans (EJBs) ...

I think Sun Microsystems really named them badly ...

They are in fact totally different things ...

I agree with them.

Please read the tutorials first.

Asuka Kenji (UserID = 289)

(Duke Dollar Hunting now ...)

kennethza at 2007-7-14 6:28:42 > top of Java-index,Desktop,Developing for the Desktop...