[jsr-314-open] cc.parent mystery

David Geary clarity.training at gmail.com
Tue Feb 2 23:20:34 EST 2010


2010/1/29 Cay Horstmann <cay at 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 at horstmann.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20100202/9e516f5c/attachment.html 


More information about the jsr-314-open-mirror mailing list