jcasimir/draper — Issue #94: Appropriate use of decorator pattern
Author: theozaurus
Created: 2011-12-07 11:26:09+00:00
State: open

Not an issue with Draper per se but I was hoping this would be a sensible place to ask.

I have a system whereby there could be multiple ways of looking at any particular business object for example. An xml representation, one useful for showing to normal users in HTML, another for showing an admin about flagged items.

Draper of course does not prevent multiple decorators for the same object, and I can see there is work on inferring the correct decorator (https://github.com/jfelchner/draper/commit/404f9d9044c007002a105ac7fae7c89e27a8a4e8).

Is it a sensible use case to do something like this: