On 3 Nov 2011, at 23:25, Patrick J. Collins wrote:

>> I realise this isn't the answer you're looking for, but I'm curious: where
>> did you get the idea that a presenter should know anything about HTML?
> 
> Maybe I am using the wrong terminology then.  I always thought presenters were
> classes that output presentational content

Well, in any discussion I've seen of the pattern, that's the job of the view.

MVP / Passive View[1][2] is quite a well-established pattern in curly-bracket 
languages, and the presenter's job in that pattern is to tell the view, at a 
logical level, what to show. The view is then just left with the simple job of 
showing it. The idea being that you could use the same presenter with a view 
for a web app, a view for a rich-client GUI, or a view for a mobile app. In 
theory.

This makes them both much easier to test.

Steve Klabnik has been writing about their application in the Ruby / Rails 
world recently[3]

[1] http://martinfowler.com/eaaDev/PassiveScreen.html
[2] http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf
[3] http://blog.steveklabnik.com/2011/09/06/the-secret-to-rails-oo-design.html

cheers,
Matt

--
Freelance programmer & coach
Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy)
Founder, http://relishapp.com
+44(0)7974430184 | http://twitter.com/mattwynne

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to