Tyler Wright - Undo History with Flight

  • 539 views
Uploaded on

Undo & redo is a core feature to many applications, yet it's missing from your Flash and Flex projects. Learn how to easily add history to your applications with little effort. This session covers the …

Undo & redo is a core feature to many applications, yet it's missing from your Flash and Flex projects. Learn how to easily add history to your applications with little effort. This session covers the concepts, benefits and the techniques of history management. It breaks down the complexity of undo & redo implementation into simple code, illustrating the use of the Command Pattern and providing the tools necessary to get up and running within minutes. This session is targeted toward intermediate developers, but will be a great overview of application history for beginners and non-programmers.

More in: Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
539
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
10
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Undo History with Flight Change the Past.
  • 2. Intoduction Tyler Wright – www.xtyler.com Flight Framework – www.flightxd.com Robert Taylor – www.roboncode.com Jacob Wright – jacwright.com Resources: www.xtyler.com/history
  • 3. Ctrl+Z Desktop Applications Browser TextFields What about Rich Internet Applications? Users can enjoy making mistakes
  • 4. Flight Framework an application framework an undo framework a command factory a data binding fiend a way to get dates
  • 5. Anatomy of Undo Undoable Action means of reverting that action recover from a single mistake Memory of actions queue of undoable actions recover from a history of mistakes Change the past.
  • 6. Anatomy of Undo • Undoable Action • Action Memory
  • 7. Generic vs. Specific One-size fits all Everyone is special “automatic” custom centralized logic handles separate logic for undo on undo on all actions each action actions must fit the mold every action unique
  • 8. Command your Actions Methods define our system’s actions State is represented by local data – goes away Command: an objectified method, storing local data Portable – pass around the system as an object
  • 9. Implement to an Interface Interfaces: create types by contract ICommand execute():void IUndoableCommand undo():void redo():void
  • 10. CommandHistory Undo & Redo “right out of the box” ICommandInvoker executeCommand(command:ICommand):void ICommandHistory canUndo():Boolean, canRedo():Boolean undo():Boolean, redo():Boolean undoLimit:int, etc…
  • 11. Action Memory Realized Commands become our undoable actions CommandHistory becomes our memory of actions
  • 12. Generic heart Specific One-size fits all Everyone is speaical “automatic” custom single command to a separate Command for represent all actions each action Marriage by Command Consolidates these approaches. Provides a single interface to undo and redo. Mix approaches or migrate from one to another without changing API.
  • 13. Your First History Lesson The History Panel Photoshop Flash The Project (break to code right here) On Into the Details
  • 14. Short-term Memory Undo limits Considering stored data types Clearing memory – release event listeners and bindings Weak-referenced event listeners and binding Saving history to disk
  • 15. Merging Actions repeated IMergingCommand merge (source:Object):Boolean Originating Command inspects fellows before discarding them – self reflection leads to a greater self Compared to MacroCommands
  • 16. Flight Framework Reloaded Offers the HistoryController as an extension of application- level Controllers Command Factory addCommand(type:String, commandClass:Class):void createCommand(type:String):ICommand Enables direct upgrade from a common application to one with undo and redo, minimal changes Much more…
  • 17. Change the Past. Tyler Wright – www.xtyler.com Flight Framework – www.flightxd.com Robert Taylor – www.roboncode.com Jacob Wright – jacwright.com Resources: www.xtyler.com/history