Decorators as Interfaces

David Worth - dave@highgroove.com
@highgroovedave

So you want a little view logic

At first putting it in the model is fine...

and we might have a view to show it

But we might need another class that Quacks like a Widget and has to be displayed identically

First lets refactor this correctly

Now it's easy to add another louder class

... and display it in the same view (i.e. it quacks alike)

And, to make life easier from now on...

Which prevents any other class from blowing up if it in inherits from WidgetDecorator and is rendered in the same view

Thanks!