cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Fagerstrom <dani...@nada.kth.se>
Subject Re: [RFC] "Cocoon Templates": Name and Tag Interface
Date Mon, 29 Nov 2004 17:48:27 GMT
Ralph Goers wrote:

>Daniel Fagerstrom said:
>  
>
<snip/>

>>Tag "Interface"
>>===============
>>
>>What data should be available for the taglib writer and how should it be
>>made accessible? What about thread safety?
>>    
>>
>Why wouldn't it be thread safe? I would think this would need to be a
>requirement.
>  
>
What I mean is if a user written tag class should be required to be 
thread safe. If it is, a partly set up tag object can be part of the 
compiled script. The compiled script must (of course) be thread safe to 
be resuable.

If we require the tag to be thread safe this means that all runtime 
dependencies must be given as arguments to the "execute" method and the 
tag's member data must be read only during execution.

If we don't require the tag to be thread safe it will be easier to write 
and tag writers who forgot about thread safety during tag implementation 
will get fewer suprises when the tag is starting to be used in 
production. But it will be hard to get the same performance. OTH 
performance must always be evaluated in the total context, and it is 
hard to know how much thread safety will mean in practice for performance.

Anyway, as design of performant multi threaded system not is within my 
expertice areas I need input on this. So that we can decide what would 
be a good compromise between performance and usabillity.

>>Expressions
>>-----------
>>
>>This is somewhat OT in the current context but IMO expressions, (the
>>stuff inside ${}), should only have access to FOM and preferably just
>>read access. IMHO expressions should not have side effects.
>>    
>>
>
>There should be a way to register objects for use by the template so that
>flow is not a requirement.  Of course, the template should also be able to
>access the request and response.
>  
>
I see that I was vauge. I don't meant that the template should depend on 
flow in any way, I meant that it should have access to the same data as 
the flow. But looking a little bit closer at the FOM, I think that would 
IMO be a little bit to much as well. So having access to the same data 
as in JXTG, i.e. request, session, context, sitemap parameters and 
continuation would IMO be closer to the point.

Why would you like to have access to the response?

<snip/>

>>Thread Safe or Not?
>>-------------------
>>
>>Thread safe tags can have better performance as more work can be done
>>during script compile time, but they might be harder to write. What
>>should we chose or should we support both types?
>>    
>>
>
>Thread-safe.  If need be, the there can be a setup method that returns an
>object that is passed back to all other methods.  Since the framework
>"owns" the returned object it can decide when to drop the reference.
>  
>
Yes, sounds reasonable. One can e.g. use the variable stack for 
temporary data during execution.

/Daniel


Mime
View raw message