Musachy, Chris, and Dale:

   First, thank you for the feedback.  The more people who look over the
tutorials, the better they will be.

   Second, I've thought about your suggestion to use %{ } for all OGNL
evaluated expressions and use %{' '} for all string expressions in the
Struts 2 code.  I disagree with your suggestion because:

      1.  I've trained many Java developers at University of Kansas to use
Struts 2.  I found that the longer I can put off introducing OGNL and how
Struts uses OGNL behind the scenes the better.  One of the beautiful
(because it's simple) aspects of Struts 2 is that <s:property value="name"
/> is so very much like writing a JSP tag that it's easy for Java developers
to follow.  I do explain that value="name" means Struts 2 is going to call
the public getName method that is part of the Action class.  Telling new
Struts 2 developers that they should use <s:property value="%{name}" />
means I have to explain why they need to use %{ } even though value="name"
works exactly the same.  So if I'm doing that from the start of the
tutorials, I'm taking them down the understanding OGNL path right away,
which diverts them from learning Struts 2 basics to learning OGNL syntax.

     2.  The published Struts 2 books (Struts In Action, Using Apache Struts
2) don't commonly use the %{ } syntax and most examples published on the web
don't use the %{ } syntax.  So user's going from our introductory tutorials
to other references are going to be confused unless we've given them a
detailed explanation of why value="%{name}" is the same as value="name".  I
strongly believe from experience in teaching Struts 2 that this detailed
explanation is too much information for someone brand-new to Struts 2 and
creates an even steeper learning curve.

    3.  The use case where you need to use %{'someString'} to prevent Struts
2 from using OGNL to evaluate the expression is not that common.  I think
it's easier to teach and learn Struts 2 if we cover the common use cases and
the basics of Struts 2.  Once we've set a solid foundation, we can present
an introduction to OGNL and how/when to use %{ }.  In my experiences
teaching others Struts 2, it's easier for the new developer to understand
when/why he needs to use %{ } after getting past the basics.  So I disagree
with Chris's point that using %{ } explicitly from the start would help them
get up to speed faster.

    4.  Reference Dale's comment that we should use value="%{name}" in case
Struts 2 changes away from using OGNL, thus breaking value="name", there
would be much more severe issues with such a change then just updating our
examples.  

    5.  For better or worse the current widespread usage of Struts 2 by Java
developers is usage that doesn't use %{ } unless necessary.  So unless there
are some other overwhelming reasons for now instructing Struts 2 developers
that they should always use %{ } I don't think we should try to change what
is the common usage. 

    6.  My plan for these tutorials is after I've taken the user through
common use cases (form submission, validation, use of Service classes, use
of Spring) to have a few tutorials on OGNL.

I certainly respect everyone's ideas and suggestions and appreciate people
providing feedback.  I'm not sure how we resolve this disagreement.  Is
there a Struts 2 documentation "leader" who can decide?  Is that you
Musachy?  

Bruce Phillips




Chris Pratt wrote:
> 
> +1, I think getting noobies used to seeing and using the more explicit
> syntax would help get them up to speed much faster.
>   (*Chris*)
> 
> On Fri, Jan 15, 2010 at 11:16 AM, Dale Newfield <d...@newfield.org> wrote:
> 
>> Musachy Barroso wrote:
>>
>>> I think it would come handy an explanation of why some attributes are
>>> expected to be strings, while other are values, like:
>>>
>>> <s:input name="somestring" />
>>>
>>> vs
>>>
>>> <s:property value="somevalue" />
>>>
>>
>> I think in the tutorials, documentation, etc. we should use the %{}
>> syntax
>> explicitly everyplace.  If someone wants a string, for example, and not
>> to a
>> lookup, it is quite confusing to a new struts user that they need to
>> change
>> value="FOO" to value="%{'FOO'}", but if they're used to seeing
>> value="%{FOO}" then it isn't so confusing.
>>
>> This also might make the progression from OGNL to JUEL or something else
>> (should that ever happen :-) cause less of the documentation to break.
>>
>> -Dale
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org
>> For additional commands, e-mail: dev-h...@struts.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Struts-2-Documentation---Revised-Tutorials-tp27002757p27190473.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org
For additional commands, e-mail: dev-h...@struts.apache.org

Reply via email to