Upload
joel-hooks
View
20.393
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Slides from presentation on the Robotlegs AS3 Micro-Architecture at Flash and the City 2010 in New York
Citation preview
[robotlegs]
for Actionscript 3
Me
Joel HooksRobotlegs Enthusiast
on the webwww.joelhooks.com
Who Started Robotlegs?
Shaun SmithRobotlegs Inventor
find himshaun.boyblack.co.za
@darscan
Not to mention...
Till SchneidereitSwiftSuspenders Maestro
find himhttp://www.tillschneidereit.de/
@tschneidereit
Contributors
Robert Penner @robPenner
Sean Hess @seanhess
Jonnie Hallman @DestroyToday
Craig Wickesser @codecraig
and so many others have contributed to the communitythrough support, ideas, and examples...
What’s in it for me?
the pitch
What’s in it for me?
a pure Actionscript 3 micro-architecturefor flash, flex and air?
do you need a
What’s in it for me?
are you using a framework but feel sad about...
What’s in it for me?
castingare you using a framework but feel sad about...
What’s in it for me?
castingare you using a framework but feel sad about...
Singletons
What’s in it for me?
castingare you using a framework but feel sad about...
Singletonsservice locators
What’s in it for me?
castingare you using a framework but feel sad about...
Singletonsservice locators
display list event bus
What’s in it for me?
do you want a better mechanism for...
What’s in it for me?
wiring your objects togetherdo you want a better mechanism for...
What’s in it for me?
wiring your objects togetherdo you want a better mechanism for...
managing dependencies
What’s in it for me?
wiring your objects togetherdo you want a better mechanism for...
managing dependenciesmanaging events
What’s in it for me?
wiring your objects togetherdo you want a better mechanism for...
managing dependenciesmanaging eventsstructured MVC
Robotlegs is...
a pure Actionscript 3 micro-architecture
Robotlegs is...
a pure Actionscript 3 micro-architecturerobotlegs has no Flex framework dependencies.
Robotlegs is...
flash, flex, and air
Robotlegs is...
a mechanism for wiring objects together
Robotlegs is...
a mechanism for wiring objects togetherfocused solely on this limited scope
Robotlegs is...
a mechanism for wiring objects togetherfocused solely on this limited scope
by providing kickass tools to get your job done
Why Robotlegs?
lightweight~1100 lines of code...
Why Robotlegs?
automated dependency injection
Why Robotlegs?
automated dependency injection[Inject]
Why Robotlegs?
fight carpel tunnel
:ʼ(
Why Robotlegs?
remove framework pain
Why Robotlegs?
MVC+S reference implementation
Why Robotlegs?
MVC+S reference implementationa little prescription goes a long way...
Why Robotlegs?
MVC+S reference implementationa little prescription goes a long way...
but...
Why Robotlegs?
whatever you need it to be
Why Robotlegs?
whatever you need it to behighly extensible to support YOUR workflow and style
Why Robotlegs?
whatever you need it to behighly extensible to support YOUR workflow and style
MVCS provides documentation and common ground for teams...
Why Robotlegs?
modular support
Why Robotlegs?
peer reviewed
Why Robotlegs?
objects communicate via native events
Why Robotlegs?
objects communicate via native eventscustom events with strongly typed properties
Why Robotlegs?
objects communicate via native eventscustom events with strongly typed properties
or maybe you prefer AS3-Signals?
Why Robotlegs?
well documented
Why Robotlegs?
fully unit testedbecause your project is important.
Why Robotlegs?
stablestrict semantic versioning
http://semver.org/
Why Robotlegs?
welcoming communityhi!
Why Robotlegs?
knowledge.robotlegs.org
Community supported through Tender
What Robotlegs isn’t...
What Robotlegs isn’t...
Where to Start?
MVC+S reference implementation
Robotlegs MVCS Implementation
Robotlegs in Action
Flickr Image Gallery Demo**part of the Robotlegs Demo Bundle available here: http://github.com/robotlegs/robotlegs-demos-Bundle
Robotlegs in Action
GalleryView Component
Robotlegs in Action
GallerySearch Component
Robotlegs in Action
GalleryLabel Component
Context
Context initializes the framework
Context
Context
Context provides an event bus
Context Event Dispatcher Routes Events
Context
not limited to a single Context
Context
not limited to a single Contextmultiple Contexts for modular development
Context
not limited to a single Contextmultiple Contexts for modular development
thereʼs a utility for that...
Actor
Actor is the base class for Model and Service classes
Models and Services Extend Actor
Actor
eventDispatcher is injectedinto Actor
Actor
Actor provides a dispatch(event) method
Actor
Actor is for your convenience
Model
Models extend Actor
Model
Models provide an API for data
Model
Model
Models sit between application data and other actors
Model
Models should not listen for framework events
Model
Models dispatch framework events
Models Dispatch Events
Service
Services extend Actor
Service
Services communicate with the outside worldand provides an API to external services
Service
Service
Services can parse results from external services
Service
Services can parse results from external services
foreign data should be converted at the first opportunity
Service
Service
Services do not store data
Service
Services do not store datadata is stored on a Model
Service
Services do not receive framework events
Service
Services dispatch framework events
Services Dispatch Events
View
the View is represented by your view components and their Mediators
View
Mediators provide API for view components
View
Mediators provide API for view componentsto keep the framework out
Mediators Access View Component APIs
View
View
Mediators listen for view component events
Mediators Listen to View Components
View
Mediators listen for framework events
Mediators Listen for Events
View
Mediators dispatch framework events
Mediators Dispatch Events
View
view components are not coupled to their Mediators
View
view components are not coupled to their Mediators
or any other framework class
View
view components are not coupled to their Mediators
or any other framework classperiod.
View
Mediators are coupled to their view components
View
Mediators can access Service and Model classes directly
View
Mediators can access Service and Model classes directly
but this will couple the Mediator to the Actor
Accessing Models and Services from Mediators
(tread carefully)
Controller
represented by the Command class
Controller
Commands are executed in response to framework events
Controllers Executed by Events
Controller
Commands are stateless
Controller
Commands are statelessthey execute and die
Controller
Commands are statelessthey execute and die
performing a single unit of work
Controller
Controller
Commands perform work on Service and Model classes
Controller
Commands perform work on Service and Model classes
and occasionally Mediators
Controller Performs Work
Controller
Controller
Commands receive data from the events that trigger them
Controller
Controller
Commands dispatch framework events
Controller Dispatches Events
Controller
Commands do not receive framework events
Controller
Commands do not receive framework eventsoutside of the event that triggers them
Controller
Commands do not receive framework eventsoutside of the event that triggers them
which is available for injection
Typical Flow of Events in Robotlegs
User Performs an Action (button click)
View Component Dispatches Event to Mediator
Mediator Dispatches Event that Triggers
Command calls a Method on a Service
Service Makes External call and Parses Data
Service Updates the Model (directly or via
Model Dispatches Event that Mediator Responds
Mediator Updates View with Current Data
Robotlegs MVCS
Collaborative Development
github.com/robotlegs
github makes it easy!
Collaborative Development
comments, criticism, and ideas welcome
Collaborative Development
fork the framework
Collaborative Development
create examples and utilities
Collaborative Development
create an alternative implementation
www.robotlegs.orgdownload the framework
best practices documentationproject on github
FAQ and Knowledge Baselive examples
Questions?