Tell, Don't Ask
- From: "Squeamizh" <squeamz@xxxxxxxxxxx>
- Date: 11 May 2006 10:02:53 -0700
Hi everyone. I've been reading quite a few old posts from this group,
and have found it to be a very educational experience. I'm grateful
for the knowledge I've gotten so far from the smart people who post
here.
I think I have a pretty good understanding of OO, but sometimes I have
difficulty applying it in practice. The concept that I am currently
grappling with is something which I've seen referred to as "tell, don't
ask." My understanding is that OO purists frown upon having lots of
getter-methods because it tightens coupling. As I understand it, the
preferred approach is to design objects that examine their environment
and then "blindly" send messages to other objects correspondingly.
My question is as follows. How can an object know about its
environment without "asking"? Is every object supposed to contain all
the information it needs, obtained by receiving messages from other
objects?
Thanks.
.
- Follow-Ups:
- Re: Tell, Don't Ask
- From: Squeamizh
- Re: Tell, Don't Ask
- From: Alvin Ryder
- Re: Tell, Don't Ask
- From: Andrew McDonagh
- Re: Tell, Don't Ask
- From: AndyW
- Re: Tell, Don't Ask
- From: Daniel T.
- Re: Tell, Don't Ask
- From: H. S. Lahman
- Re: Tell, Don't Ask
- From: Daniel T.
- Re: Tell, Don't Ask
- From: Daniel T.
- Re: Tell, Don't Ask
- Prev by Date: Re: MVC vs MVP
- Next by Date: Re: Question on LSP
- Previous by thread: Is there any diagram to for Procedure and Functions ?
- Next by thread: Re: Tell, Don't Ask
- Index(es):
Relevant Pages
|
|