2010/1/29 Cay Horstmann <cay@horstmann.com>
I can't get cc.parent to work, and I stared at it for long enough that I am pretty convinced that it is a bug. (https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1529)

What I am wondering in this forum is whether cc.parent is actually intended to be supported. There was some use case in the olden days, when cc was dynamically scoped, but around September 15, Andy Schwarz convinced you all that it should be statically scoped. For all I know, that took away the raison d'être for cc.parent.

Or is there another use case? I only found one other example, David Geary's developerWorks article (http://www.ibm.com/developerworks/java/library/j-jsf2fu2/index.html). He has a map component inside a place component that retrieves the location from the parent. I am not even sure that's good practice. It doesn't make the map component reusable, but instead couples it with the parent.

It's true that the example may be a little contrived, but that does not mean there are no use cases for tightly coupling nested components to parent components, just as there are plenty of use cases in OO in general for tight coupling, even though in general, loose coupling is typically preferred. So IMO, cc.parent makes perfect sense.


david


Thanks,

Cay

--

Cay S. Horstmann | http://horstmann.com | mailto:cay@horstmann.com