You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Kevin Menard <km...@servprise.com> on 2005/08/12 05:46:14 UTC

Tapestry 3 bindings in Tapestry 4?

Hi guys,

Just as a preface, I'm really not trying to be a pain in the neck --  
I'm just trying to make my code as clean and easy as I possibly can.

Dumping default bindings meant my components went from something like:

     <component id="email" type="TextField">
         <binding name="displayName" value="E-mail Address"/>
         <binding name="validators" value="required, email"/>
         <binding name="value" value="email"/>
     </component>


to:

     <component id="email" type="TextField">
         <binding name="displayName" value="literal:E-mail Address"/>
         <binding name="validators" value="validators:required, email"/>
         <binding name="value" value="email"/>
     </component>

I'd have to say that I think I actually prefer the different binding  
tags in 3.0.  I think the following is generally easier to read:

     <component id="username" type="ValidField">
         <static-binding name="displayName" value="E-mail Address"/>
         <binding name="validator" expression="beans.required"/>
         <binding name="value" expression="email"/>
     </component>

At least in Tapestry 3, values were values and expressions were  
expressions.

So, I guess my question is, how much trouble would I be getting  
myself into if I tried combining these binding elements into the 4.0  
DTD?  I really like what Tapestry 4 is doing is general, but this is  
looking to be a potential show stopper for me.  Once again, I'm not  
looking to reopen the default binding can of worms.  It seems that  
ship has sailed, so now I'm just trying to find the next best thing  
without being ridiculously verbose.

Thanks,
Kevin

Re: Tapestry 3 bindings in Tapestry 4?

Posted by Paul Ferraro <pa...@gmail.com>.
Yes - you can still use quotes around a literal, e.g.
<binding name="displayName" value="'E-mail Address'"></binding>
<binding name="displayName">'E-mail Address'</binding>

... but then the value is parsed as an ognl expression and the 
performance benefit of the new literal binding is lost.
This was one of my arguments for making literal the default binding in 
specifications.

Paul

Jamie Orchard-Hays wrote:

> And can't you use quotes around a literal, instead of "literal:" as a  
> prefix? I did that a lot in 3.0 anyway.
>
>
> On Aug 12, 2005, at 9:39 AM, Howard Lewis Ship wrote:
>
>> How about:
>>
>>         <binding name="displayName">literal:E-mail Address</binding>
>>         <binding name="validators" value="validators:required,  email"/>
>>         <binding name="value" value="email"/>
>>
>> This is legal in 4.0 as well.
>>
>> On 8/12/05, Kevin Menard <km...@servprise.com> wrote:
>>
>>> Howard Lewis Ship wrote:
>>>
>>>> -1
>>>>
>>>> Trying to simplify, simplify, simplify the XML.  And you should be
>>>> using message: for your displayName.
>>>>
>>>
>>> I can certainly empathize with that, but it seems the cost of  
>>> simplified
>>> XML is harder to read values.  Now, I do like that I don't really  have
>>> to think about what tag to use and that I can swap bindings out  
>>> without
>>> changing XML.  But, at least my values weren't a mess to look at.
>>>
>>> Furthermore, being human and all, I can see myself making a typo on a
>>> binding name here and there.  When the type of binding was an XML  tag,
>>> validating against the DTD caught such errors quickly.  Now I need to
>>> actually deploy, navigate to the page, see the error, go back and see
>>> what's wrong, make the fix, redeploy, navigate to the page again, and
>>> see that the error was fixed.
>>>
>>> I would even be for having a type attribute in the binding tag.
>>> Something that separates the data from its data source (limiting the
>>> potential errors introduced when trying to modify one or the  other) 
>>> and
>>> could still be validated.  For user created bindings, I guess  you'd 
>>> have
>>> to set the type to "user" or something, and specify the actual  binding
>>> in the value, which won't gain you a whole lot.  However, I think  this
>>> solution will work pretty well in the general case.
>>>
>>> As for the i18n stuff, you're probably correct, but my little sandbox
>>> webapp really hasn't merited.  I think the spirit of my post  generally
>>> remains unaffected by this though.
>>>
>>> -- 
>>> Kevin
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>>
>>>
>>>
>>
>>
>> -- 
>> Howard M. Lewis Ship
>> Independent J2EE / Open-Source Java Consultant
>> Creator, Jakarta Tapestry
>> Creator, Jakarta HiveMind
>>
>> Professional Tapestry training, mentoring, support
>> and project work.  http://howardlewisship.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>


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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Jamie Orchard-Hays <ja...@dang.com>.
And can't you use quotes around a literal, instead of "literal:" as a  
prefix? I did that a lot in 3.0 anyway.


