& PureMVC sample project: http://code.google.com/p/as3frameworkspuremvc/source/checkout https://as3frameworkspuremvc.googlecode.com/svn/trunk/  (svn) Robotlegs sample project: https://github.com/bardic/Robotlegs-Example- (SVN is lame. Here it is on github)
Uncle Ben Parker of  Spider-Man  fame once said,  "With great power comes great responsibility." We all want great power when developing software, but the question is:  Can we accept the responsibility?
Or more specifically... Should we use a  framework  for our Flash, Flex & AIR projects?
Outline...      1. Presentation Goals      2. Framework - Why and when?      3. Design Patterns rolled into Frameworks      4. Frameworks out there      5. PureMVC intro      6. Robotlegs intro
1.) Presentation Goals Skimming the surface...      1. Introduction to two of the hottest AS3 frameworks      2. A primer for getting started      3. Pizza...hell yeah!
2.) Framework - Why? Simplified code (simple code is reliable code) Reduce confusion over class roles and responsibilities - separation of concerns (discrete layers) Promote scalability Promotes re-usability (loosely coupled) Speed up development process Built on proven design patterns (OOP, Gang of Four[GoF])
...Framework - When? Collaborative / team development...personally I'd say if there's more than two developers on a team. Project size and/or complexity...if your project is gonna get big and complex - lots of classes with lots of roles. Uncertain scope...you need the flexibility to so that  IF  your project grows, your codebase can accommodate. You simply want to create a clean and well structured codebase.
3.) Design Patterns rolled into Frameworks Design Patterns  are general reusable solution to a commonly occurring problem in software design. Object-oriented design patterns typically show relationships and interactions between classes or objects. Behavioral Patterns: Command Pattern Observer Pattern Template Method Pattern State Pattern Strategy Pattern Multiple Patterns: Model-View-Controller Symmetric Proxy Pattern Creational Patterns: Factory Method Pattern Singleton Pattern Structural Patterns: Decorator Pattern Adapter Pattern Composite Pattern
...continued Today  we'll inadvertently be looking at design patterns that address concerns related to high-level structures of applications being developed; Behavioral Design Patters rolled into a  Framework = a collaborating set of design patterns. Frameworks (a.k.a. micro-architectures)  are a special case of software libraries in that they are reusable abstractions of code wrapped in a well-defined Application programming interface (API).
4.) Frameworks out there PureMVC Robotlegs Mate (the drink, not your friend) Swiz Parsley Cairngorm FlexMVCS / MVCS Spring Actionscript ...
4.) Meet the mothership...a.k.a.  PureMVC
...PureMVC strengths Well established Large and active community Very very very well structured Thus...Extremely well suited for team development Once you know it...coding is super-fast Small footprint Support for multicore (multiple application cores)* Language agnostic- Ports for: AS3 AS2 ColdFusion C# Objective C Ruby PHP Python Haxe Java Javascript
*...mulitcore (Pipe, TeeSlipt, TeeMerge)
...PureMVC weaknesses - none
...PureMVC weaknesses (for real) Not a Flex specific framework does not take advantage of MXML features. (e.g. binding, metadata) Has own event model integrating with Flex Event Model takes time, patience & practice. Complex~ish learning curve lame excuse cuz the benefits outweigh Boilerplate code requires the creation of many classes (hint: use a reproducible skeleton structure on templates)
PureMVC 'Event Flow'
On to Robotlegs...why? Because "We view things not only from different sides, but with different eyes;  we have no wish to find them alike."  - Blaise Pascal
4.) Meet Robotlegs video
Robotlegs Class Diagram  
Strengths Very simple Active community Focuses on code, not structure MVC is simply a suggestion Very easy to unit test (but who tests, really?) Designed for Flash/Flex/AIR Awesome name and logo  Uses Automated Dependency Injection  No Boilerplate
Weaknesses No multicore  Young Small-ish comminuty (but very very active) Can be difficult to find documentation/example of more advanced features Metadata is scary at first Injection errors don't throw compiler errors
Automated Dependency Injection (DI) Robotlegs leverages SwiftSuspenders for it's DI which is based on metadata e.g. [Inject] public var foo:Bar;   The benefit of DI is that it takes the responsibility from the classes of creating new objects. (Inverse of control)   This in turn return makes your classes much cleaner to read and increase writing speed.
It's all about community... Robotlegs has a very active community on twitter (#robotlegs) and on github where all of the source for the main framework can be found.  https://github.com/search?type=Repositories&language=&q=robotlegs&repo=&langOverride=&x=15&y=22&start_value=1   They also have a community driven  support site :  http://knowledge.robotlegs.org/
x.) Resources & References Software framework http://en.wikipedia.org/wiki/Software_framework) Design Patterns: http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 http://sourcemaking.com/design_patterns GoF http://en.wikipedia.org/wiki/Design_Patterns_%28book%29 http://www.amazon.ca/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612 PureMVC: http://www.adobe.com/newsletters/edge/december2008/articles/article6/index.html http://en.wikipedia.org/wiki/PureMVC http://www.puremvc.org Choosing a framework: http://www.adobe.com/devnet/flex/articles/flex_framework.html Actionscript 3.0 Design Patterns (O'REILLY, ISBN-10: 0-596-52846-9): http://www.amazon.ca/ActionScript-3-0-Design-Patterns-Programming/dp/0596528469
Parting thought In the words of marketing guru  John Colanzi , "Sometimes you have to take a step back before you can move forward." As developers mature and their skills increase on the long road to mastery, there are few opportunities to truly leap forward. These special moments are the result of taking calculated risks to step up their game. While using this framework admittedly has a learning curve, can initially increase development time, and requires discipline, you may find it well worth the effort. Evolving from creating custom, per-project frameworks to using a consistent, framework is one such opportunity to leap forward.

