Hi again
I'm going forward in the study of SAS, and I'm trying to use the metadata [Autowired] to inject the properties into a class.
In the test I did, I saw that the property to be injected is null when I'm in the class constructor.
my question is: can I get properties with [Autowired] and use them immediately in the constructor? or [Autowired] happens next?
My intention is to retrieve the url to load from appModel, but in constructor this property is not available.Code:[Command(eventType="startupEvent")] public class StartupCommand extends GenericOperationCommand { [Autowired] public var appModel : ApplicationModel; public function StartupCommand() { super(LoadURLOperation, appModel.url); }
I know that i can use a <constructor-arg > tag in application-context.xml, but [Autowired] solution seems to be so elegant
When the execute method is performed, however, the property is accessible.
For now the solution I adopted is this
Code:public function StartupCommand(appModel:ApplicationModel) { super(LoadURLOperation, appModel.url); }
Thanks, and sorry if I'm full of questions, but this framework inspires me a lot and I would like to start using it professionally, but without these tests i cannot tell my boss "I'm sorry but I'm not inside at the time of delivery because I have developed with a framework that I do not know "
Marco




Reply With Quote
And don't apologize for asking questions, we're happy to help 