On Aug 12, 2005, at 9:39 AM, Howard Lewis Ship wrote:

> How about:
>
>         <binding name="displayName">literal:E-mail Address</binding>
>         <binding name="validators" value="validators:required,  
> email"/>
>         <binding name="value" value="email"/>
>
> This is legal in 4.0 as well.
>
> On 8/12/05, Kevin Menard <km...@servprise.com> wrote:
>
>> Howard Lewis Ship wrote:
>>
>>> -1
>>>
>>> Trying to simplify, simplify, simplify the XML.  And you should be
>>> using message: for your displayName.
>>>
>>
>> I can certainly empathize with that, but it seems the cost of  
>> simplified
>> XML is harder to read values.  Now, I do like that I don't really  
>> have
>> to think about what tag to use and that I can swap bindings out  
>> without
>> changing XML.  But, at least my values weren't a mess to look at.
>>
>> Furthermore, being human and all, I can see myself making a typo on a
>> binding name here and there.  When the type of binding was an XML  
>> tag,
>> validating against the DTD caught such errors quickly.  Now I need to
>> actually deploy, navigate to the page, see the error, go back and see
>> what's wrong, make the fix, redeploy, navigate to the page again, and
>> see that the error was fixed.
>>
>> I would even be for having a type attribute in the binding tag.
>> Something that separates the data from its data source (limiting the
>> potential errors introduced when trying to modify one or the  
>> other) and
>> could still be validated.  For user created bindings, I guess  
>> you'd have
>> to set the type to "user" or something, and specify the actual  
>> binding
>> in the value, which won't gain you a whole lot.  However, I think  
>> this
>> solution will work pretty well in the general case.
>>
>> As for the i18n stuff, you're probably correct, but my little sandbox
>> webapp really hasn't merited.  I think the spirit of my post  
>> generally
>> remains unaffected by this though.
>>
>> --
>> Kevin
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>>
>>
>
>
> -- 
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Jakarta Tapestry
> Creator, Jakarta HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>


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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Jesse Kuhnert <jk...@gmail.com>.
I did in my project for permission checking :)

