You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Nathan Bubna <nb...@gmail.com> on 2005/02/25 17:26:54 UTC

Re: BrowserSnifferTool.java (and EscapeTool and ArrayTool)

On Fri, 25 Feb 2005 13:58:04 -0000, marino@apache.org <ma...@apache.org> wrote:
> Author: marino
> Date: Fri Feb 25 05:58:01 2005
> New Revision: 155328
> 
> URL: http://svn.apache.org/viewcvs?view=rev&rev=155328
> Log:
> obviously a very useful generic tool ... thanks Claude!
> 
> Added:
>     jakarta/velocity-tools/trunk/src/java/org/apache/velocity/tools/view/tools/BrowserSnifferTool.java

hmm.  ok, so i've been holding off a bit on this tool (and EscapeTool
and ArrayTool) for an opportunity to discuss them.  i don't really
have a lot of time for that at the moment (i'll be out most of the
weekend), but now is apparently the time.  so, i suppose i may as well
pose the questions and see what people say...

BrowserSnifferTool:
this is my least favorite of the three.  the biggest reason being that
it uses Java 1.4's regex stuff, which means we're now dependent on
Java 1.4.   on one level, i'm ok with that.  after all, there is a
newer version of java out, and 1.4 has a lot of good stuff.  the
problem i see is that Velocity itself has not yet required users to
move to 1.4.  this bothers me quite a bit, enough, in fact, that i
think we need to retract this tool and put it in the wiki for now. 
but i don't just want to veto it without some discussion.

EscapeTool:
my only hesitation here is also due to dependencies.  i'm not thrilled
about adding commons-lang as a dep for just this tool.  especially
when you could actually just put an instance of StringEscapeUtils into
the context.  but i do see the use in having a simplified interface to
it along with a few other useful little things.  and this tool does
appear to be well-used by people.  so what do ya'll think?  is it
worth another dependency?  if most people are in favor of it, i'm ok
with adding it for 1.2.

ArrayTool:
this can be very useful and doesn't add any dependencies.  however,
its functionality is stuff on my wishlist for the core.  and deep
down, i fear that adding it to Tools will lower the likelihood someone
will get enough of an "itch" to patch the core.  (and by all that, i
mean making arrays and Lists indistinguishable to a template author). 
hmm.  i wonder if that means we should make the ArrayTool
transparently handle Lists and arrays the same, as a kind of
demonstration for what the core should do (albeit with different
syntax).  anyway, i've pretty much decided i would add this tool, i
just haven't gotten around to it.  :)

ok folks, give me some feedback, will ya? :)

nathan

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: BrowserSnifferTool.java (and EscapeTool and ArrayTool)

Posted by Nathan Bubna <nb...@gmail.com>.
On Fri, 25 Feb 2005 08:26:54 -0800, Nathan Bubna <nb...@gmail.com> wrote:
> On Fri, 25 Feb 2005 13:58:04 -0000, marino@apache.org <ma...@apache.org> wrote:
> > Author: marino
> > Date: Fri Feb 25 05:58:01 2005
> > New Revision: 155328
> >
> > URL: http://svn.apache.org/viewcvs?view=rev&rev=155328
> > Log:
> > obviously a very useful generic tool ... thanks Claude!
> >
> > Added:
> >     jakarta/velocity-tools/trunk/src/java/org/apache/velocity/tools/view/tools/BrowserSnifferTool.java
> 
> hmm.  ok, so i've been holding off a bit on this tool (and EscapeTool
> and ArrayTool) for an opportunity to discuss them.  i don't really
> have a lot of time for that at the moment (i'll be out most of the
> weekend), but now is apparently the time.  so, i suppose i may as well
> pose the questions and see what people say...
> 
> BrowserSnifferTool:
> this is my least favorite of the three.  the biggest reason being that
> it uses Java 1.4's regex stuff, which means we're now dependent on
> Java 1.4.   on one level, i'm ok with that.  after all, there is a
> newer version of java out, and 1.4 has a lot of good stuff.  the
> problem i see is that Velocity itself has not yet required users to
> move to 1.4.  this bothers me quite a bit, enough, in fact, that i
> think we need to retract this tool and put it in the wiki for now.
> but i don't just want to veto it without some discussion.
> 
> EscapeTool:
> my only hesitation here is also due to dependencies.  i'm not thrilled
> about adding commons-lang as a dep for just this tool.  especially
> when you could actually just put an instance of StringEscapeUtils into
> the context.  but i do see the use in having a simplified interface to
> it along with a few other useful little things.  and this tool does
> appear to be well-used by people.  so what do ya'll think?  is it
> worth another dependency?  if most people are in favor of it, i'm ok
> with adding it for 1.2.

nevermind my comments on this one.  as i'm wading thru my morning
email i hadn't yet noticed that Marino's already committed this one. 
for this tool, that's good enough for me to support it.

> ArrayTool:
> this can be very useful and doesn't add any dependencies.  however,
> its functionality is stuff on my wishlist for the core.  and deep
> down, i fear that adding it to Tools will lower the likelihood someone
> will get enough of an "itch" to patch the core.  (and by all that, i
> mean making arrays and Lists indistinguishable to a template author).
> hmm.  i wonder if that means we should make the ArrayTool
> transparently handle Lists and arrays the same, as a kind of
> demonstration for what the core should do (albeit with different
> syntax).  anyway, i've pretty much decided i would add this tool, i
> just haven't gotten around to it.  :)
> 
> ok folks, give me some feedback, will ya? :)
> 
> nathan
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: BrowserSnifferTool.java (and EscapeTool and ArrayTool)

