← Back to Upcase

Looking for the right terminology for presenters, decorators, exhibits, POROs


(Justin Gordon) #1

I’m looking for the least confusing and most standard terms to describe:

  1. Draper Decorators (decorators or presenters)
  • delegates to the model
  • extension of model for presentation logic, can generate HTML or whatever the views want.
  1. A PORO that encapsulates code such that uses the context of the request, along with the model, so that
  • the view and controller have minimal logic
  • no presentation code in the model
  • doesn’t delegate all methods to the model, so probably presenter and decorator don’t work for this one.
  1. A PORO that handles the interaction between models for a given purpose, which I’d call a Service Object.

And then there are Exhibitors, which I’m not sure are worth bringing into the mix of terminology.

Any advice on the most standard and least confusing names.

This article sums up some of the discussion based on Advi’s Objects on Rails book: http://mikepackdev.com/blog_posts/31-exhibit-vs-presenter

Thanks.


(Geoff Harcourt) #2

I think these terms get a little interchangeable, and there’s disagreement about what exactly is what.

You’re way ahead of the game for making use of these patterns.


(Rowland Lip) #3

A lot of times we use the wrong name for a patten in ruby… I’m not really sure if its important, but if you do care, read the gang of four book . . .


(Justin Gordon) #4

For #2, I’ve settled on the term Presenter. I’m interested in clarity, not some conformity with an abstruse book published 20 years ago in 1994.