lifespan of Injection where bind=true, required=false

16 views
Skip to first unread message

breakoutj

unread,
Jan 27, 2012, 11:33:42 AM1/27/12
to Swiz Framework
Hi folks.

I tried searching for this but given the particulars, I don't think my
search parameters were finding any previous posts on the matter. I
apologize if this has been answered previously.
I am curious to know the following (hopefully it's a simple yes/no
type thing). Given a property as an injection target:

[ Inject( source="model.foo", bind="true", required="false" )]
public var myFoo:Object;

What happens AFTER when the injection is fired when the model is not
present (model == null)? If when the model is instantiated via the
beans, will this injection fire again? Or due to the required=false,
the binding simply tried once and then stops working since the model
was not present the first time?

This may sound like a fringe case, however this occurs when using
certain module scenarios where controller to controller communication
is being used. In this case, an app-level controller has some non-
required inquiries on a module-level controller.

Brian Kotek

unread,
Feb 3, 2012, 10:37:18 AM2/3/12
to swiz-fr...@googlegroups.com
It may help to reiterate that once the bean with this injection is set up, the only thing that will cause the value to change is the binding to the model. So creating the model AFTER the injection is process does not "re-setup" the injection. If that were the case, every time a bean was created Swiz would have to go through every other injection it ever set up trying to determine if it should "set it up again", which would be a big impact on performance.

Does that help?

Thanks,

Brian



--
You received this message because you are subscribed to the Google Groups "Swiz Framework" group.
To post to this group, send email to swiz-fr...@googlegroups.com.
To unsubscribe from this group, send email to swiz-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swiz-framework?hl=en.


Reply all
Reply to author
Forward
0 new messages