cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <g...@tuffmail.com>
Subject What's the use of fillContext method
Date Thu, 02 Aug 2007 22:03:20 GMT
Hi,

I would like to know what's real use of from o.a.c.environment.TemplateObjectModelHelper.fillContext()
method? For me, this method looks 
like trying to work-around bad design.

Basically, this method gets context bean and tries to add all its properties (may be "dynamic
properties" like entries in Map) to the object 
model. I believe that this is really hacky and was invented because JEXL doesn't have concept
of context bean, only of variables. Thus the 
need for mapping of context to the variables.

My own opinion is that we should remove this method completely and let JEXL access context
bean's properties this way:
   contextBean.some_property

If someone want's "some_property" to be accessed directly, she should add it to variables.
I think that's much more clean and reliable contract.

You may wonder why I want to remove it at all. My goal is to get rid of TemplateObjectModelHelper
which scope is narrowed to template, only. 
This stops me from having unified object model across all Cocoon parts. To achieve unified
architecture, I want to make Cocoon areas (like 
flowscript) respectively responsible for various object model entries creation to be also
responsible for addition this entries to the 
ObjectModel. Now, the situation is rather confusing because flowscript creates context bean
and inserts it to the "component object model" 
(the one passed to Cocoon's components) and later template creates Object Model by collecting
various bits of information.
I've started to alter this in r562102[1].

What's your opinion? I would only want to add that removal of fillContext is probably back-incompatible
change.

[1] http://marc.info/?l=xml-cocoon-cvs&m=118606023811194&w=2

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Mime
View raw message