You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Viktor Szathmary <ph...@imapmail.org> on 2003/03/07 22:45:11 UTC

RE: template expression notation

hi,

i understand your concerns, but i think whatever decision is made on
this, will be pretty much final for quite a while... i think it would
benefit tapestry in the long run that the syntax is nice to look at, as
newcomers' first impressions will be based on this. i propose an opinion
poll about the notation:

a) ognl:expression
b) :expression
c) [[ expression ]]
d) $expression

although i'm not a commiter, but since this is just a poll, here are my
votes :)
a) -0
b) +0
c) -1
d) +1

    viktor

On Fri, 7 Mar 2003 15:19:50 -0500, "Howard M. Lewis Ship"
<hl...@attbi.com> said:
> Things are moving pretty quickly in the Tapestry space.  The input I
> received from the list was that "[[ ... ]]" was bad, and "{{ ... }}" was
> worse. I made a "command decision" (since I'm the one making the changes,
> updating the tests and doing the documentation) that "ognl:" was the
> right
> way to go.  I don't want anyone to feel left out, but I needed to
> standardize on something, because I'm working in parallel, getting 2.4
> finished AND writing a book about it, so I can't keep gong back and
> forth.
> 
> I'll keep an eye towards making it easy to subclass things so that you
> can
> establish your own styles.  That is, if you really think there is a
> developer benefit to using "$expression" instead of "ognl:expression",
> you
> will be able to create a custom TemplateParser with that functionality.
> 

-- 
http://www.fastmail.fm - I mean, what is it about a decent email service?

Re: template expression notation

Posted by Luis Neves <ln...@netcabo.pt>.
This can turn into a "bikeshed" type of discussion really fast.

On Friday 07 March 2003 21:45, Viktor Szathmary wrote:
> hi,
>
> i understand your concerns, but i think whatever decision is made on
> this, will be pretty much final for quite a while... i think it would
> benefit tapestry in the long run that the syntax is nice to look at,

Beauty is in the eyes of the beholder. I, for example, hate the $ symbol, its 
the main reason that makes reading PHP a puke inducing experience (Oh ... and 
before you say it, PHP is popular.. yes, but PHP popularity is more due to 
availability and easy of use than "nice to look at" syntax).

What I'm trying to say is that there may exist compelling reasons that make 
the "$expression" syntax better than  the "ognl:expression" syntax, but "nice 
to look at" is subjective enough that doesn't qualify as one of those 
reasons.

Apparently Howard plans to make possible the use of different expression 
languages, so whatever syntax we end up with it must make clear what is the 
EL being used and must be terse enough to not become a bother, in **my** 
opinion the "ognl:expression" syntax does just that and the "$expression" 
does 50% of what's necessary.

Best regards,
Luis Nieves




Re: template expression notation

Posted by Drew Davidson <dr...@ognl.org>.
Viktor Szathmary wrote:

>hi,
>
>i understand your concerns, but i think whatever decision is made on
>this, will be pretty much final for quite a while... i think it would
>benefit tapestry in the long run that the syntax is nice to look at, as
>newcomers' first impressions will be based on this. i propose an opinion
>poll about the notation:
>
>a) ognl:expression
>b) :expression
>c) [[ expression ]]
>d) $expression
>  
>
I'm not sure why Howard used the [[ ]] syntax in the first place...was a 
single bracket not enough?

I'm using a syntax that can have literal strings or ognl expressions in XML:

<ognl:out value="This is a literal string"/>

will produce exactly the value shown

<ognl:out value="[ foo.bar ]"/>

will evaluate "foo.bar" as an expression with the current component as 
the root object.  I've used this for quite some time and I think it's 
both readable (I like to delimit expressions from brackets with a single 
space) and quick to mentally "parse".

It's a good idea to think ahead to using other expression languages and 
the "ognl:" syntax allows for this on a case-by-case basis.  However, in 
practical terms it won't be an issue, because no one ever gets around to 
actually plugging in another expression language :-)  Even if someone 
does the majority of people will still use ognl because other EL's will 
probably be special-purpose (like jxpath).  Therefore do you want to 
redundantly write 5 characters per expression (ognl:) times number of 
expressions filling up your templates?  Having a "default" expression 
language and then using the :expression syntax would reduce visual 
clutter and increase readability.

