Archive

Posts Tagged ‘flash’

Tuning The Legs

March 10th, 2010 shaun View Comments

The Robotlegs MVCS implementation was designed to be convenient: quick-n-easy for common use cases. Nothing is free, of course, and that convenience comes at a cost. I want to highlight a few things that can be tweaked to improve performance for applications that really need it.

Automatic Mediation

In order to determine the scope of a view component, Robotlegs listens to the contextView for bubbling capture-phase ADDED_TO_STAGE events:

MediatorMap.as#L233
MediatorMap.as#L260

Every display object that lands on the stage inside the contextView is checked against a mapping dictionary. This can be quite expensive for complex display object hierarchies where there is a lot of re-parenting. It’s also the only option available if you want to keep your view components completely framework-unaware. If, however, you’re prepared to modify your components slightly (it’s a one-liner) then you can try out this utility:

http://github.com/eidiot/robotlegs-utilities-LazyMediator

Instead of listening for ADDED_TO_STAGE events emitted by every component, we listen only for custom events dispatched by view components that explicitly require mediation.

Note: This utility currently only supports the MediatorMap and needs to be expanded to support the ViewMap. Fork and improve!

Default Injection Points

The actors in the MVCS package have a number of pre-configured injection points (dependencies). When you extend mvcs.Command all you are really doing is inheriting some dependencies:

mvcs/Command.as#L23

Whilst handy, it is quite seldom that we actually use all of those in a given Command.

A much cleaner, and ever-so-slightly cheaper approach is to declare only the dependencies that you actually need. Instead of extending Actor or Command (this doesn’t work so well for the Mediator class), just create a vanilla class and declare your dependencies manually:

public class MyCommand
{
	[Inject]
	public var injector:IInjector;

	public function execute():void
	{
		injector.mapClass( Vehicle, Car );
	}
}

Remember, the Robotlegs apparatus is already mapped for you if you need anything:

mvcs/Context.as#L190

Notice that the IEventMap is not mapped as a value or singleton – you’ll get a new IEventMap instance whenever you ask for one.

That’s it for now!

Categories: Robotlegs Tags: , , ,

Robotlegs v1.0.0 – Out Now!

November 26th, 2009 shaun View Comments

Robotlegs AS3 v1.0.0 has been released

A huge big “Thank You” to everyone involved. Let the “utility building” begin!

Robotlegs is an automated dependency injection framework for Flash, Flex and AIR.

Categories: Robotlegs Tags: , , ,

Robotliz 2 – A Six Minute Cleanup

November 12th, 2009 shaun View Comments

Just a quickie – I cleaned up the Robotliz app a little. In this short vid I walk through the new structure and touch on some light Git/GitHub flows:

RobotlegsVimeo

The (better, but not awesome) code is over at:

http://github.com/darscan/SillyStockPriceExample/tree/robotlegs

Categories: Robotlegs, Tutorials Tags: , , , ,

Robotliz – Using Robotlegs like Swiz in 20 minutes

November 10th, 2009 shaun View Comments

Warning: The style of architecture demonstrated in this video is not sexy. Nor is it in any way recommended. Also, I cheat by eating plenty copy-pasta, and I say “um” a LOT.

I’m still trying to figure about the best way to illustrate the simplicity and flexibility of the Robotlegs framework. In the meantime however, I thought I’d respond to this cool Swiz video by doing the same thing with Robotlegs – except ending up with a modular (as opposed to a static) app, and throwing in some git/GitHub love as a bonus.

I don’t have a nice mic, so I strapped a phone to the side of my head and left myself a really long voicemail. Anyhoo:

RobotlegsVimeo

You can grab the (terrible) source over at:

http://github.com/darscan/SillyStockPriceExample

RobotLegs AS3 v0.9: ElasticChaos (Broken, Fixed, Tidied, Improved)

October 7th, 2009 shaun View Comments

RobotLegs AS3 v0.9 (codename ElasticChaos) is up on GitHub:

RobotLegs is nearly at v1.0! Many awesome changes since v0.8, with the most community involvement to date:

http://github.com/robotlegs/robotlegs-framework/commits/v0.9.2

The “Official RobotLegs Framework Repository” has also been moved:

http://github.com/robotlegs/robotlegs-framework

Read more…

Categories: Robotlegs Tags: , , , , ,

RobotLegs – RazorSharpness Through Collaboration

October 3rd, 2009 shaun View Comments

Yagninator

Help make RobotLegs the cleanest, smallest, most testable, and most kick-ass framework for Flash and Flex ever built – join the discussion group:

http://groups.google.com/group/robotlegs/topics

Or help fill up the Robotlegs Knowledgebase:

http://knowledge.robotlegs.org/

RobotLegs AS3 v0.8: ByeByeFlex (FlexMediator removed)

September 10th, 2009 shaun View Comments

RobotLegs AS3 v0.8 (codename ByeByeFlex) is up on GitHub:

The RobotLegs Library has received it’s first community contribution! Till Schneidereit fixed something that had been bugging me for a while: the existence of the FlexMediator. Initially I split this out to avoid compiling any Flex classes into pure AS3 projects. Till submitted a patch that allows the Mediator to detect the presence of Flex without this side-effect.

This is why I love Git (and GitHub). Anyone can come along, fork the project, make changes to it, and send a Pull Request – without requiring any permission to do so. This significantly lowers the barrier-to-entry for once-off or “impulse” contributions.

Anyhoo, this change to the Library requires a find-n-replace on old application code:

FlexMediator -> Mediator

RobotLegs AS3 is a Dependency Injection Driven MVCS Framework for Flash and Flex.

Categories: Robotlegs Tags: , , ,

What Is RobotLegs?

September 7th, 2009 shaun View Comments

What?

  • RobotLegs is an Architectural (or Structural) Action Script 3 Framework.
  • It provides a mechanism for wiring objects together.
  • It promotes a usage pattern for keeping your code loosely coupled and easy to test.
  • It has a narrow scope: wiring.

Read more…

Categories: Robotlegs Tags: , , , ,

RobotLegs AS3 Framework Unit Tests

September 5th, 2009 shaun View Comments

I’ve started putting together some unit tests for RobotLegs:

http://github.com/darscan/robotlegstests

Feel free to fork if testing is your idea of insane weekend fun!

RobotLegs

Categories: Robotlegs Tags: , , ,

RobotLegs AS3 v0.7: ShortWave (context dispatch helper)

September 5th, 2009 shaun View Comments

RobotLegs AS3 is a Dependency Injection Driven MVCS Framework for Flash and Flex.

RobotLegs AS3 v0.7 (codename ShortWave) is up on GitHub: Read more…

Categories: Robotlegs Tags: , , ,