cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: [CForms] Support for multipe unique-row-id in Repeater
Date Fri, 12 Mar 2004 15:35:50 GMT
Marc Portier <mpo <at>> writes:

> I missed the reason to do away with the convertor, or you moved it down 
> to the identity-binding?

The convertor was only for @unique-row-id and @unique-path and as I removed
these I also removed that. The identity binding itself is just a composed
binding. The value bindings do have a convertor themselves.

> > 2. The repeater binding has to know stuff (fieldId, xpath, convertor, 
> > etc.) from its child bindings - and this dependency is bad.
> IIRC we just duplicated that info during building in order to make sure 
> there would not be added coupling between the repeater and it's possible 
> children

Maybe I understand something wrong, but I don't agree with your recall:
The handling of @unique-row-id and @unique-path was completely in
RepeaterJXPathBindingBuilder [1] and RepeaterJXPathBinding [2]. So the repeater
binding did also the work of the ValueJXPathBindingBuilder and so knew all
values for latter usage. Nothing was duplicated AFAICS.

> > This is no longer true for the elements. I can 
> > get the child bindings from the composed binding, but I had to open 
> > (additional getters) the value binding to get the values no longer 
> > available to the repeater binding otherwise.
> afraid I don't understand completely yet

You don't have access to the field and its value of the child binding by
default. For the repeater you now need the values, otherwise you can not build
the identity of a row.

> > All together: there is now a dependency of the repeater binding on its 
> > child bindings. We can restrict the allowed child elements of 
> > fb:identity to fb:value that reduces the problem to current minimum, but 
> > maybe something else is needed.
> oh, I'm starting to see the light again...
> damn, I have to check in the maillinglist to see if this was just a 
> personal mental note or a discussed proposal, but in any case:
> IMHO this calls for an additional method on the binding interface, next 
> to load() and save() we should be able to ask for isMatch() or even 
> better isIdentical()
> wdyt?

But fb:identity is a composed binding that would need to collect the values of
its child bindings (fb:value or others, there is also no access to those ATM).

> >> next to this observation however I'ld like to question the real-life 
> >> relevance: IMHO the advantage of jxpath under the hood of the binding 
> >> is that it allows for reusing the syntax-metafor of xpath regardless 
> >> of the backend.  Being the mix of using slashes over dots, not needing 
> >> parentheses and having a single expression that equally works for 
> >> getting and setting (LHV/RHV)
> > 
> > When it would work "regardless of the backend" ...
> yeah, but currently the regardless only realtes to the syntax being 
> portable over to the backend, not the semantics

An important difference indeed :)

> or in other words: the semantics are imposed onto the backend by jxpath
> what I want to say is: it DOES work, but only if the backends are equal 
> in the jxpath sense of the word 

Yes, I put the blame on jxpath.

> > While developing we often encoupled the backend from the frontend. The 
> > interface between both was a simple XML structure. The frontend knows 
> > what it will get, the backend what it has to deliver when the system is 
> > running. This allows independent development. Additionally we had static 
> > test XML files for the frontend, so that "real life" test is possible. 
> > The switching was just in the sitemap (XML from disk or from backend). 
> > Now I would have to maintain two binding files.
> hm, all falls with the line
> 'backend knows what it has to deliver'
> is that *knowing* really according to 'semantics as imposed by jxpath' 
> and not according to 'most naive/simplistic view of the structure'?

It was with Cocoon 2.0 (no JXPath, no beans, no woody) and just an arbitrary
complex XML comming either from disk (static file) or XSP (the backend), but
this XML structure was the interface.

> I could go on questioning if the static XML is a big gain over a static 
> hard-coded Java that builds some bean instances rather then load them 
> from the real backend...

Indeed, new techniques sometimes need adapted developing.

> however, thinking about it constructively I 
> think here and now the best we can do is build some docos/catalogue 
> offering the real XML/jxpath view on some classic bean constructs?

Yes, though it would belong more to JXPath itself and should be maintained
there. Maybe it already exists.

Thanks for your reply,




View raw message