Hmm.
I have to disagree.
The way I see it, there are really two common uses for Block (and IRender):
1) Polymorphism (the vast majority of cases when we've needed it)
2) Components where particular elements can be provided via IRender or Block from outside. A lot of these cases can also be implemented (and is more logical to do so) using wrapping similar to the Border component in the tutorial (if I remember the name correctly)
What you suggest would essentially cover only the parts of (2) that do not require you to go one level lower to IRender (although an adapter can be used to handle the other cases as well). Personally, I do not think this is a frequent enough case.
I think that there are two apporoaches to the way Tapestry is developed:
a) Keep declarations and templates separate as they are now
b) Merge declarations and templates, placing component definitions and bindings (and therefore logic, since the bindings now include OGNL) into the templates.
A lot of people used to JSP immediately say that (b) is the right approach, since putting everything into one file makes the newbie life easier. That was (partly) my initial reaction as well.
On the other hand, (a) allows much cleaner definitions of the components. It allows you to have different internationalized templates w/o a lot of effort, and allows web designers to roam freely through the templates w/o great fears of the logic being broken. Most importantly, in my experience, people who have been with the framework for long enough to shake off the JSP habit, seem to find the Tapestry way much cleaner and much nicer. This especially applies to people using Spindle. If your experience does not match mine feel free to voice your opinion.
In other words, the performance "enhancements" of (b) tend to evaporate with time, and instead turn into a drag.
Personally, I believe that (a) is also a better choice for two other reasons -- it is a stronger declarative approach, and it allows much easier implementation of tools (such as Spindle). Perhaps Geoff could say whether he could support a JSP-like syntax where HTML and logic are intermixed.
There is certainly some logic in providing templates with the ability to handle the most frequent operations (some would say that Insert falls into this category) and I would grudgingly agree with that, but I do believe that if this is done, it has to be done within tight limits to preserve the features mentioned above (which means keeping the template as close to HTML and as devoid of logic as possible).
I think that one way to handle the clear philosophical difference between the two camps that are forming is by creating another implementation of AbstractPage (other than BasePage) that can handle JSP-like templates. This can be done now -- the API is there. The big question is whether there is point in doing that once you use Spindle.
Note that making templates to use JSP or something very close to JSP is another question -- it would allow for much smoother transition for the JSP crowd. It is a very different goal, however, and should not be thrown into the argument of what would be best for long term Tapestry users (present and future)
Just my 2c,
-mb
Viktor Szathmary <[EMAIL PROTECTED]>wrote:
hi,
Howard M. Lewis Ship wrote:
>I'm warming to the concept of "anonymous components" that are specified
>entirely in the HTML template. This is much more viable now (with the new
>approach to localization) than before (where localization was always
>multiple HTML templates). It's a kludge in the way that
>is a kludge ... useful enough to outweigh its limitations.
>
>
>
i think having a lighter way do define blocks that a complex component
might expect would be a good start, eg.
Foo
Foo
where you only define mycomponent in the jwc/page file, :header and
:body are just Block components bound to it.
best regards,
viktor
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
