tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Baker <jba...@teamenergy.com>
Subject Static constants
Date Tue, 19 Mar 2002 09:18:15 GMT
Apologies if I've sent this already, but I didn't get a mail back so I'm 
assuming it never got there ;-)

----------  Forwarded Message  ----------

Subject: Re: My last annoying question of the day, promise.:-)
Date: Mon, 18 Mar 2002 20:29:02 +0000
From: John Baker <jbaker@teamenergy.com>
To: "Tag Libraries Users List" <taglibs-user@jakarta.apache.org>

On Monday 18 Mar 2002 18:41 pm, you wrote:
> Just don't...  ;-)
>
> Good Java style dictates that you keep everything as private as possible,
> certainly class variables and then use methods to get and set them, like
> getY and setY.

Yes, I understand good Java style (having done it for so long), however
public static variables are common place and useful. I wouldn't ever want to
provide get methods for these as it's clearly evil ;-)

For example, I have a servlet that takes two parameters, A and B. I don't
want to do:

moo?a=Whatever&b=whatever,

as I might, one day, want to change the names of the parameters of A and B.
Therefore I use public statics in the servlet to store the names of these
attributes. Ie:

moo?<%= MyServlet.A %>=Whatever

*much* nicer when you're writing generic components.

However it looks like I have no choice :(

That's a real minus point for JSTL.


John

--
John Baker, BSc CS.
Java Developer, TEAM Slb. (http://www.teamenergy.com/)
The views expressed in this mail are my own.

-------------------------------------------------------

-- 
John Baker, BSc CS.
Java Developer, TEAM Slb. (http://www.teamenergy.com/)
The views expressed in this mail are my own.

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message