Hi -- On Fri, 7 Aug 2009, Phlip wrote:
> > Ilan Berci wrote: > >> While not knowing your problem domain at all, I have a preference for >> thin dumb controllers (that fit easily within REST), I would move the >> mailer down into models/ or lib/ >> >> hth >> ilan > > +1 (FWIW!) > > Views should be dumb, Controllers thin, and Models fat. > > If the deliver_ call were one line, it qualifies for the Controller. But... > > The delivered template is itself a View. Hence it should be dumb. Hence > anything > powering it belongs in the _Model_, where fat things belong. That's exactly what ActionMailer does: it keeps the fine-grained stuff in the model, and allows you to control it from the controller using high-level commands (class methods). I'm becoming very skeptical about the whole thin/fat thing. It's a sound principle, and it's served an important purpose, but as it's purely quantitative, it doesn't provide much real technical guidance. I'm starting to think more along the lines of "shallow" and "deep". The controller has shallow interaction with the model classes and objects; those classes and objects have a dimension of depth into the database and so forth. I'll mull it over and report back :-) David -- David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com Q: What's the best way to get a really solid knowledge of Ruby? A: Come to our Ruby training in Edison, New Jersey, September 14-17! Instructors: David A. Black and Erik Kastner More info and registration: http://rubyurl.com/vmzN --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

