[Nitro] xhtml builder in model?

TRANS transfire at gmail.com
Wed Sep 7 10:47:36 EDT 2005


On 9/7/05, James Britt <james_b at neurogami.com> wrote:
> TRANS wrote:
> > On 9/7/05, James Britt <james_b at neurogami.com> wrote:
> >
> >>>  class Writer
> >>>    def render( model )
> >>>      do_this(model.x)
> >>>      do_that(model.y)
> >>>
> >>>  class Model
> >>>     def render( writer )
> >>>         writer.do_this(self.x)
> >>>         writer.do_that(self.y)
> >>>
> >>
> >>I don't know that I can offer a persuasive argument, but I prefer the
> >>latter.
> >
> >
> > I understand. I generally do too, but we program Ruby. Now if we were
> > Lisp programmers, I have a feeling we' might have a different opinion.
> >
> 
> Could you you explain that?   I believe my choice sticks closer to a
> "Tell, don't ask", approach, which seems pretty consistent with an OO style.

Oh, I just mean that lisp is functional (or essentially so at least)
so the writer here is in essence the funtional element, to which the
data is passed:

  (write model)

vs and OOP language like Ruby where the object takes precedence:

  model.write

T.




More information about the Nitro-general mailing list