Robotlegs on Top of Gaia

Comments

There aren't any comments for this presentation.

Add Comment

Comments have been closed.

Transcript

no image

Slide Text

Slide Notes


Slide 1

no text exists for this slide

no notes exist for this slide

Slide 2


Who
Jesse Warden
Flex & Flash Consultant
Career: Director, Flash, Flex
Education: Art, Self-Taught Coder

no notes exist for this slide

Slide 3


Robotlegs/Gaia
Gaia
Robotlegs
Using Them Together

no notes exist for this slide

Slide 4


Why?
Flash Sites: Scaleable Mess
Flex Sites: Re-invent the wheel

no notes exist for this slide

Slide 5

no text exists for this slide

no notes exist for this slide

Slide 6


Gaia
Framework & Toolset for Building Flash Websites
Inspired by Ruby on Rails

no notes exist for this slide

Slide 7


Gaia Inventor
Steven Sacks
Gaia Inventor
stevensacks.net
Twittah: stevensacks

no notes exist for this slide

Slide 8


Industry Tools
SWFObject
SWFAddress
TweenLite
Thunderbolt

no notes exist for this slide

Slide 9


Example Sites

no notes exist for this slide

Slide 10


Site XML

no notes exist for this slide

Slide 11


Scaffolding

no notes exist for this slide

Slide 12


Gaia’s API
goto();

no notes exist for this slide

Slide 13


Transitions
transitionIn();
transitionOut();
transitioninComplete();
transitionOutComplete();

no notes exist for this slide

Slide 14


Flows

no notes exist for this slide

Slide 15


Depth

no notes exist for this slide

Slide 16


Assets

no notes exist for this slide

Slide 17


Preloading
multiple Files, Byte Accuracy
Override Runtime API
Pre-loaders for Pages
Pre-loaders for Assets

no notes exist for this slide

Slide 18


Other Features
SEO Scaffolding (yes, it works)
DEEPlinking API on top of SWFAddress
Bindings support in Site.xml

no notes exist for this slide

Slide 19


Gaia
Bread and Butter

no notes exist for this slide

Slide 20


Robotlegs
MVCS Framework
ActionScript 3

no notes exist for this slide

Slide 21


Robotlegs
Pure AS3 = Yes
Flex = Yes
AIR = Yes
Flash = Yes (CS4/CS5)

no notes exist for this slide

Slide 22


Robotlegs
Shaun Smith
Robotlegs Inventor
Shaun.boyblack.co.za
Twittah: darscan

no notes exist for this slide

Slide 23


Robotlegs
Comes with a Reference Implementation (MVCS)
Robert Penner’s “Signals”
Elad Elrom’s “Passive View Example”
AsyncCommand

no notes exist for this slide

Slide 24


Dependency INjection
The New “New”
All you need to know: [Inject]
SWiftSuspenders
SmartyPants IoC
GUICE: A Different Java Spring

no notes exist for this slide

Slide 25


Dependency Injection
Solves PureMVC’s Casting Problem
var myView: viewObject as MainView;
var proxy:MyProxy = facade.retreiveProxy(MyProxy.NAME) as MyProxy;
Easier to code to Interfaces

no notes exist for this slide

Slide 26


DI Example
private var proxy:MyProxy;

var proxy:MyProxy = facade.retreiveProxy(MyProxy.NAME) as MyProxy;
trace(proxy.myVO);

---------------------------
[Inject]
public var model:MyModel

trace(model.myVO);

no notes exist for this slide

Slide 27

no text exists for this slide

no notes exist for this slide

Slide 28


Events
Communications Through Events

no notes exist for this slide

Slide 29


Event Gotchas
Tons
Sub-Systems
More Events > More properties

no notes exist for this slide

Slide 30

no text exists for this slide

no notes exist for this slide

Slide 31


View
GUI
Form
Chart
Video Player
List of Images

no notes exist for this slide

Slide 32


Dumb View
Dumb
2 things
Accept Data
Dispatch User Gestures

no notes exist for this slide

Slide 33

no text exists for this slide

no notes exist for this slide

Slide 34


ValueObject
HOld “Value”
2nd Most Valuable Class
Strongly Typed
Can Differ From Server to help GUI

no notes exist for this slide

Slide 35


VO Gotchas
To Build yerself...
...or have a Factory do it
constructor Params foil Serialization
Use Optional Values if you must
It changes, affects Entire App

no notes exist for this slide

Slide 36


