<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hi Sebastian. You just turned my world on its head :-) <div><br><div><div>On Dec 23, 2007, at 3:43 PM, Sebastian Sastre wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Almost allways objects should not know about "their parents". But parents</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">often want to know what is going on with it's children even when the</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">children do not pass a message "directly" (hard coupling).<span class="Apple-converted-space"> </span></font></p> </blockquote></div><br></div><div>And I just read part of Ramon's blog that says the same kind of thing but with the specific example of Seaside components and the Announcements framework:</div><div><br class="webkit-block-placeholder"></div><div><a href="http://onsmalltalk.com/programming/smalltalk/maintaining-loose-coupling-in-seaside-components/">http://onsmalltalk.com/programming/smalltalk/maintaining-loose-coupling-in-seaside-components/</a></div><div><br class="webkit-block-placeholder"></div><div>This is great, you both make valid arguments. While I understand what you say my past still haunts me so I popped open the system browser to examine "WAComponent" which is the general Seaside page component. It's just as you say. There is a "WAComponent&gt;&gt;children" message and a "WAComponent&gt;&gt;parent" message is AWOL.</div><div><br class="webkit-block-placeholder"></div><div>"How can this be?" was my first guttural reaction. </div><div><br class="webkit-block-placeholder"></div><div>You see, I'm a WebObjects weenie. "WOComponent" is to WebObjects what "WAComponent" is to Seaside. In a "WOComponent" you have "WOComponent.parent()" but you do not have "WOComponent.children()". It's the exact opposite of what you are recommending and what Seaside is doing. Combing through the cob webs of my recollection, I remember struggling with this notion years ago. I naively thought that both relationships should exist because there were times when I really wanted at the children of a particular component. And you know, if you dig into Apple's java code, you'll realize that they do have a hidden concept of children for a particular component, but they don't expose it in the public API. You kind of have to know your children when you are asked to generate the HTML response string and you want to give your "children" components a chance to "speak". </div><div><br class="webkit-block-placeholder"></div><div>So, after I peel back the layers of the onion, I see that Apple consciously decided components should only know their parent. Yet, behind the scenes, they secretly have a way to get to the children. Kind of bizarre, I wish I knew what their design decision was but I don't. I had always just assumed there was a "very good reason" for modeling components the way Apple did, but maybe, in light of what you are telling me, there isn't one.</div><div><br class="webkit-block-placeholder"></div><div>-- Aaron</div></body></html>