A few points:



No more parsing of parameters is *HUGE*.  

Your example ...




--
[EMAIL PROTECTED]

http://tapestry.sf.net
I'm the first to admit that the developer's guide is not useful ... too much 
information, not organized or prioritized or anything.

Much of what's going in Tapestry is not relevant unless you are trying to do something 
very, very extreme!

> 
> 
> 
> I've been playing on and off with Tapestry for the past days , and I 
> have mixed feelings about it, in one hand looking at the bundled 
> examples, Tapestry seems to be as good as you guys advertise, on the 
> other hand trying to do something with Tapestry it's proving to be a 
> torture.
> 
> First I'd like to say that English is not my native language, so my 
> confusion maybe partially related to my poor understanding of the 
> documentation (BTW congratulations, hardly never do I see a project 
> that makes such an obvious effort in documenting itself).
> 
> The first hurdle that I come across is the weird naming conventions 
> that you guys follow, terms like "Visit", "Engine", "Service", 
> "Gestures" "rewind" and "page recorders". I understand that the Visit 
> is the place to store the Session State (why not call it Session?), as 
> for the rest of the stuff I'm still fishing. For instance it's still 
> unclear to me where to store application level variables.
> 
> And how about page initialization. Apparently the method in which to 
> perform page initialization is called "detach()"?!?, isn't this 
> weird?, a "detach()" method to perform initialization!?! ... what's 
> wrong with "init()" or "pageInit()" or "initialize()"?, is it only me 
> that finds this stuff confusing? After digging in the docs the reason 
> for the "detach()" became more clear, apparently there is a pool of 
> pages and when there is a request, a page is retrieved (detached?) 
> from the pool and the persistent properties of the page must be 
> manually reseted (I'm talking from my ass I don't know for sure if 
> this is what happens). But I have a question, why do I need to know 
> that there is a pool? I have no interest at this time to know the 
> magic behind the curtain, I'm just trying to use Tapestry, is it 
> required to know the inner workings of Tapestry to be able to use it?

Yes detach() is a little counterintuitive; in fact, AbstractComponent.detach() now 
invokes a method initialize() so you can move your initialization there isntead.  
detach() makes sense for why its necessary (to restore the page back to its pristine 
state for later reuse by some other session), but as the average developer, it makes 
less sense.

> I understand how pages intercommunicate (wheee ... no more parsing of 
> parameters), but how do components "talk" to each other, case in point 
> I have a "Portrait" component (it shows a picture from a list of 
> available pictures) and a "PortraitExplorer" component, how can I make 
> the "PortraitExplorer" tell the "Portrait" to show the next picture on the 
> list? I also can't seem to find a way to make a component execute a 
> method of the containing page , for example lets say I put the 
> "PortraitExplorer" component and the "Portrait" component in a 
> "ShowPicassoPictures" page and when I press the "NextPicture" button of 
> the "PortraitExplorer" component I want to execute the 
> incrementPicassoHitCount() of the "ShowPicassoPictures" page. I think 
> that what I'm talking about is to have a method of the containing page 
> as parameter of a component, is this possible?

Yes, what you want to do is have the PortraitExplorer component take an 
IActionListener parameter.

<param name="nextListener" java-type="net.sf.tapestry.IActionListener ....>

Now, PortraitExplorer will have an embedded component, nextLink of type DirectLink.
It needs to use the parameter value passed to the PortraitExplorer:

<component id="nextLink" type="DirectLink">
<inherited-binding name="listener" parameter-name="nextListener"/>


ShowPicassoPictures needs to use the PortraitExplorer:

<component id="explorer" type="PortraitExplorer">
  <binding name="nextListener" expression="listeners.incrementPicassoHitCount">

public void incrementPicassoHitCount(IRequestCycle cycle)
{
...
}

> 
> Another thing that I found weird is the "rewind". It seems to be one of 
> the focal points in Tapestry but I don't understand it. From what I 
> can gather it seems that Tapestry is doing the same work twice, and 
> only producing HTML once, isn't this weird?

It's made complicated by the fact that it can handle any kind of looping, conditional 
bizarness, if
you play by the rules.

When you render the page with the form, Tapestry works through the page, one component
at a time.  It see the Form, it comes up with a name and writes a <form>.  

It sees an TextField, it comes up with a name and writes an <input type=text>.

So you can see that the names used for the Form and all the other stuff is dependent
on what's in the page.  More, if there are loops and conditionals, the exact names
will depend on the "path" Tapestry took while rendering the page.

When the form is submitted, Tapestry is presented with a set of parameters
and values.  How is it to determine how to interpret this?  It just runs
through the same process as before ... but instead of rendering, it gets
the parameter values and writes them back into properties of the page (or objects 
visible from the page).




> 
> Helper Beans... like the "EvenOdd" thingy , the whole "Helper Beans" 
> stuff remains as one of the most confusing aspects of Tapestry is the 
> Bean supposed to be the Model in a MVC design?
> Oh... perhaps it would be beneficial to make more clearer in the docs 
> the dependency on CSS of the EvenOdd bean, I know its there but it 
> took me a while to understand from where the alternating row colours 
> where coming.

You don't have to use it.  Because everything in Tapestry is a component and a 
JavaBean, you 
have lots of flexibility about where things go.  The listener methods for your page
don't have to be implemented by the page ... they can be in the engine, the Visit 
or in a helper bean.

Anything you can do with helper beans you can do with code ... but a lot of Tapestry 
is about doing the most functionality with the least amount of code.  Again,
you aren't forced to use this stuff.

Here's an example; say you have a search form on many pages in your app, but it works
a bit differently depending on where in the app you are.  One way of doing this is
to use inheritance ... you put the code for performing searches into a superclass
that your pages inherit from.  However, there are problems with inheritance ... such
as only have a single class to subclass.

Say, instead, you put that logic into a helper bean.  Now, your search form
can submit to a listener provided by the helper bean.  You are using
composition (easier to diagram in UML!) rather than inheritance.  Your choice,
but Tapestry gives you that choice!

> 
> This post is long already, so I better stop here. If someone could 
> shed some light in some of my questions I would be forever grateful.
> I'm having a hard time trying to justify the time spent with Tapestry 
> and the (almost)zero results so far.
> 
> 
> Jorge Chandra
> 
> 
> 
> _______________________________________________
> No banners. No pop-ups. No kidding.
> Introducing My Way - http://www.myway.com
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Microsoft Visual Studio.NET 
> comprehensive development tool, built to increase your 
> productivity. Try a free online hosted session at:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer


-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET 
comprehensive development tool, built to increase your 
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to