struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yansheng Lin" <>
Subject RE: [OT] Use of Static Methods
Date Wed, 09 Jul 2003 15:53:28 GMT
Depends on what you want to do. 'static' classes are loaded, not instantiated.
And you are saying you want to factor out common code and marked as 'static'.  I
cannot think of any reason not to.  Just make sure it's thread-safe.

Note there is a difference between Singleton and static.  Struts Action classes
are singleton.  

-----Original Message-----
From: Jerry Jalenak [] 
Sent: July 9, 2003 9:29 AM
To: ''
Subject: [OT] Use of Static Methods

One of my programmers asked me whether or not it is OK to define helper
methods as 'static' - and I realized that I didn't know the answer.  So I
guess the question is, in a web application, can common code be factored out
to a helper class and marked as 'static'?  Are there any major problems with
doing this?  I should know the answer, but just can't put my thumb on it
right now.... 8)


Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

This transmission (and any information attached to it) may be confidential and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible for
delivering the transmission to the intended recipient, be advised that you have
received this transmission in error and that any use, dissemination, forwarding,
printing, or copying of this information is strictly prohibited. If you have
received this transmission in error, please immediately notify LabOne at the
following email address:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message