# 120 - Learning the Decorator Pattern


6/23/2009
Level: Intermediate
Tags: Design Patterns
Comments: (4)
Author:
Derik Whittaker


In this episode we will take at how we can use the Decorator Pattern in our application.

The decorator pattern is a structural pattern which allows you to attach new or additional actions to an object dynamically. Using the decorator pattern provides a very clean and flexible alternative to subclassing (via inheritance) your object and thus creating an unwanted inheritance tree
Click here to Watch this Episode

Download (11.33 MB) (9:06) (1440x900)
Download (8.03 MB) (9:06) (960x600)

Links/Resources:


Comments: (4)

Tom Pester said....

Love these short little tutorials

* I want to show a nice Resharper feature that can speed up delegating responsiblity which the Decorater pattern uses heavily 

http://screencast.com/t/MKoRxlTzbTr

"Delegating Members" is one of those R# feafture that can come in realy handy in a lot of contexts

* A bit of nitpicking :) The bot blocks an attack every 11 th time and not 10 th right ?

* A use of the decorator pattern in the .NET framework is where you can wrap a stream and add compression to it(zip/deflate) or encrypy/decrypt it.

 

 


6/23/2009 1:25:15 PM

Dmitri said....

A while ago I wrote a vs add-in for generating decorators from the existing code base. It can be found here: http://www.codeproject.com/KB/codegen/decorators.aspx


6/25/2009 3:13:46 AM

Josh Hardspace said....

I hadn't quite got my head around the Decorator so thanks for the vid. It's much appreciated.


8/4/2009 8:42:32 PM

Mark said....

Is it Resharper that is allowing you to fly through all of that with the cuttign and pasting of specialized things? While I am not new, I am barely novice and that seems awesome. I do have Resharper avilable for my use, but haven't dug into it much yet. In fact I seem to turn it off. I see there are some vids up for it, so maybe they can walk through with its use... or at least give someone such as myself some more insight. My intent was to watch the cool video and the series for design patterns, but got thrown off with that magic. So again, if it wasa something other than resharper, please inform. Thanks much for all the great vids and hard work!


8/17/2009 4:48:19 AM


Name: *
Email (not displayed): *
Url:
Comments: *



So, you Human...?