Applicability
Use the Resource Decorator pattern when:
You need to attach additional behavior to a resource, but changing its source code is not feasible. Most database resources are provided by commercial vendors. In the rare case that source code is available, changing, compiling, and supporting new versions is expensive and creates maintenance issues. You need to attach identical behavior to multiple resource implementations. Many applications support multiple database platforms, yet require the same extra functionality for each platform. You need to associate an additional behavior with many resource operations without spreading that behavior across your application code. You need the ability to dynamically enable an additional behavior without changing application or resource code.
 |