On 8/12/05, Robert Zeigler <rd...@u.arizona.edu> wrote:
> If tapestry was going to distinguish the binding type
> from the attribute name, then yes, because you'd have to
> have a unique attribute name, which means that you have to have the
> attribute name declared in the DTD since tapestry uses a validating
> parser. A possible workaround for custom types would be something like:
> 
> <binding name="foo" custom="prefix:value"/>
> 
> But then, really, we're back where we started, right? :)
> 
> Or... perhaps the binding prefix could stay for value...
> Then you could have attributes for the framework-defined
> binding types, and still have the prefix-method around
> for custom-types?  In all reality, how often are people
> /really/ going to define their own binding types?
> 
> Robert
> 
> Jamie Orchard-Hays wrote:
> > Right--that was the problem Howard mentioned. Would we actually need
> > custom types in the DTD, or is that just a convenience?
> >
> > Jamie
> > On Aug 12, 2005, at 12:18 PM, Robert Zeigler wrote:
> >
> >> Jamie Orchard-Hays wrote:
> >>
> >>> The brief history is that at first people thought the default   bindings
> >>> would be a good idea, but in use a lot of developers kept  getting
> >>> confused--"is it literal? Is it ognl? What is it?" So, after  a  lot of
> >>> discussion on the list, we voted an agreed to move to  clarity and
> >>> consistency over terseness. I suggested using:
> >>>
> >>> <binding name="foo" expression="bar"  OR value="bar" OR
> >>> validators="bar">
> >>>
> >>> as a way to enjoy terseness, clarity and DTD completion/ validation,
> >>> but
> >>> I believe that Howard said there was a problem with this approach.
> >>>
> >>> Jamie
> >>>
> >>
> >> The issue with this approach is that every time you add a binding  type,
> >> you have to extend the DTD.  Which makes it very difficult for  users to
> >> add custom binding types, etc.
> >>
> >> Robert
> >>
> >>
> >>
> >>>
> >>>
> >>> On Aug 12, 2005, at 10:17 AM, Kevin Menard wrote:
> >>>
> >>>
> >>>> Howard Lewis Ship wrote:
> >>>>
> >>>>
> >>>>> How about:
> >>>>>
> >>>>>         <binding name="displayName">literal:E-mail Address</ binding>
> >>>>>         <binding name="validators" value="validators:required,
> >>>>> email"/>
> >>>>>         <binding name="value" value="email"/>
> >>>>>
> >>>>> This is legal in 4.0 as well.
> >>>>>
> >>>>>
> >>>>
> >>>> It seems like it might be a bit easier to read.  It's still overly
> >>>> verbose and prone to typos.  I guess packing two bits of
> >>>> information in
> >>>> a single string just really doesn't sit very well with me.  I  think it
> >>>> makes the whole thing harder to read.  In order to really
> >>>> understand it,
> >>>> I have to find the first ':' and separate the two entities in my  head.
> >>>> It's a mental step that really isn't necessary if they were just  split
> >>>> out to begin with.  Additionally, by explicitly splitting them up
> >>>> there's really no way to screw that mental step up.  I just have  this
> >>>> sinking feeling that trying to represent two pieces of data in a
> >>>> single
> >>>> unit is going to cause more room for error than if the two were  dealt
> >>>> with in isolation.
> >>>>
> >>>> So, I see there being a mental block any time someone needs to
> >>>> read  the
> >>>> value, which is going to cost everyone time every time they read
> >>>> it, at
> >>>> the cost of saving the initial writer a few seconds of typing if  there
> >>>> were an actual "type" attribute.  I also see an increased risk  of
> >>>> typos
> >>>> that won't be caught until runtime, which will also lower
> >>>> productivity.
> >>>>
> >>>> Perhaps I'm missing something here?  I'm not really sure what we're
> >>>> gaining but I can certainly see what we're losing.  I'll admit to  not
> >>>> having used Tapestry on any huge in production webapps and my total
> >>>> experience with the framework has only been about a year, so  maybe my
> >>>> lack of experience is somehow a roadblock.
> >>>>
> >>>> Also, please don't take this as a crap on all your work.  I am
> >>>> generally
> >>>> very pleased with Tapestry 4 and I have nothing but the utmost  respect
> >>>> for you folks that are pouring all this energy into making  Tapestry a
> >>>> better product.
> >>>>
> >>>> Thanks,
> >>>> Kevin
> >>>>
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------- -
> >>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> >>>> For additional commands, e-mail: tapestry-dev- help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> >>>
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
>

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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Kevin Menard <km...@servprise.com>.
On Aug 12, 2005, at 12:55 PM, Robert Zeigler wrote:

>  A possible workaround for custom types would be something like:
>
> <binding name="foo" custom="prefix:value"/>
>
> But then, really, we're back where we started, right? :)
>

This what I had suggested with my type attribute.  So generally,  
you'd have:

<binding name="hey" type="literal" value="Some text"/>

