From: Nikolai Weibull Date: 2005-03-23T09:15:40+09:00 Subject: Re: Any guides for good coding in Ruby? * Eric Schwartz (Mar 23, 2005 01:00): > > I can't decide if it's just the example or the whole section, but > > this one just doesn't feel right to me. I would much rather have a > > class rendering itself (who better qualified?), then providing > > accessor like data for others to do it. Push, don't pull, right? I agree with you in this instance. It does depend on the setting, though. > If you have a class just providing data for others to render then you > can much more easily implement renderers than if you have to modify > your data class for each format you care to render it into. Actually, the best way to solve this problem would be to use the Visitor pattern, right?, nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: minimalistic.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}