Spring ActionScript

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    3 Favorites

    Spring ActionScript - Presentation Transcript

    1. Christophe Herreman www.herrodius.com <Flex:Camp/> Belgium 11 December 2008 Prana goes Spring Introducing Spring ActionScript
      • What is Spring ActionScript ?
      • An Inversion of Control (IoC) Container for ActionScript 3.0
      • Based on Java Spring
      • Current release 0.6
      • Incubated as a Spring extension, working towards a 1.0 release
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • What is Spring ActionScript ?
      • Cairngorm support
      • PureMVC support
      • Reflection API
      • Several Utilities (Assert, FlexUnitTestCase, …)
      • Domain base classes (Entity, ValueObject, …)
      • AOP, MVCS, …
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • What is Inversion of Control ?
      • Inversion of Control, also known as IOC, is an object-oriented programming principle that can be used to reduce coupling inherent in computer programs.
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • Types of Inversion of Control ?
      • Dependency Lookup
        • Dependency Pull
        • Contextualized Dependency Lookup
      • Dependency Injection
        • Constructor Injection
        • Setter Injection (see MXML)
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • Constructor Injection
      • Class MyClass {
      • public function MyClass(dependency:IDependency) {
      • this.dependency = dependency;
      • }
      • public function doSomething():* {
      • var somethingDone:* = dependency.getSomethingDone();
      • return markAsDone(somethingDone);
      • }
      • }
      • var instance:MyClass = new MyClass(new ConcreteDependency());
      • instance.doSomething();
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • Setter Injection
      • Class MyClass {
      • private var dependency:IDependency;
      • public function set dependency(value:IDependency):void {
      • this.dependency = value;
      • }
      • public function doSomething():* {
      • var somethingDone:* = dependency.getSomethingDone();
      • return markAsDone(somethingDone);
      • }
      • }
      • var instance:MyClass = new MyClass();
      • instance.dependency = new ConcreteDependency();
      • instance.doSomething();
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • Inversion of Control?
      • Prefer setter injection
      • Type to interfaces !!!
      • Centralized configuration
      • Maintainability
      • Reusability
      • Testability
      • ...
      • Though counter-intuitive at first !
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
    2. What is an IoC Container ? Creates and assembles components/objects and manages their lifecycle. Spring ActionScript uses an XML dialect to define the “application context” (what objects are available and how they are related) June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
    3. The Application Context // setter injection <objects> <object id=“instance” class=“MyClass”> <property name=“dependency” ref=“dependency”/> </object> <object id=“dependency” class=“ConcreteDependency”/> </objects> June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
    4. The Application Context // constructor injection <objects> <object id=“instance” class=“MyClass”> <constructor-arg ref=“dependency”/> </object> <object id=“dependency” class=“ConcreteDependency”/> </objects> June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
    5. Working with the IoC container <mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; creationComplete=&quot;onCreationComplete()“> ... private function onCreationComplete():void { _applicationContext = new FlexXMLApplicationContext(“application-context.xml”); _applicationContext.addEventListener(Event.COMPLETE, onApplicationContextComplete); _applicationContext.load(); } private function onApplicationContextComplete(event:Event):void { var instance:MyClass = _applicationContext .getObject(“instance”); } ... </mx:Application> June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • Application Contexts
      • XMLApplicationContext
        • AS3 compatible
      • FlexXMLApplicationContext
        • Flex specific: adds support for ArrayCollection, …
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • IoC Container Conclusion
      • Objects defined in external XML file
      • Loaded at runtime
      • Centralized dependency management
      • Managed by container
      • Deploy your application with different configurations without recompiling!
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
      • Resources
      • www.pranaframework.org
      • www.herrodius.com
      • Objects Reference (the IoC container): http://static.springframework.org/spring/docs/2.5.x/reference/beans.html
      • Forum: http://forum.springframework.org/forumdisplay.php?f=60
      • SVN: https://src.springframework.org/svn/se-springactionscript-as
      • FishEye: https://fisheye.springframework.org/browse/se-springactionscript-as
      • Jira: http://jira.springframework.org/browse/SESPRINGACTIONSCRIPTAS
      • WTP: http://download.eclipse.org/webtools/updates/
      June 6, 2009 Spring ActionScript | <flex:camp/> Belgium
    6. Questions?

    + Christophe HerremanChristophe Herreman, 11 months ago

    custom

    4406 views, 3 favs, 5 embeds more stats

    Spring ActionScript presentation files from FlexCam more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 4406
      • 2280 on SlideShare
      • 2126 from embeds
    • Comments 0
    • Favorites 3
    • Downloads 85
    Most viewed embeds
    • 2122 views on http://www.herrodius.com
    • 1 views on http://74.125.93.104
    • 1 views on http://209.85.129.132
    • 1 views on http://74.125.77.132
    • 1 views on http://translate.googleusercontent.com

    more

    All embeds
    • 2122 views on http://www.herrodius.com
    • 1 views on http://74.125.93.104
    • 1 views on http://209.85.129.132
    • 1 views on http://74.125.77.132
    • 1 views on http://translate.googleusercontent.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories