Created
July 12, 2011 03:55
Decorator pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Abstraction | |
{ | |
void Proc(); | |
} | |
public class Impl1 : Abstraction | |
{ | |
public void Proc() | |
{ | |
} | |
} | |
public class Impl2 : Abstraction | |
{ | |
public Impl2(Abstraction inner) | |
{ | |
_inner = inner; | |
} | |
public void Proc() | |
{ | |
// do some extra stuff | |
_inner.Proc(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment