I have a quick, very uninformed question about the Decorator pattern. If I have a class called BlackBox that I cannot edit in any 开发者_如何学JAVAway - 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?
You can create a wrapper for it (i.e., implement the Adapter pattern) and decorate the adapter.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论