I'd say +1 on ognl:expression and :expression (as equivalent to 
ognl:expression).

- Drew

-- 
+---------------------------------+
< Drew Davidson | OGNL Technology >
+---------------------------------+
|  Email: drew@ognl.org          /
|    Web: http://www.ognl.org   /
|    Vox: (520) 531-1966       <
|    Fax: (520) 531-1965        \
| Mobile: (520) 405-2967         \
+---------------------------------+




Re: template expression notation

Posted by Holger Hoffstätte <ho...@wizards.de>.
Eric Everman wrote:
> I tend to think people have had their opportunity to chime in on this.  If
> that is *not* the case, SPEAK UP NOW.

Well, I don't have a vote but also agree that having the language
identifiable in the expression prefix is important for readability and
extensibility. Another reason might be easier automagic creation and
parsing of mappings. ognl: sounds like a good start to me.

-h

RE: template expression notation

Posted by Viktor Szathmary <ph...@imapmail.org>.
hi,

On Fri, 07 Mar 2003 18:02:35 -0600, "Eric Everman"
<ev...@precedadesign.com> said:

> For Demo ::".  I think single characters are probably not unique enough.

ok, point taken

> Second, I agree with Howard that the expression layer should be 
> pluggable.  I believe there should be a default for an implementation 

i don't neccessarily agree, that everyone defining their own dialect is
such a great thing... it has to work out when integrating tapestry
libraries too, and imho it might make it harder to touch these
components, if they use their own syntax.. in the end everybody will
stick to the default anyway of course.. :)

> I tend to think people have had their opportunity to chime in on this. 
> If that is *not* the case, SPEAK UP NOW.

i'm sorry if i'm late.. last time i checked it was still [[ ... ]] :)

    viktor


-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again

RE: template expression notation

Posted by Eric Everman <ev...@precedadesign.com>.
Viktor,

Personally, I'm OK with Howard's "ognl:" syntax, though I would prefer 
"exp:".  I agree that the expression syntax is an entry point for 
beginners, so its implementation is important, but there are some problems 
with solutions other then "ognl:".

First off, the prefix must be unique enough that it won't clash with 
informal parameters you might really want to include.  For instance, an img 
tag's alt attribute may really need to be "$4.95 Order NOW!" or ":: Click 
For Demo ::".  I think single characters are probably not unique enough.

Second, I agree with Howard that the expression layer should be 
pluggable.  I believe there should be a default for an implementation 
neutral prefix like "exp:", Howard would rather leave this as a more 
advanced option thus requiring (for the most part) an explicit prefix like 
"ognl:".  I'm OK with this, especially given that A4 has just been released.

I tend to think people have had their opportunity to chime in on this.  If 
that is *not* the case, SPEAK UP NOW.

Eric Everman




At 3/7/2003, you wrote:
>hi,
>
>i understand your concerns, but i think whatever decision is made on
>this, will be pretty much final for quite a while... i think it would
>benefit tapestry in the long run that the syntax is nice to look at, as
>newcomers' first impressions will be based on this. i propose an opinion
>poll about the notation:
>
>a) ognl:expression
>b) :expression
>c) [[ expression ]]
>d) $expression
>
>although i'm not a commiter, but since this is just a poll, here are my
>votes :)
>a) -0
>b) +0
>c) -1
>d) +1
>
>     viktor
>
>On Fri, 7 Mar 2003 15:19:50 -0500, "Howard M. Lewis Ship"
><hl...@attbi.com> said:
> > Things are moving pretty quickly in the Tapestry space.  The input I
> > received from the list was that "[[ ... ]]" was bad, and "{{ ... }}" was
> > worse. I made a "command decision" (since I'm the one making the changes,
> > updating the tests and doing the documentation) that "ognl:" was the
> > right
> > way to go.  I don't want anyone to feel left out, but I needed to
> > standardize on something, because I'm working in parallel, getting 2.4
> > finished AND writing a book about it, so I can't keep gong back and
> > forth.
> >
> > I'll keep an eye towards making it easy to subclass things so that you
> > can
> > establish your own styles.  That is, if you really think there is a
> > developer benefit to using "$expression" instead of "ognl:expression",
> > you
> > will be able to create a custom TemplateParser with that functionality.
> >
>
>--
>http://www.fastmail.fm - I mean, what is it about a decent email service?
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org