incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug McCune <d...@dougmccune.com>
Subject Re: Flex 5 UIComponent - Behavior Pattern
Date Mon, 23 Jan 2012 18:31:29 GMT
Alex, first, thanks for that memory breakdown, very helpful.


> The issue was not in the cost of the
> allocations, it was in the cost of an additional function call to run the
> actual work.  Everything is now being proxied.


What if when setting the composited piece you always stored a hard
reference to all the functions, so something like this:

private var setFocusFunction:Function;
public function set focusBehavior(value:IFocusBehavior):void {

this.setFocusFunction = value.setFocus; //where setFocus() is a function

}

and then when needing to set the focus, UIComponent calls
this.setFocusFunction() instead of calling focusBehavior.setFocus()

Since now the function is stored in UIComponent, does that get around the
perf. problem of always calling a proxy like focusBehavior.setFocus()?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message