Posted by Shinobu Kawai <sh...@gmail.com>.
> > > ArrayTool:
> > > this can be very useful and doesn't add any dependencies.  however,
> > > its functionality is stuff on my wishlist for the core.  and deep
> > > down, i fear that adding it to Tools will lower the likelihood someone
> > > will get enough of an "itch" to patch the core.  (and by all that, i
> > > mean making arrays and Lists indistinguishable to a template author).
> > > hmm.  i wonder if that means we should make the ArrayTool
> > > transparently handle Lists and arrays the same, as a kind of
> > > demonstration for what the core should do (albeit with different
> > > syntax).  anyway, i've pretty much decided i would add this tool, i
> > > just haven't gotten around to it.  :)
> >
> > Actually, ArrayTool originally treated arrays and Lists the same, but
> > I removed the List part because I thought it should focus on arrays.
> > And you can handle Lists quite well from the template already.
> 
> focus is fine, but i think it better to free developers and template
> authors from bothering over whether a reference is a list or an array.
> IMHO, that shouldn't be a concern in a template, and the core should
> handle both the same transparently.  of course, it doesn't at present,
> but that's all the more reason to make the tool do it.
> 
> > ## But I don't mind putting it back.  ;)
> 
> that'd be great!  and when you do, it should probably be called
> ListTool, because "list" is more commonly understood and more generic
> (at least i think so).

And here it is:
    http://wiki.apache.org/jakarta-velocity/ListTool

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: BrowserSnifferTool.java (and EscapeTool and ArrayTool)

Posted by Nathan Bubna <nb...@gmail.com>.
On Wed, 2 Mar 2005 22:11:10 -0800, Shinobu Kawai
<sh...@gmail.com> wrote:
> Hi Nathan,
> 
> > ArrayTool:
> > this can be very useful and doesn't add any dependencies.  however,
> > its functionality is stuff on my wishlist for the core.  and deep
> > down, i fear that adding it to Tools will lower the likelihood someone
> > will get enough of an "itch" to patch the core.  (and by all that, i
> > mean making arrays and Lists indistinguishable to a template author).
> > hmm.  i wonder if that means we should make the ArrayTool
> > transparently handle Lists and arrays the same, as a kind of
> > demonstration for what the core should do (albeit with different
> > syntax).  anyway, i've pretty much decided i would add this tool, i
> > just haven't gotten around to it.  :)
> 
> Actually, ArrayTool originally treated arrays and Lists the same, but
> I removed the List part because I thought it should focus on arrays.
> And you can handle Lists quite well from the template already.

focus is fine, but i think it better to free developers and template
authors from bothering over whether a reference is a list or an array.
 IMHO, that shouldn't be a concern in a template, and the core should
handle both the same transparently.  of course, it doesn't at present,
but that's all the more reason to make the tool do it.

> ## But I don't mind putting it back.  ;)

that'd be great!  and when you do, it should probably be called
ListTool, because "list" is more commonly understood and more generic
(at least i think so).

> Best regards,
> -- Shinobu
> 
> --
> Shinobu Kawai <sh...@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: BrowserSnifferTool.java (and EscapeTool and ArrayTool)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Nathan,

> ArrayTool:
> this can be very useful and doesn't add any dependencies.  however,
> its functionality is stuff on my wishlist for the core.  and deep
> down, i fear that adding it to Tools will lower the likelihood someone
> will get enough of an "itch" to patch the core.  (and by all that, i
> mean making arrays and Lists indistinguishable to a template author).
> hmm.  i wonder if that means we should make the ArrayTool
> transparently handle Lists and arrays the same, as a kind of
> demonstration for what the core should do (albeit with different
> syntax).  anyway, i've pretty much decided i would add this tool, i
> just haven't gotten around to it.  :)

Actually, ArrayTool originally treated arrays and Lists the same, but
I removed the List part because I thought it should focus on arrays. 
And you can handle Lists quite well from the template already.

## But I don't mind putting it back.  ;)

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: BrowserSnifferTool.java (and EscapeTool and ArrayTool)

Posted by Mike Kienenberger <mk...@alaska.net>.
Nathan Bubna <nb...@gmail.com> wrote:
> EscapeTool:
> my only hesitation here is also due to dependencies.  i'm not thrilled
> about adding commons-lang as a dep for just this tool.  especially
> when you could actually just put an instance of StringEscapeUtils into
> the context.  but i do see the use in having a simplified interface to
> it along with a few other useful little things.  and this tool does
> appear to be well-used by people.  so what do ya'll think?  is it
> worth another dependency?  if most people are in favor of it, i'm ok
> with adding it for 1.2.

I know this was the primary reason for delaying the tool, and normally I'd 
agree, but escaping stuff is almost a requirement for most "safe" uses of 
templating.  I'd say put it in, but document that you need the Commons Lang 
dependency only if you're using EscapeTool.

-Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org