阅读背景:

装饰设计模式使用服务对象(单例)

来源:互联网 

I'm working on a project where I need to add some functionality to a service object and using a decorator to add it in seems like a good fit. However, I've only ever used decorators with simple beans, never on a singleton like a service object. Has anyone ever done this before and what are the pros and cons? In this case I don't think creating a subclass will work so a decorator seems to be a good fit. What are your thoughts on doing this?I'm working on a project where I need to add so




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: