> From: Aaron Sherman [mailto:[EMAIL PROTECTED] > > On Fri, 2004-04-30 at 23:12, Austin Hastings wrote: > > > > From: Aaron Sherman [mailto:[EMAIL PROTECTED] > > > > I think you want a combination of re-dispatch and delegation: > [...example code...] > > > That should do what you want. > > > > Well, not really: > > > > 1- It required a lot of text for little gain. > > Oh, I would never DO that, I was just complying with what you asked for. > I would have just called the methods on the encapsulated objects, which > you did not like. > > > 2- Most of the required text was redundant. > > Not really. I defined each of the methods you wanted once in the role > and then re-dispatched them manually in the message and error classes. > You should be able to override dispatch in those classes and remove the > extra definition of each method. I just didn't have a handle on the > re-dispatch part.
Nor did I, until I started looking at your example (for which, thanks). My point is that I do want a little bit of golf. I am a bear of very little brain: if I can think of the question, the answer should be either easy or impossible. If it's neither, then there's a flaw in my question, or in the system. (Mostly it's my questions, but I do get lucky once in a while. ;-) > But, you didn't say you wanted golf, you said you wanted a solution that > avoided "$obj.message.clear", which is what I gave you. You do not need > parameterized roles of any sort for the solution. The solution isn't the interesting part: the problem is. The point of the question was to come up with an example of templating/parameterized classes, trying to use roles instead. (The correct answer to the specific question is "<?php ...?>" :-) =Austin