tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/88-convert-a-project-from-puremvc-to-robotlegsRobotlegs: Discussion 2013-04-28T10:29:49Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/11794872010-03-09T12:55:34Z2010-03-09T12:55:36ZConvert a project from PureMVC to Robotlegs<div><p>Although minor for most projects, 1 advantage I see PureMVC
having is the much lighter compiled code base, about 12 vs 29k for
Robotlegs.</p>
<p>Are there plans to optimize-refactor Robotlegs further?</p></div>eco_bachtag:robotlegs.tenderapp.com,2009-10-18:Comment/11794872010-03-09T20:15:26Z2010-03-09T20:15:26ZConvert a project from PureMVC to Robotlegs<div><p>Hi eco_bach,</p>
<p>Those sound like debug sizes to me - last I checked, PureMVC
compiled down to about 5k for a release build, and
Robotlegs+SwiftSuspenders comes to around 12k (also, for a release
build; debug build sizes are unimportant). Robotlegs by itself
weighs about 4k - but that's pretty meaningless as it won't do much
without a Dependency Injection framework (like SwiftSuspenders,
Spring or SmartyPants).</p>
<p>Of all the available options for DI + MVC, Robotlegs is probably
the smallest you can get; PureMVC + Spring, for example, would be
quite a bit bigger (somewhere around 40k I'd imagine).</p>
<p>With regards to porting: I've personally ported quite a couple
of projects from PureMVC to Robotlegs and had no problems, but then
again, I know this framework inside-out ;-)</p>
<p>One annoyance might be the creation of custom event classes to
replace old notifications.</p>
<p>Another might relate to PureMVC's concept of named/dynamic
proxies/mediators - where strings are used to match mediators to
proxies. You'd need to use a different approach with RL. See:
<a href=
"http://groups.google.com/group/robotlegs/browse_thread/thread/dd60a96d57c6dc85/cef7834cc5ae65be">
http://groups.google.com/group/robotlegs/browse_thread/thread/dd60a...</a></p>
<p>Also, injecting mediators into other actors (models, commands,
other mediators) doesn't make sense in Robotlegs as there is no
guarantee that only one mediator will exist for a given view type.
This boils down to basic MVC principles though - the application
shouldn't know about it's view.</p>
<p>Otherwise, most things map 1 to 1 with PureMVC. That said, I
would dig into the demo apps and play around for a while before
doing a serious port.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/11794872010-03-09T22:55:32Z2010-03-09T22:55:32ZConvert a project from PureMVC to Robotlegs<div><p>Thanks Shaun!<br>
Where can I grab the non-debug version of
Robotlegs+SwiftSuspenders?<br>
jim bachalo</p>
<p>[c] 416.668.0034</p>
<h2>[w] <a href=
"http://www.tweetmasher.com">www.tweetmasher.com</a></h2>
<p>"...all improvisation is life in search of a style."</p>
<pre>
<code> - Bruce Mau,'LifeStyle'</code>
</pre></div>Jim Bachalotag:robotlegs.tenderapp.com,2009-10-18:Comment/11794872010-03-10T07:18:35Z2010-03-10T07:18:35ZConvert a project from PureMVC to Robotlegs<div><p>Hi Jim,</p>
<p>Debug vs Release comes down to how you compile your final SWF.
If you are using Flash Builder 4 you can export a Release build of
your project by going to:</p>
<p>Project -> Export Release Build...</p>
<p>Instead of compiling into a bin-debug folder, your output gets
compiled into bin-release.</p>
<p>I'm pretty sure it's the same with Flex Builder 3. For other
IDEs/editors you'd have to check the documentation, or set a
command-line option.</p>
<p>Debug builds contain a lot of extra information that is not
needed for a final release. Release builds are usually quite a bit
smaller and perform slightly better (sometimes the performance
increase is substantial).</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/11794872010-03-10T15:55:04Z2010-03-10T15:55:07ZConvert a project from PureMVC to Robotlegs<div><p>Hi Shaun</p>
<p>Perhaps I'm missing something here. I appreciate all the
feedback and am anxious to try Robotlegs, but when you
say...'PureMVC compiled down to about 5k for a release build, and
Robotlegs+SwiftSuspenders comes to around 12k'.</p>
<p>How do you obtain those figures?<br>
I've never been able to either download or compile my PureMVC swc
smaller than 12k.<br>
And, at least from what I've been told, the size of the swc IS the
size of the final code when compiled into your swf.</p>
<p>Also, please correct me if I am wrong, but I don't believe there
is such a thing as a 'non-debug' version of a swc....you can only
compile a FB Library project to a swc...exporting a release build
is not an option. As I am still mastering the finer points of FB
compilation, I may be missing something.<br>
Feedback appreciated...</p></div>eco_bachtag:robotlegs.tenderapp.com,2009-10-18:Comment/11794872010-03-10T16:39:11Z2010-03-10T16:39:11ZConvert a project from PureMVC to Robotlegs<div><p>Howdy!</p>
<p>No problem. SWC files are definitely bigger than compiled
release bytecode - they contain trace information, line numbers,
assets, and probably more. But you're right about the fact that you
don't get non-debug SWC files. SWC files have to contain debug
information or we wouldn't be able to use them as libraries!</p>
<p>What's more important than the size of the SWC file is the size
of the bytecode that gets compiled into your final "release" SWF
file. This is affected by how many classes you actually pull into
your project from the library. Import statements don't count, only
classes that you actually reference (and classes that they
reference etc). This is called a dependency graph:</p>
<p><a href=
"http://en.wikipedia.org/wiki/Dependency_graph">http://en.wikipedia.org/wiki/Dependency_graph</a></p>
<p>Code that is not in the dependency graph for your application
does not get compiled into the final SWF. You could have a 5MB SWC
library in your source path, but if you don't actually reference
any of the classes in that library no weight is added to your
SWF.</p>
<p>Likewise, you might reference one class, which in turn
references another, and another, and so on, and inadvertently you
end up compiling all 5MBs worth of classes into your output. This
happens when classes have too many responsibilities and references.
The Flex framework is often criticized for this - touch one class
and suddenly you've added 400k to your SWF!</p>
<p>To test the size of PureMVC, for example:</p>
<p>Create an empty ActionScript project with Flash/Flex Builder<br>
In your main class instantiate PureMVC's Facade class<br>
Project -> Export Release Build...<br>
Check your bin-release folder</p>
<p>The Facade class, by way of reference, touches pretty much every
class in PureMVC - not exactly, but close enough to get a good idea
of the minimum weight added by the framework.</p>
<p>Size tests for Robotlegs can be found here:</p>
<p><a href=
"http://github.com/robotlegs/robotlegs-demos-Bundle/tree/master/SizeTest/">
http://github.com/robotlegs/robotlegs-demos-Bundle/tree/master/Size...</a></p>
<p>Hope that helps!</p></div>Shaun Smith