On Sun, Apr 12, 2009 at 1:36 PM, Shalon Wood <[email protected]> wrote:
>
>
> I just ran across an article about wrapping up form elements as
> first-class objects, and it's very intriguing. I can see where it might
> be useful, but I'm wondering if there are any non-obvious drawbacks to
> it.
> http://www.flyingmachinestudios.com/2009/04/08/view-objects-in-merb/

Widgets aren't really a new idea.  I think what's being described here
is a reinvention of the Presenter pattern
(http://blog.jayfields.com/2007/03/rails-presenter-pattern.html).
With some clarification and finessing,this could be an interesting way
to return atomic values from multiple form elements, but right now
it's very clumsy in its calling convention.  This also twists MVC in
ways I'm not comfortable with, and his waving off "You need Javascript
to make this work, which I won't include here" dispels the illusion of
encapsulation.

Finally, he's just wrong about not getting to treat compositions of
form fields as objects.  One could implement his example very easily
with a small utility model and fields_for.


-- 
Have Fun,
   Steve Eley ([email protected])
   ESCAPE POD - The Science Fiction Podcast Magazine
   http://www.escapepod.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to