Robotlegs
Context
Mediator
Services
Model
Command
Actor (Base Class)

no notes exist for this slide

Slide 37

no text exists for this slide

no notes exist for this slide

Slide 38


Context
Initialize Framework
Event Bus
Multiple Contexts for Modular Development

no notes exist for this slide

Slide 39


Actor
Base Class for Model and Service
Has Context Injected
Base Class to communicate to the Framework

no notes exist for this slide

Slide 40

no text exists for this slide

no notes exist for this slide

Slide 41


Mediator
Mediator Pattern
View Communicate w/ Framework
1 View per Mediator
Keeps Framework out
Not all views need Mediators

no notes exist for this slide

Slide 42

no text exists for this slide

no notes exist for this slide

Slide 43


Service
Retrieve and/or Send Data
Remote and/or Local Services
Parse Data to VO’s
Dispatch Success or Failure
Don’t Listen to Framework Events
Great Unit Test Candidates

no notes exist for this slide

Slide 44


Service Practices
Doesn’t Store Data
Dispatch Event, has Data in It
Extend Actor
Store’s Data
Dispatch Event, NO Data in It
Extend EventDispatcher

no notes exist for this slide

Slide 45


Service Gotcha’s
Foreign Data
FActories:
#1 Source of Bugs
Compiler Doesn’t
Help you
Manual Timeouts
Explode Early

no notes exist for this slide

Slide 46

no text exists for this slide

no notes exist for this slide

Slide 47


Model(s)
Observer Pattern
Stores Global Data
Usually Wraps a VO
Doesn’t Listen for Framework Events
Dispatches Data Changes
Persists
Extends Actor

no notes exist for this slide

Slide 48


Model(s)
Re-Factor to:
Data needs to persist
1> Mediator/Command Use Data

no notes exist for this slide

Slide 49

no text exists for this slide

no notes exist for this slide

Slide 50


Command
Command Pattern
Controller Work
DRY
Re-Factor To
Doesn’t Listen to Framework Events

no notes exist for this slide

Slide 51


Command Example
Login Form
Update Profile
Edit Server Data

no notes exist for this slide

Slide 52


User Gestures
Command’s are Usually User Gestures
Login, Logout, SaveUser
AddTag
Save

no notes exist for this slide

Slide 53


Command Pro’s
DRY
Centralized Logic
Data Problem = 2 places to look
Service
Command
Not Hunting Through Mediators
RAD (Rapid Application Development)

no notes exist for this slide

Slide 54


COmmand Con’s
Code Bloat Early in Project
Handling Context Sensitive Data?
...2 Commands
20 User Gestures = 40 Commands
Commands for Everything

no notes exist for this slide

Slide 55

no text exists for this slide

no notes exist for this slide

Slide 56


AsyncCommand
Asynchronous Command
Why?
Java/C/C++ Devs Invented Command Pattern
Blocking Language
Executes Server Request and Code
pauses

no notes exist for this slide

Slide 57


AsyncCommand
ActionScript is not Blocking
It is Asynchronous
Sometimes things need to wait
To wait, they need context
To have context, they need to exist
Commands die immediately

no notes exist for this slide

Slide 58


AsyncCommand
AsyncCommand’s do not Block
You Control when they die
You can handle Server responses
with Context
React & Respond w/ Less code
fork to call other Commands

no notes exist for this slide

Slide 59


Gaia + Robotlegs
Gaia builds yer Site
Robotlegs Handles:
Business Logic
Application Logic

no notes exist for this slide

Slide 60


Why?
Agency
Shields from Ever Changing client Visuals
View Changes, App/Biz Logic Doesn’t
Dev
Don’t Break Gaia’s modules
RAD & Scaleable

no notes exist for this slide

Slide 61


How?
Export SWC “Magic Checkbox”

no notes exist for this slide

Slide 62


Step by Step
Setup Gaia Project
Register Context in Main.as
Page or child View implement Interface
Register Interface for Mediator

no notes exist for this slide

Slide 63


Rules n’ Gotchas
Interface for Bridge Pattern
Gaia Pages use Bridge Pattern
Not all Gaia Pages need a Mediator

no notes exist for this slide

Slide 64


Conclusions
Gaia is the Foundation for Site
Robotlegs Handles Biz & App Logic
Together, they Build a Scaleable & Flexible Site

no notes exist for this slide

Slide 65


Questions?
Jesse Warden
Twittah: jesterxl
jessewarden.com

no notes exist for this slide