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?

4

1 に答える 1

3

そのためのラッパーを作成 (つまり、アダプターパターンを実装) し、アダプターを装飾することができます。

于 2011-06-20T16:25:50.597 に答える