The Decorator pattern. Based on Design Patterns book by Head First.