for custom bindings, it would be something like:

<binding name="hey" type="custom" value="custom_prefix:value"/>

That would allow the DTD to work fine with the built-in types.  As  
for the custom ones, I'm not really sure the framework could offer  
you much help anyway.  I am with you though, I don't think there's a  
terrible need to provide your own binding.  I think Tapestry should  
certainly support it, but not at the clear majority use case's expense.

-- 
Kevin


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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Robert Zeigler <rd...@u.arizona.edu>.
If tapestry was going to distinguish the binding type
from the attribute name, then yes, because you'd have to
have a unique attribute name, which means that you have to have the
attribute name declared in the DTD since tapestry uses a validating
parser. A possible workaround for custom types would be something like:

<binding name="foo" custom="prefix:value"/>

But then, really, we're back where we started, right? :)

Or... perhaps the binding prefix could stay for value...
Then you could have attributes for the framework-defined
binding types, and still have the prefix-method around
for custom-types?  In all reality, how often are people
/really/ going to define their own binding types?

Robert

Jamie Orchard-Hays wrote:
> Right--that was the problem Howard mentioned. Would we actually need 
> custom types in the DTD, or is that just a convenience?
> 
> Jamie
> On Aug 12, 2005, at 12:18 PM, Robert Zeigler wrote:
> 
>> Jamie Orchard-Hays wrote:
>>
>>> The brief history is that at first people thought the default   bindings
>>> would be a good idea, but in use a lot of developers kept  getting
>>> confused--"is it literal? Is it ognl? What is it?" So, after  a  lot of
>>> discussion on the list, we voted an agreed to move to  clarity and
>>> consistency over terseness. I suggested using:
>>>
>>> <binding name="foo" expression="bar"  OR value="bar" OR  
>>> validators="bar">
>>>
>>> as a way to enjoy terseness, clarity and DTD completion/ validation, 
>>> but
>>> I believe that Howard said there was a problem with this approach.
>>>
>>> Jamie
>>>
>>
>> The issue with this approach is that every time you add a binding  type,
>> you have to extend the DTD.  Which makes it very difficult for  users to
>> add custom binding types, etc.
>>
>> Robert
>>
>>
>>
>>>
>>>
>>> On Aug 12, 2005, at 10:17 AM, Kevin Menard wrote:
>>>
>>>
>>>> Howard Lewis Ship wrote:
>>>>
>>>>
>>>>> How about:
>>>>>
>>>>>         <binding name="displayName">literal:E-mail Address</ binding>
>>>>>         <binding name="validators" value="validators:required,  
>>>>> email"/>
>>>>>         <binding name="value" value="email"/>
>>>>>
>>>>> This is legal in 4.0 as well.
>>>>>
>>>>>
>>>>
>>>> It seems like it might be a bit easier to read.  It's still overly
>>>> verbose and prone to typos.  I guess packing two bits of  
>>>> information in
>>>> a single string just really doesn't sit very well with me.  I  think it
>>>> makes the whole thing harder to read.  In order to really  
>>>> understand it,
>>>> I have to find the first ':' and separate the two entities in my  head.
>>>> It's a mental step that really isn't necessary if they were just  split
>>>> out to begin with.  Additionally, by explicitly splitting them up
>>>> there's really no way to screw that mental step up.  I just have  this
>>>> sinking feeling that trying to represent two pieces of data in a  
>>>> single
>>>> unit is going to cause more room for error than if the two were  dealt
>>>> with in isolation.
>>>>
>>>> So, I see there being a mental block any time someone needs to 
>>>> read  the
>>>> value, which is going to cost everyone time every time they read  
>>>> it, at
>>>> the cost of saving the initial writer a few seconds of typing if  there
>>>> were an actual "type" attribute.  I also see an increased risk  of 
>>>> typos
>>>> that won't be caught until runtime, which will also lower  
>>>> productivity.
>>>>
>>>> Perhaps I'm missing something here?  I'm not really sure what we're
>>>> gaining but I can certainly see what we're losing.  I'll admit to  not
>>>> having used Tapestry on any huge in production webapps and my total
>>>> experience with the framework has only been about a year, so  maybe my
>>>> lack of experience is somehow a roadblock.
>>>>
>>>> Also, please don't take this as a crap on all your work.  I am  
>>>> generally
>>>> very pleased with Tapestry 4 and I have nothing but the utmost  respect
>>>> for you folks that are pouring all this energy into making  Tapestry a
>>>> better product.
>>>>
>>>> Thanks,
>>>> Kevin
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------- -
>>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-dev- help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 


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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Jamie Orchard-Hays <ja...@dang.com>.
Right--that was the problem Howard mentioned. Would we actually need  
custom types in the DTD, or is that just a convenience?

