-
1. Re: Decorator Rules
chasetec Feb 22, 2010 6:23 AM (in response to chasetec)And just to point it out. I didn't have any interfaces (decorator types) on my decorator. They don't seem to be needed for anything. Decorator methods should be limited to either the decorator types on the decorator or to the type of the delegate.
-
2. Re: Decorator Rules
pmuir Feb 22, 2010 9:21 AM (in response to chasetec)The relationship is AND :-)
Having the decorator implement the interfaces makes the contract much clearer for the developer, as it means you won't end up having a method void someSupportMethod() on the delegate type (which shouldn't be decorated, it's an implementation detail) and on the decorator (again, it's implementation detail).
Matthieu Heimer wrote on Feb 22, 2010 06:23:
And just to point it out. I didn't have any interfaces (decorator types) on my decorator. They don't seem to be needed for anything. Decorator methods should be limited to either the decorator types on the decorator or to the type of the delegate.This is a bug in Weld 1.0.0, in 1.0.1 you do need to declare an interface on the decorator (otherwise it's a definition error), and only methods declated on it will be decorated.