Book description
Robotlegs is a standout among the ActionScript 3 development frameworks available today. With it, Flash, Flex, and AIR developers can create well-architected, testable, and flexible Rich Internet Applications—fast. This concise guide shows you how the light footprint and focused scope of this open source framework not only solves your immediate coding problems, it helps you gain insight into AS3 architecture on a much deeper level.
The authors provide a walkthrough of specific features in two applications they've written in Robotlegs, complete with code for each application as a whole. You'll learn how to achieve a balance of flexibility and consistency in your own projects.
- Solve 80% of your coding problems with 20% of the API
- Gain code-base flexibility with automated Dependency Injection
- Learn the anatomy of a Robotlegs application
- Understand the relationships between models, services, control code, and views in the framework's MVCS architecture
- See how the Robotlegs’ approach facilitates Test Driven Development (TDD)
- Pick up practical methods for architecting Robotlegs solutions
- Get expert insights to power-up your existing Robotlegs code
Publisher resources
Table of contents
- A Note Regarding Supplemental Files
- Preface
- 1. Robotlegs is a lightweight framework for ActionScript 3
-
2. The Robotlegs dream...
- 80% of the problems can be solved with 20% of the API
- Coding for Robotlegs shouldn’t tie you to the framework
- Robotlegs aims to enable and not dictate
- Most AS3 applications benefit from the MVCS approach
- Testing, testing! (We test, and we make it easy for you to test)
- Some final things every Robotlegs cadet should know
-
3. Anatomy of a Robotlegs application
- Joel’s Personal Kanban
- Lindz’s Mosaic Design Tool
- How a Robotlegs application gets things done
-
Getting to grips with Robotlegs architecture
- The ‘context’ is the heart of your Robotlegs application
- Your models and services are ‘Actors’ in your app
- The MediatorMap provides a way to join your views to your app layer
- Robotlegs mediators are bridges, not view controllers
- The CommandMap makes things happen
- The shared event dispatcher joins everything together
- User stories as implemented in Robotlegs
- All of this is possible because of the Robotlegs Injector
-
4. Automated Dependency Injection
- So, what exactly is Automated Dependency Injection?
- You already use Dependency Injection
- There are different ways to inject dependencies
- Automated DI gets around the need to ‘pass the parcel’, but keeps code flexible
-
How does Robotlegs Injection work?
- Automated DI is a handshake
- Robotlegs has different types of injection
- You need to tell the compiler to include the injection metadata
-
Automated Injection ‘Gotchas’
- If an object has an [Inject]ed dependency you have to create it using the Injector.
- You can map injection rules at runtime, but beware of race conditions.
- The injection point and rule have to be of exactly the same type
- If you override a method that has an [Inject] tag, you need to add it in the subclass
- 5. The Robotlegs context in action
-
6. The CommandMap in action
- A Command is a concise single-purpose controller object
- Commands are triggered by events
- Commands can be any class with an ‘execute’ method
- Commands should do their thing and then die
- Commands rely on their injections to be useful
- Commands know about the injector, command map, mediator map and context view
- Commands can also dispatch events
- Great command names pay dividends
- Use helper classes for shared logic
- Detain and release when you need your command to hang around
-
7. Models and services: How are they different?
- Models and Services usually extend Actor
- They don’t listen, they only talk
- Use your API through a Command
- Distinguishing Models from Services
- Classes that don’t dispatch events to the shared event dispatcher don’t need to extend Actor
- Configuring services
- Working with non-Actor models and services (including third party code)
- Model design tips for Robotlegs
- Managing the relationships between models and services
- 8. Connecting views with Mediators
- 9. Working with Robotlegs: Rich Examples
- 10. Testing your Robotlegs application
-
11. Power-ups
- Bootstraps can break up fat contexts
- The ContextEvents help keep control
- Tag methods with [PostConstruct] to run them after injection is complete
- Use Signals between complex views and their mediators
- Modular and multiple-context Robotlegs
- Extend Robotlegs with utilities and add-ons
- ViewMap—injection for your views
- Mediator map performance
-
A. Troubleshooting tips
- Problem: Injection doesn’t occur
- Problem: Things work for a while and then mysteriously stop
- Problem: Event dispatch does not work as expected
- Problem: Mediator isn’t running onRegister
- Problem: Handlers in the mediator are running repeatedly
- Error: Injector missing rule for X
- Warning: Duplicate mapping in the injector
- Error: Call to a possibly undefined method X
- Where to get more help
- B. Swiftsuspenders: The power behind the Robotlegs Injector
- About the Authors
- Colophon
- Copyright
Product information
- Title: ActionScript Developer's Guide to Robotlegs
- Author(s):
- Release date: August 2011
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449308902
You might also like
book
ActionScript Developer's Guide to PureMVC
Gain hands-on experience with PureMVC, the popular open source framework for developing maintainable applications with a …
book
ActionScript 3.0 Design Patterns
Now that ActionScript is reengineered from top to bottom as a true object-oriented programming (OOP) language, …
book
ActionScript 3.0 Bible
The updated edition on all the latest features and capabilities of ActionScript 3.0 and Flash Player …
book
AdvancED ActionScript 3.0: Design Patterns
AdvancED ActionScript 3.0 is a fresh look and new approach to utilizing valuable, structural techniques and …