[cdi-dev] API to chain Decorators programmatically?
ondrej.mihalyi at gmail.com
Sat May 28 17:24:28 EDT 2016
I think that Decorators are a great concept in CDI, but it cannot provide
solution to a wide variety of problems where the general decorator pattern
AFAIK, it is not possible to chain decorators at runtime, in order to reuse
the decorator mechanism to solve class explosion problem and create a
flexible architecture, similar to what java.io API provides with chained
input/output streams (subclasses of java.io.InputStream
I think it would make sense to be able to apply decorators to a bean at
What do you think about extending *Instance* class by adding a method like*
Instance<T> decorateWith(Class<?> c)* as in the following example?
DecoratedInterface decorated =
I haven't find a way to do something similar using the current API, nor did
I find any third-party CDI extension to provide something similar.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cdi-dev