Using the .as files as source, not .swc
Release 0.8 dowloaded by the svn at 2009-07-20
Flex Builder 3 - Flex SDK3.2 - ActionScript Project
Flash Player 10.0.22.87 Debug
The scenario is the following:
<object id="singletonClass" class="com.flsilva.samples.springextensions.actionscript.flash.lazyinit01.SingletonClass" lazy-init="true">
<property name="name">
<object class="org.springextensions.actionscript.ioc.factory.config.FieldRetrievingFactoryObject">
<property name="targetObject" ref="prototypeClass" />
<property name="targetField" value="propertyX" />
</object>
</property>
</object>
<object id="prototypeClass" class="com.flsilva.samples.springextensions.actionscript.flash.lazyinit01.PrototypeClass" lazy-init="true" scope="prototype" init-method="init" />
So the 'prototypeClass' is instantiated by 'preInstantiateSingletons()' because the 'singletonClass' has a dependency on 'prototypeClass'. If I remove this dependency, its not instantiated.
But both are lazy-init="true", so I think this is an issue. This occurs with or without the 'init-method' in the 'prototypeClass', which is called when it is present.
Also, the 'singletonClass' is not instantiated, but only its dependence ('prototypeClass').
This is done by the container in the boot time for check if the dependence is correct?
I think both are as lazy-init, this should not happen.
I am sending the sources so you can verify. It's pretty simple, with the FB3 ActionScript Project.
But one thing is pretty important:
Since I am working with the container, I found some problems and got myself settled, otherwise would be held here. Then you will see that the source that sent, several classes have been modified by me so that I could use the container (see the issues that I have sent, some were not yet resolved, and I just somehow addressing here). But I really think that the changes I made are off and not affect the core of the container. Also, please try to test with the official source for you to see if you can.
Let me know if I'm doing something wrong.
PS.: I was thinking these days that I have worked with the container, I am working on a personal framework based on the container and its extension to pureMVC. Its amazing and I really am enjoying very much. Based on this, is my total interest in the container is perfect, stable, no issues. I know that you guys are doing a very good job, but do not have all the time in the world. So I would propose to help more. Since I have solved some problems here and has really worked, I think I could help the best, publishing and collaborating in SVN.
I am a Flash developer with strong knowledge of OO, patterns, etc. I really like the heavy side of software development, is what made me become interested in the container. But I admit that the container is something that is beyond my knowledge. I have studied it and learned much (to dispel a little more each day), and I have given very good with him, solving problems and implementing my framework.
So, beta tester I am of course, I wonder if there was the possibility to collaborate with the development, solving some issues (which in fact some have even fixed).
So if interested tell me and we can talk about how, processes and so for me to work directly with the SVN.
My email:
flsilva7@gmail.com
best regards
Flávio Silva
Because I have a "<object class="org.springextensions.actionscript.ioc.factory.config.FieldRetrievingFactoryObject"> " element, it's treated like any other, what mean that it's being instantiated, because it's NOT flagged as lazy-init="true". So because it have an "dependency" to the'prototypeClass' (<property name="targetObject" ref="prototypeClass" /> ) it is instantiated too.
When I flag it, changing to <object class="org.springextensions.actionscript.ioc.factory.config.FieldRetrievingFactoryObject" lazy-init="true"> the problem is solved.
What I think about this is:
Since that FieldRetrievingFactoryObject in this case is an INNER object, with his parent ('singletonClass') flagged as lazy-init="true", it shouldn't be instantiated, as inheritor.
This should happen with any INNER object.
So let me know what you guys think about it.