From: dblack@... Date: 2006-09-28T05:20:58+09:00 Subject: Re: Rails for the Rubyist Hi -- On Thu, 28 Sep 2006, Christian Neukirchen wrote: > "Rob Sanheim" writes: > >> Regarding this particular magic, I'm pretty sure all Rails does is >> loop through all the instace variables on the controller, do a >> instance_variable_get to grab it and then an instance_variable_set to >> store it on the template object. So it just uses some the >> instance_variable* methods to bypass encapsulation and throw >> everything onto the template. > > What again was MVC for? It's always been a bit like M(VC). I think the instance variable thing is a reasonable way for controllers to hand off data to the views, which has to happen somehow. One thing I've always liked about the Rails meta-programming stuff is that even when it gets rather complex and tricky, it tends to lead ultimately to simplicity. It's definitely a domain-specific re-invention of the instance variable, though. David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org