2009年6月3日星期三

Re: [fw-mvc] Pattern / example?

On Wed, Jun 3, 2009 at 4:53 PM, Jon Lebensold<jon@lebensold.ca> wrote:
> I was assuming that his setDisplay method would be picking up either an
> instance or would be using a string to determine which class to instantiate.
> Please correct me if I'm wrong, however my understanding of DI is that the
> implementation (usually in the form of an interface) is passed into the
> object (at least in its simplest form). His approach seems to suggest that
> that's what he's trying to do. I think we're all in agreement that this
> violates a separation of concerns.
>
> Hector, your example illustrates this perfectly and judging from Ed's
> description, I think that's what he's trying to accomplish (although I agree
> that the premise makes the pattern unwarrented).

Yea, I'm just exploring something I'd read, curious how it would work,
etc.. The view helper is definitely the agreed consensus. Abraham's
comment still has me curious though. In which context is it
beneficial for objects to be responsible for displaying themselves?
When you say UI objects, why would you say ball or robot? Couldn't
the same be said of the person object?

-Ed

没有评论: