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: Interblock communication
Date Tue, 19 Jun 2007 20:03:40 GMT
Rice Yeh skrev:
> The following is my understanding about the current and would-be 
> functions of servlet-serivce:
> 
> Servlet-serivce is to have a web application divided into many blocks 
> but each of them behaves like a web application; It has its own context, 
> request, response and session. When a block s1 calls another block s2, 
> it is like that s1 is calling another web application; it creates 
> another request, have another response, even have another session in s2. 
> Attribute values (here attribute refers to the general meaning, it 
> includes the parameters, headers and attributes in request and the 
> attributes in session and context) in s2 can override values in s1. For 
> example the value of an attribute a1 is vs1 in s1, when s1 call s2, s2 
> might have attribute a1 with value vs2 because a1 is overridden (here, I 
> am not sure whether it is correct to use the word 'override'). However, 
> for another block s3 called by s1 which does not override a1, the value 
> of a1 is still vs1. Repeat again, attributes here refers to general 
> meaning. Such overriding mechanism is not implemented yet.

Great summary of how things works and what needs to be done next! As 
Grek wrote, we have recently found a way to make the request object of 
the caller available in the request object of the callee, so now it is 
possible to start to implement what you describe above.

> Then in servlet-service, it is allowed to have a block extend another 
> block. Lets say s3 extends s0. When s1 calls s3 with request r1 for a 
> function f1 which is implemented in s0. Is it still needed to create 
> another request for s3 to call s0 for f1? For present implementation, 
> there is no difference in calling a super and no-super block. However, 
> in object-oriented thinking, just directly passing r1 is more 
> reasonable. Since servlet-service is not like a OO language to have a 
> complier, to judge whether f1 exists in s3 or s0 might not be an easy 
> way. Bug cocoon-2038 approaches this issue.

We haven't discussed this before, but I think you are completely right, 
we need to differ between ordinary servlet service calls and super 
calls. And super calls should probably be considered as an internal 
redirection where the request object of the caller is kept (including 
its session and request attributes). The URI probably needs to be 
overidden, but not much more.

> Anyone, please comments. I like to know whether my understanding is correct?

Your understanding is right on the spot, as far as I can tell.

/Daniel

Mime
View raw message