0

I have a quick, very uninformed question about the Decorator pattern. If I have a class called BlackBox that I cannot edit in any way - can't add an interface, can't make any of the methods virtual, etc. - can this object be decorated using the Decorator pattern? If so, how?

skaffman
  • 398,947
  • 96
  • 818
  • 769

1 Answers1

3

You can create a wrapper for it (i.e., implement the Adapter pattern) and decorate the adapter.

Don Roby
  • 40,677
  • 6
  • 91
  • 113