Lunch and learn as3_frameworks

  • 1.
    & PureMVC sampleproject: http://code.google.com/p/as3frameworkspuremvc/source/checkout https://as3frameworkspuremvc.googlecode.com/svn/trunk/  (svn) Robotlegs sample project: https://github.com/bardic/Robotlegs-Example- (SVN is lame. Here it is on github)
  • 2.
    Uncle Ben Parkerof Spider-Man fame once said,  "With great power comes great responsibility." We all want great power when developing software, but the question is: Can we accept the responsibility?
  • 3.
    Or more specifically...Should we use a framework for our Flash, Flex & AIR projects?
  • 4.
    Outline...     1. Presentation Goals      2. Framework - Why and when?      3. Design Patterns rolled into Frameworks      4. Frameworks out there      5. PureMVC intro      6. Robotlegs intro
  • 5.
    1.) Presentation GoalsSkimming the surface...      1. Introduction to two of the hottest AS3 frameworks      2. A primer for getting started      3. Pizza...hell yeah!
  • 6.
    2.) Framework -Why? Simplified code (simple code is reliable code) Reduce confusion over class roles and responsibilities - separation of concerns (discrete layers) Promote scalability Promotes re-usability (loosely coupled) Speed up development process Built on proven design patterns (OOP, Gang of Four[GoF])
  • 7.
    ...Framework - When?Collaborative / team development...personally I'd say if there's more than two developers on a team. Project size and/or complexity...if your project is gonna get big and complex - lots of classes with lots of roles. Uncertain scope...you need the flexibility to so that IF  your project grows, your codebase can accommodate. You simply want to create a clean and well structured codebase.
  • 8.
    3.) Design Patternsrolled into Frameworks Design Patterns are general reusable solution to a commonly occurring problem in software design. Object-oriented design patterns typically show relationships and interactions between classes or objects. Behavioral Patterns: Command Pattern Observer Pattern Template Method Pattern State Pattern Strategy Pattern Multiple Patterns: Model-View-Controller Symmetric Proxy Pattern Creational Patterns: Factory Method Pattern Singleton Pattern Structural Patterns: Decorator Pattern Adapter Pattern Composite Pattern
  • 9.
    ...continued Today we'll inadvertently be looking at design patterns that address concerns related to high-level structures of applications being developed; Behavioral Design Patters rolled into a Framework = a collaborating set of design patterns. Frameworks (a.k.a. micro-architectures)  are a special case of software libraries in that they are reusable abstractions of code wrapped in a well-defined Application programming interface (API).
  • 10.
    4.) Frameworks outthere PureMVC Robotlegs Mate (the drink, not your friend) Swiz Parsley Cairngorm FlexMVCS / MVCS Spring Actionscript ...
  • 11.
    4.) Meet themothership...a.k.a. PureMVC
  • 12.
    ...PureMVC strengths Wellestablished Large and active community Very very very well structured Thus...Extremely well suited for team development Once you know it...coding is super-fast Small footprint Support for multicore (multiple application cores)* Language agnostic- Ports for: AS3 AS2 ColdFusion C# Objective C Ruby PHP Python Haxe Java Javascript
  • 13.
  • 14.
  • 15.
    ...PureMVC weaknesses (forreal) Not a Flex specific framework does not take advantage of MXML features. (e.g. binding, metadata) Has own event model integrating with Flex Event Model takes time, patience & practice. Complex~ish learning curve lame excuse cuz the benefits outweigh Boilerplate code requires the creation of many classes (hint: use a reproducible skeleton structure on templates)
  • 16.
  • 17.
    On to Robotlegs...why?Because "We view things not only from different sides, but with different eyes; we have no wish to find them alike."  - Blaise Pascal
  • 18.
  • 19.
  • 20.
    Strengths Very simpleActive community Focuses on code, not structure MVC is simply a suggestion Very easy to unit test (but who tests, really?) Designed for Flash/Flex/AIR Awesome name and logo  Uses Automated Dependency Injection  No Boilerplate
  • 21.
    Weaknesses No multicore Young Small-ish comminuty (but very very active) Can be difficult to find documentation/example of more advanced features Metadata is scary at first Injection errors don't throw compiler errors
  • 22.
    Automated Dependency Injection(DI) Robotlegs leverages SwiftSuspenders for it's DI which is based on metadata e.g. [Inject] public var foo:Bar;   The benefit of DI is that it takes the responsibility from the classes of creating new objects. (Inverse of control)   This in turn return makes your classes much cleaner to read and increase writing speed.
  • 23.
    It's all aboutcommunity... Robotlegs has a very active community on twitter (#robotlegs) and on github where all of the source for the main framework can be found.  https://github.com/search?type=Repositories&language=&q=robotlegs&repo=&langOverride=&x=15&y=22&start_value=1   They also have a community driven  support site : http://knowledge.robotlegs.org/
  • 24.
    x.) Resources &References Software framework http://en.wikipedia.org/wiki/Software_framework) Design Patterns: http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 http://sourcemaking.com/design_patterns GoF http://en.wikipedia.org/wiki/Design_Patterns_%28book%29 http://www.amazon.ca/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612 PureMVC: http://www.adobe.com/newsletters/edge/december2008/articles/article6/index.html http://en.wikipedia.org/wiki/PureMVC http://www.puremvc.org Choosing a framework: http://www.adobe.com/devnet/flex/articles/flex_framework.html Actionscript 3.0 Design Patterns (O'REILLY, ISBN-10: 0-596-52846-9): http://www.amazon.ca/ActionScript-3-0-Design-Patterns-Programming/dp/0596528469
  • 25.
    Parting thought Inthe words of marketing guru John Colanzi , "Sometimes you have to take a step back before you can move forward." As developers mature and their skills increase on the long road to mastery, there are few opportunities to truly leap forward. These special moments are the result of taking calculated risks to step up their game. While using this framework admittedly has a learning curve, can initially increase development time, and requires discipline, you may find it well worth the effort. Evolving from creating custom, per-project frameworks to using a consistent, framework is one such opportunity to leap forward.