Jamie
On Aug 12, 2005, at 12:18 PM, Robert Zeigler wrote:

> Jamie Orchard-Hays wrote:
>
>> The brief history is that at first people thought the default   
>> bindings
>> would be a good idea, but in use a lot of developers kept  getting
>> confused--"is it literal? Is it ognl? What is it?" So, after  a  
>> lot of
>> discussion on the list, we voted an agreed to move to  clarity and
>> consistency over terseness. I suggested using:
>>
>> <binding name="foo" expression="bar"  OR value="bar" OR   
>> validators="bar">
>>
>> as a way to enjoy terseness, clarity and DTD completion/ 
>> validation,  but
>> I believe that Howard said there was a problem with this approach.
>>
>> Jamie
>>
>
> The issue with this approach is that every time you add a binding  
> type,
> you have to extend the DTD.  Which makes it very difficult for  
> users to
> add custom binding types, etc.
>
> Robert
>
>
>
>>
>>
>> On Aug 12, 2005, at 10:17 AM, Kevin Menard wrote:
>>
>>
>>> Howard Lewis Ship wrote:
>>>
>>>
>>>> How about:
>>>>
>>>>         <binding name="displayName">literal:E-mail Address</ 
>>>> binding>
>>>>         <binding name="validators" value="validators:required,   
>>>> email"/>
>>>>         <binding name="value" value="email"/>
>>>>
>>>> This is legal in 4.0 as well.
>>>>
>>>>
>>>
>>> It seems like it might be a bit easier to read.  It's still overly
>>> verbose and prone to typos.  I guess packing two bits of   
>>> information in
>>> a single string just really doesn't sit very well with me.  I  
>>> think it
>>> makes the whole thing harder to read.  In order to really   
>>> understand it,
>>> I have to find the first ':' and separate the two entities in my  
>>> head.
>>> It's a mental step that really isn't necessary if they were just  
>>> split
>>> out to begin with.  Additionally, by explicitly splitting them up
>>> there's really no way to screw that mental step up.  I just have  
>>> this
>>> sinking feeling that trying to represent two pieces of data in a   
>>> single
>>> unit is going to cause more room for error than if the two were  
>>> dealt
>>> with in isolation.
>>>
>>> So, I see there being a mental block any time someone needs to  
>>> read  the
>>> value, which is going to cost everyone time every time they read   
>>> it, at
>>> the cost of saving the initial writer a few seconds of typing if  
>>> there
>>> were an actual "type" attribute.  I also see an increased risk  
>>> of  typos
>>> that won't be caught until runtime, which will also lower   
>>> productivity.
>>>
>>> Perhaps I'm missing something here?  I'm not really sure what we're
>>> gaining but I can certainly see what we're losing.  I'll admit to  
>>> not
>>> having used Tapestry on any huge in production webapps and my total
>>> experience with the framework has only been about a year, so  
>>> maybe my
>>> lack of experience is somehow a roadblock.
>>>
>>> Also, please don't take this as a crap on all your work.  I am   
>>> generally
>>> very pleased with Tapestry 4 and I have nothing but the utmost  
>>> respect
>>> for you folks that are pouring all this energy into making  
>>> Tapestry a
>>> better product.
>>>
>>> Thanks,
>>> Kevin
>>>
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-dev- 
>>> help@jakarta.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>


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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Robert Zeigler <rd...@u.arizona.edu>.
Jamie Orchard-Hays wrote:
> The brief history is that at first people thought the default  bindings
> would be a good idea, but in use a lot of developers kept  getting
> confused--"is it literal? Is it ognl? What is it?" So, after  a lot of
> discussion on the list, we voted an agreed to move to  clarity and
> consistency over terseness. I suggested using:
> 
> <binding name="foo" expression="bar"  OR value="bar" OR  validators="bar">
> 
> as a way to enjoy terseness, clarity and DTD completion/validation,  but
> I believe that Howard said there was a problem with this approach.
> 
> Jamie

