[UI] ToolBuilder

Jason Johnson jason.johnson.081 at gmail.com
Wed Sep 12 18:32:39 UTC 2007


On 9/12/07, tim Rowledge <tim at rowledge.org> wrote:
> The problem with 'decorators' or wrappers is that they need to
> implement all the methods of anything that they will wrap in order to
> pass them on to the internal component. You could, of course, try to
> handle this by (ab)using doesNotUnderstand but the performance cost
> would be nasty. I think. Anyone got time to implement and time a test
> harness?

Well, I was hoping that if we start from ground up we will end up with
components that don't have such incredibly wide interfaces.

Failing that, we don't have to pay the price of DNU, we can have the
DNU handler just create a forwarding method for any methods that
actually get called.

Another possibility is that perhaps there is another way around this.
For example, in our new framework how will these View classes be used?
 If they have to register for any UI events they deal with then then
decorator just registers himself for the events he decorates and the
decorated class for all others.

Totally hypothetical example:

MySpecialScrollyTextBox>>register

  World allPossibleEvents do: [:event|
    (self decoratedEvents includes: event)
      ifTrue: [ World on: event send: event to: self ]
      ifFalse: [ World on: event send: event to: decoratee ] ]


More information about the UI mailing list