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

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

September 5th, 2009 shaun Leave a comment Go to comments

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

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

This massive update to the RobotLegs framework adds a dispatch() helper method to the mvcs context.. That is all!

RobotLegs

Categories: Robotlegs Tags: , , ,
  • Subb

    So, you guys replaced PureMVC’s singletons by a context object? http://misko.hevery.com/code-reviewers-guide/flaw-digging-into-collaborators/

  • Subb

    So, you guys replaced PureMVC’s singletons by a context object? http://misko.hevery.com/code-reviewers-guide/flaw-digging-into-collaborators/

  • http://shaun.boyblack.co.za/blog/ shaun

    Hi Subb,

    No, not really. The context just holds on to the RobotLegs apparatus – it’s not a “holder” or a “kitchen sink” object. Why it’s called a context is another discussion.

    “Avoid reaching into one object, to get another, etc. Do not look for the object of interest by walking the object graph (which needlessly makes us intimate with all of the intermediary objects. The chain does not need to be deep. If you count more than one period in the chain, you’re looking right at an example of this flaw.”

    If you were to look into the framework code, or the code of an application that uses the framework properly, you wouldn’t find any examples of this. Single dots all the way yo!

    “Inject directly the object(s) that you need, rather than walking around and finding them.”

    This is exactly what RobotLegs does, and what it enables for applications that use it.

    RobotLegs is all about making the right thing easy to do. The inspiration for building it came directly from reading Miško Hevery’s posts.

    So, perhaps the word “context” was a really bad choice!

    Cheers,

  • http://shaun.boyblack.co.za/ shaun

    Hi Subb,

    No, not really. The context just holds on to the RobotLegs apparatus – it’s not a “holder” or a “kitchen sink” object. Why it’s called a context is another discussion.

    “Avoid reaching into one object, to get another, etc. Do not look for the object of interest by walking the object graph (which needlessly makes us intimate with all of the intermediary objects. The chain does not need to be deep. If you count more than one period in the chain, you’re looking right at an example of this flaw.”

    If you were to look into the framework code, or the code of an application that uses the framework properly, you wouldn’t find any examples of this. Single dots all the way yo!

    “Inject directly the object(s) that you need, rather than walking around and finding them.”

    This is exactly what RobotLegs does, and what it enables for applications that use it.

    RobotLegs is all about making the right thing easy to do. The inspiration for building it came directly from reading Miško Hevery’s posts.

    So, perhaps the word “context” was a really bad choice!

    Cheers,

  • Benoit Jadinon

    hi, what’s a dispatch helper ? what is it used for ? thx

  • Benoit Jadinon

    hi, what’s a dispatch helper ? what is it used for ? thx

  • http://shaun.boyblack.co.za/blog/ shaun
    protected function dispatch(event:Event):void
    {
        eventDispatcher.dispatchEvent(event);
    }

    So that you can type dispatch(event) instead of eventDispatcher.dispatchEvent(event);

  • http://shaun.boyblack.co.za/ shaun
    protected function dispatch(event:Event):void
    {
        eventDispatcher.dispatchEvent(event);
    }

    So that you can type

    dispatch(event)

    instead of

    eventDispatcher.dispatchEvent(event);
blog comments powered by Disqus