The issue with this approach is that every time you add a binding type,
you have to extend the DTD.  Which makes it very difficult for users to
add custom binding types, etc.

Robert


> 
> 
> On Aug 12, 2005, at 10:17 AM, Kevin Menard wrote:
> 
>> Howard Lewis Ship wrote:
>>
>>> How about:
>>>
>>>         <binding name="displayName">literal:E-mail Address</binding>
>>>         <binding name="validators" value="validators:required,  email"/>
>>>         <binding name="value" value="email"/>
>>>
>>> This is legal in 4.0 as well.
>>>
>>
>> It seems like it might be a bit easier to read.  It's still overly
>> verbose and prone to typos.  I guess packing two bits of  information in
>> a single string just really doesn't sit very well with me.  I think it
>> makes the whole thing harder to read.  In order to really  understand it,
>> I have to find the first ':' and separate the two entities in my head.
>> It's a mental step that really isn't necessary if they were just split
>> out to begin with.  Additionally, by explicitly splitting them up
>> there's really no way to screw that mental step up.  I just have this
>> sinking feeling that trying to represent two pieces of data in a  single
>> unit is going to cause more room for error than if the two were dealt
>> with in isolation.
>>
>> So, I see there being a mental block any time someone needs to read  the
>> value, which is going to cost everyone time every time they read  it, at
>> the cost of saving the initial writer a few seconds of typing if there
>> were an actual "type" attribute.  I also see an increased risk of  typos
>> that won't be caught until runtime, which will also lower  productivity.
>>
>> Perhaps I'm missing something here?  I'm not really sure what we're
>> gaining but I can certainly see what we're losing.  I'll admit to not
>> having used Tapestry on any huge in production webapps and my total
>> experience with the framework has only been about a year, so maybe my
>> lack of experience is somehow a roadblock.
>>
>> Also, please don't take this as a crap on all your work.  I am  generally
>> very pleased with Tapestry 4 and I have nothing but the utmost respect
>> for you folks that are pouring all this energy into making Tapestry a
>> better product.
>>
>> Thanks,
>> Kevin
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 


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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Jamie Orchard-Hays <ja...@dang.com>.
The brief history is that at first people thought the default  
bindings would be a good idea, but in use a lot of developers kept  
getting confused--"is it literal? Is it ognl? What is it?" So, after  
a lot of discussion on the list, we voted an agreed to move to  
clarity and consistency over terseness. I suggested using:

<binding name="foo" expression="bar"  OR value="bar" OR  
validators="bar">

as a way to enjoy terseness, clarity and DTD completion/validation,  
but I believe that Howard said there was a problem with this approach.

Jamie


On Aug 12, 2005, at 10:17 AM, Kevin Menard wrote:

