Dec 17th, 2009, 04:58 PM
Does IOC in Flash make sense?
So I guess there is more than one way to answer this, but my main question is does it even make sense to graph your objects with IOC?
Maybe this is more of a run-time vs compile time issue, but wouldn't it be really expensive to use reflection at run-time? I think this would cause a noticeable lag at start-up for Flash/Flex projects that have a significant amount of object creation.
This is more of a question of interest, as the concepts in IOC are really strong and represent Best Practices in construction, but I am concerned that this might be a solution looking for a problem scenario.
Just an honest question.
Dec 18th, 2009, 02:34 AM
While its true that application start-up will be slightly slower because of the reflection calls, IMHO this is not a breaking issue. as3commons-reflect caches all reflection data so that's already quite a big optimization speed-wise.
In most cases app start-up slowdown is only a matter of a fraction of a second, so in my experience its never been a huge problem.
Of course, if you're using IoC at run-time in some really graphically heavy routines it might be a cause for slow-down, but that's a really specific scenario so in that case you might wanna change your strategy.
Overall, I've never gotten into trouble.
Dec 18th, 2009, 05:16 AM
Graphically heavy routines?
By this do you mean a ton of UI creation?
Dec 18th, 2009, 05:44 AM
Anything that involves large amount of objects being created rapidly and added to the stage. But then it'll only be a problem if the objects that are being created ALL need to be injected, this will not always be the case I think.
But even then, with a smart way of object caching/pooling this could still be optimized quite a lot.
Dec 18th, 2009, 08:30 AM
I appreciate your diligence on this board. Looking forward to getting some applications out with the framework.
Dec 18th, 2009, 08:51 AM
Nice to see a new user coming on board Please let us know how you fare, feel free to ask for help when needed, we're here to help.
Tags for this Thread