> Howard Lewis Ship wrote:
>
>> How about:
>>
>>         <binding name="displayName">literal:E-mail Address</binding>
>>         <binding name="validators" value="validators:required,  
>> email"/>
>>         <binding name="value" value="email"/>
>>
>> This is legal in 4.0 as well.
>>
>
> It seems like it might be a bit easier to read.  It's still overly
> verbose and prone to typos.  I guess packing two bits of  
> information in
> a single string just really doesn't sit very well with me.  I think it
> makes the whole thing harder to read.  In order to really  
> understand it,
> I have to find the first ':' and separate the two entities in my head.
> It's a mental step that really isn't necessary if they were just split
> out to begin with.  Additionally, by explicitly splitting them up
> there's really no way to screw that mental step up.  I just have this
> sinking feeling that trying to represent two pieces of data in a  
> single
> unit is going to cause more room for error than if the two were dealt
> with in isolation.
>
> So, I see there being a mental block any time someone needs to read  
> the
> value, which is going to cost everyone time every time they read  
> it, at
> the cost of saving the initial writer a few seconds of typing if there
> were an actual "type" attribute.  I also see an increased risk of  
> typos
> that won't be caught until runtime, which will also lower  
> productivity.
>
> Perhaps I'm missing something here?  I'm not really sure what we're
> gaining but I can certainly see what we're losing.  I'll admit to not
> having used Tapestry on any huge in production webapps and my total
> experience with the framework has only been about a year, so maybe my
> lack of experience is somehow a roadblock.
>
> Also, please don't take this as a crap on all your work.  I am  
> generally
> very pleased with Tapestry 4 and I have nothing but the utmost respect
> for you folks that are pouring all this energy into making Tapestry a
> better product.
>
> Thanks,
> Kevin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>


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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Kevin Menard <km...@servprise.com>.
Howard Lewis Ship wrote:
> How about:
> 
>         <binding name="displayName">literal:E-mail Address</binding>
>         <binding name="validators" value="validators:required, email"/>
>         <binding name="value" value="email"/>
> 
> This is legal in 4.0 as well.

It seems like it might be a bit easier to read.  It's still overly
verbose and prone to typos.  I guess packing two bits of information in
a single string just really doesn't sit very well with me.  I think it
makes the whole thing harder to read.  In order to really understand it,
I have to find the first ':' and separate the two entities in my head.
It's a mental step that really isn't necessary if they were just split
out to begin with.  Additionally, by explicitly splitting them up
there's really no way to screw that mental step up.  I just have this
sinking feeling that trying to represent two pieces of data in a single
unit is going to cause more room for error than if the two were dealt
with in isolation.

So, I see there being a mental block any time someone needs to read the
value, which is going to cost everyone time every time they read it, at
the cost of saving the initial writer a few seconds of typing if there
were an actual "type" attribute.  I also see an increased risk of typos
that won't be caught until runtime, which will also lower productivity.

Perhaps I'm missing something here?  I'm not really sure what we're
gaining but I can certainly see what we're losing.  I'll admit to not
having used Tapestry on any huge in production webapps and my total
experience with the framework has only been about a year, so maybe my
lack of experience is somehow a roadblock.

Also, please don't take this as a crap on all your work.  I am generally
very pleased with Tapestry 4 and I have nothing but the utmost respect
for you folks that are pouring all this energy into making Tapestry a
better product.

Thanks,
Kevin



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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Howard Lewis Ship <hl...@gmail.com>.
How about:

        <binding name="displayName">literal:E-mail Address</binding>
        <binding name="validators" value="validators:required, email"/>
        <binding name="value" value="email"/>

This is legal in 4.0 as well.

On 8/12/05, Kevin Menard <km...@servprise.com> wrote:
> Howard Lewis Ship wrote:
> > -1
> >
> > Trying to simplify, simplify, simplify the XML.  And you should be
> > using message: for your displayName.
> 
> I can certainly empathize with that, but it seems the cost of simplified
> XML is harder to read values.  Now, I do like that I don't really have
> to think about what tag to use and that I can swap bindings out without
> changing XML.  But, at least my values weren't a mess to look at.
> 
> Furthermore, being human and all, I can see myself making a typo on a
> binding name here and there.  When the type of binding was an XML tag,
> validating against the DTD caught such errors quickly.  Now I need to
> actually deploy, navigate to the page, see the error, go back and see
> what's wrong, make the fix, redeploy, navigate to the page again, and
> see that the error was fixed.
> 
> I would even be for having a type attribute in the binding tag.
> Something that separates the data from its data source (limiting the
> potential errors introduced when trying to modify one or the other) and
> could still be validated.  For user created bindings, I guess you'd have
> to set the type to "user" or something, and specify the actual binding
> in the value, which won't gain you a whole lot.  However, I think this
> solution will work pretty well in the general case.
> 
> As for the i18n stuff, you're probably correct, but my little sandbox
> webapp really hasn't merited.  I think the spirit of my post generally
> remains unaffected by this though.
> 
> --
> Kevin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Kevin Menard <km...@servprise.com>.
Howard Lewis Ship wrote:
> -1
> 
> Trying to simplify, simplify, simplify the XML.  And you should be
> using message: for your displayName.

I can certainly empathize with that, but it seems the cost of simplified
XML is harder to read values.  Now, I do like that I don't really have
to think about what tag to use and that I can swap bindings out without
changing XML.  But, at least my values weren't a mess to look at.

Furthermore, being human and all, I can see myself making a typo on a
binding name here and there.  When the type of binding was an XML tag,
validating against the DTD caught such errors quickly.  Now I need to
actually deploy, navigate to the page, see the error, go back and see
what's wrong, make the fix, redeploy, navigate to the page again, and
see that the error was fixed.

I would even be for having a type attribute in the binding tag.
Something that separates the data from its data source (limiting the
potential errors introduced when trying to modify one or the other) and
could still be validated.  For user created bindings, I guess you'd have
to set the type to "user" or something, and specify the actual binding
in the value, which won't gain you a whole lot.  However, I think this
solution will work pretty well in the general case.

As for the i18n stuff, you're probably correct, but my little sandbox
webapp really hasn't merited.  I think the spirit of my post generally
remains unaffected by this though.

-- 
Kevin

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


Re: Tapestry 3 bindings in Tapestry 4?

Posted by Howard Lewis Ship <hl...@gmail.com>.
-1

Trying to simplify, simplify, simplify the XML.  And you should be
using message: for your displayName.

On 8/11/05, Kevin Menard <km...@servprise.com> wrote:
> Hi guys,
> 
> Just as a preface, I'm really not trying to be a pain in the neck --
> I'm just trying to make my code as clean and easy as I possibly can.
> 
> Dumping default bindings meant my components went from something like:
> 
>      <component id="email" type="TextField">
>          <binding name="displayName" value="E-mail Address"/>
>          <binding name="validators" value="required, email"/>
>          <binding name="value" value="email"/>
>      </component>
> 
> 
> to:
> 
>      <component id="email" type="TextField">
>          <binding name="displayName" value="literal:E-mail Address"/>
>          <binding name="validators" value="validators:required, email"/>
>          <binding name="value" value="email"/>
>      </component>
> 
> I'd have to say that I think I actually prefer the different binding
> tags in 3.0.  I think the following is generally easier to read:
> 
>      <component id="username" type="ValidField">
>          <static-binding name="displayName" value="E-mail Address"/>
>          <binding name="validator" expression="beans.required"/>
>          <binding name="value" expression="email"/>
>      </component>
> 
> At least in Tapestry 3, values were values and expressions were
> expressions.
> 
> So, I guess my question is, how much trouble would I be getting
> myself into if I tried combining these binding elements into the 4.0
> DTD?  I really like what Tapestry 4 is doing is general, but this is
> looking to be a potential show stopper for me.  Once again, I'm not
> looking to reopen the default binding can of worms.  It seems that
> ship has sailed, so now I'm just trying to find the next best thing
> without being ridiculously verbose.
> 
> Thanks,
> Kevin
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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