SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Architecting a Shared
    Codebase for Browser
    and Desktop
                                                                           Replace with
                                                                            a graphic
                                                                           White Master
    David Coletta                                                     400px tall & 290px wide
    Sr. Computer Scientist
    Adobe Systems Incorporated




                                                                                                ®




                                                                  1
Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
About me

     Developer and co-founder at Virtual Ubiquity, Inc.


     Career focus on collaboration software


     Background in C++ and web applications


     Started using Flex 2.0 alpha in January 2006


     Joined Adobe in December 2007 via acquisition


     Blog: TheJoyOfFlex.com





                                                                  ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Core message




                                                    Respect the platform.




                                                                            ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Challenges

     User interface design


     Shared code packaging


     Abstracting the AIR APIs


     Implementation issues





                                                                  ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
User interface design




                                 Browser                          AIR
                                                                        ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Demo




                                                                  Demo



                                                                         ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Some UI considerations between browser app and AIR app

     Installation


     Automatic updates


     Menu bars


     Multiple windows


     Transition from browser to AIR app


     Opening hyperlinks


     Remember-me handling


     URL display


     Going to sleep and waking up


     Modal dialogs


     Language preference





                                                                  ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Shared code packaging

     Two models explored:

          Browser SWFs included in AIR file and loaded at runtime
      

          Mostly empty Applications and Modules with code linked from shared SWCs
      



     Browser SWFs included in AIR file was preferable for us

          We were already building separate modules
      

          Looser coupling leads to faster builds
      

          But requires use of Ant or similar tool for both development and production builds
      




                                                                                               ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
SWF loading

    Browser
                                                                                 Organizer.swf   FrameCSS.swf Resources.swf
                                              Loads                      Loads



                     Buzzword.swf                            Frame.swf

                                                                                  Editor.swf     EditorFonts.swf PDFexport.swf



    AIR


                     Buzzword.air




                     Buzzword.swf Frame.swf Organizer.swf Editor.swf EditorFonts.swf PDFexport.swf Resources.swf



                                                                                                                                 ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Project structure




                                                                  Frame.swf, Editor.swf, and
                                                                  Organizer.swf copied here by Ant



                                                                  Buzzword.swf and Frame.swf built
                                                                  here



                                                                    Editor.swf and Organizer.swf built and
                                                                    loaded from here in browser version




                                                                                                             ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Abstracting AIR APIs

     Tempted to write code like:

     if (isAIR) {...} else {...}
     Problems with this approach

          It won’t work in shared code because the shared code doesn’t have access to the AIR APIs
      

          Too easy for developers to forget that it’s shared code
      

     Alternative approach

          For each area of functionality, create an interface with two implementations
      

          Create a broker for accessing interface instances
      

          Put all the AIR implementations in the AIR project
      

          Example: IPersistentSecureToken
      




                                                                                                     ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
PlatformBroker




                                                                     PlatformBroker

                                                        subclasses                subclasses

                                AIRPlatformBroker                                 FlexPlatformBroker




                                                                                                       ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
IPersistentSecureToken




                                                                  IPersistentSecureToken

                                                         implements               implements

                                    BrowserCookie                             EncryptedLocalStorageCookie

                               Uses ExternalInterface to                                   Uses AIR
                               make JavaScript calls that                          EncryptedLocalStore API to
                                save and restore tokens                             save and restore tokens




                                                                                                                ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Singletons

     Very convenient!


     Can lead to problems when in multiple-document application


     Example: frame interface





                                                                  ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Rich-text clipboard support

     Browser implementation

          Flash Player does not provide much clipboard handling support at all
      

          Need to cheat with hidden DIV or IFRAME
      

          Extremely fragile
      

          Limits range of supported browsers
      

     AIR implementation

          Problematic because AIR Clipboard API only provides raw HTML
      

          Need to run HTML through some kind of normalization process
      

          Easiest approach is to run it through an HTMLLoader
      




                                                                                 ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
More implementation issues (if time)

     Relaunching


     Using the AIR update framework


     Loading Flex menus and native menus from a single model


     Internationalization and localization


     Runtime CSS vs. compiled CSS


     Idle tracking





                                                                  ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
Core message




                                                    Respect the platform.




                                                                            ®




Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.

Weitere ähnliche Inhalte

Was ist angesagt?

Extend your CMS Investment to Video Content
Extend your CMS Investment to Video ContentExtend your CMS Investment to Video Content
Extend your CMS Investment to Video ContentBrightcove
 
Adobe gaming flash gamm michael
Adobe gaming flash gamm michaelAdobe gaming flash gamm michael
Adobe gaming flash gamm michaelMichael Chaize
 
Flex 4.5 and mobile development
Flex 4.5 and mobile developmentFlex 4.5 and mobile development
Flex 4.5 and mobile developmentMichael Chaize
 
Develop mobile applications with Flex
Develop mobile applications with FlexDevelop mobile applications with Flex
Develop mobile applications with FlexConFoo
 
Using design pattern for mobile
Using design pattern for mobileUsing design pattern for mobile
Using design pattern for mobileluca mezzalira
 
Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)François Le Droff
 
Progressing beyond the Desktop at Universities with Adobe AIR
Progressing beyond the Desktop at Universities with Adobe AIRProgressing beyond the Desktop at Universities with Adobe AIR
Progressing beyond the Desktop at Universities with Adobe AIRJoseph Labrecque
 
Taking the Application Server to Web Scale with Netflix Open Source Software
Taking the Application Server to Web Scale with Netflix Open Source SoftwareTaking the Application Server to Web Scale with Netflix Open Source Software
Taking the Application Server to Web Scale with Netflix Open Source SoftwareDavid Currie
 
Develop multi-screen applications with Flex
Develop multi-screen applications with Flex Develop multi-screen applications with Flex
Develop multi-screen applications with Flex Codemotion
 
Streaming Video Solutions for Higher Education
Streaming Video Solutions for Higher EducationStreaming Video Solutions for Higher Education
Streaming Video Solutions for Higher EducationJoseph Labrecque
 
Embedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse applicationEmbedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse applicationBoris Bokowski
 
Tom Krcha: Building Games with Adobe Technologies
Tom Krcha: Building Games with Adobe TechnologiesTom Krcha: Building Games with Adobe Technologies
Tom Krcha: Building Games with Adobe TechnologiesDevGAMM Conference
 
Breizh camp adobe flex et les mobiles
Breizh camp   adobe flex et les mobilesBreizh camp   adobe flex et les mobiles
Breizh camp adobe flex et les mobilesMichael Chaize
 
Adobe Gaming Solutions by Tom Krcha
Adobe Gaming Solutions by Tom KrchaAdobe Gaming Solutions by Tom Krcha
Adobe Gaming Solutions by Tom Krchamochimedia
 
p2, modular provisioning for OSGi
p2, modular provisioning for OSGip2, modular provisioning for OSGi
p2, modular provisioning for OSGiPascal Rapicault
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 

Was ist angesagt? (20)

Adobe AIR & Printing
Adobe AIR & PrintingAdobe AIR & Printing
Adobe AIR & Printing
 
Extend your CMS Investment to Video Content
Extend your CMS Investment to Video ContentExtend your CMS Investment to Video Content
Extend your CMS Investment to Video Content
 
Jax 2011 keynote
Jax 2011 keynoteJax 2011 keynote
Jax 2011 keynote
 
Adobe gaming flash gamm michael
Adobe gaming flash gamm michaelAdobe gaming flash gamm michael
Adobe gaming flash gamm michael
 
Flex 4.5 and mobile development
Flex 4.5 and mobile developmentFlex 4.5 and mobile development
Flex 4.5 and mobile development
 
Portlet factory 101
Portlet factory 101Portlet factory 101
Portlet factory 101
 
Develop mobile applications with Flex
Develop mobile applications with FlexDevelop mobile applications with Flex
Develop mobile applications with Flex
 
Using design pattern for mobile
Using design pattern for mobileUsing design pattern for mobile
Using design pattern for mobile
 
Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)Flex Continuous Quality Builds Flex & (Ant || Maven)
Flex Continuous Quality Builds Flex & (Ant || Maven)
 
Progressing beyond the Desktop at Universities with Adobe AIR
Progressing beyond the Desktop at Universities with Adobe AIRProgressing beyond the Desktop at Universities with Adobe AIR
Progressing beyond the Desktop at Universities with Adobe AIR
 
Taking the Application Server to Web Scale with Netflix Open Source Software
Taking the Application Server to Web Scale with Netflix Open Source SoftwareTaking the Application Server to Web Scale with Netflix Open Source Software
Taking the Application Server to Web Scale with Netflix Open Source Software
 
Develop multi-screen applications with Flex
Develop multi-screen applications with Flex Develop multi-screen applications with Flex
Develop multi-screen applications with Flex
 
Streaming Video Solutions for Higher Education
Streaming Video Solutions for Higher EducationStreaming Video Solutions for Higher Education
Streaming Video Solutions for Higher Education
 
Embedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse applicationEmbedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse application
 
Tom Krcha: Building Games with Adobe Technologies
Tom Krcha: Building Games with Adobe TechnologiesTom Krcha: Building Games with Adobe Technologies
Tom Krcha: Building Games with Adobe Technologies
 
Windows Azure Outline
Windows Azure OutlineWindows Azure Outline
Windows Azure Outline
 
Breizh camp adobe flex et les mobiles
Breizh camp   adobe flex et les mobilesBreizh camp   adobe flex et les mobiles
Breizh camp adobe flex et les mobiles
 
Adobe Gaming Solutions by Tom Krcha
Adobe Gaming Solutions by Tom KrchaAdobe Gaming Solutions by Tom Krcha
Adobe Gaming Solutions by Tom Krcha
 
p2, modular provisioning for OSGi
p2, modular provisioning for OSGip2, modular provisioning for OSGi
p2, modular provisioning for OSGi
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 

Andere mochten auch

Creating Custom Spark Components in Flex 4
Creating Custom Spark Components in Flex 4Creating Custom Spark Components in Flex 4
Creating Custom Spark Components in Flex 4Dan Orlando
 
Osvrt Na Adobe Max 2009
Osvrt Na Adobe Max 2009Osvrt Na Adobe Max 2009
Osvrt Na Adobe Max 2009Ivan Ilijasic
 
Adobe Flex Don't Style It, Skin it!
Adobe Flex Don't Style It, Skin it!Adobe Flex Don't Style It, Skin it!
Adobe Flex Don't Style It, Skin it!DevelopmentArc LLC
 
P2P vs Sockets: Communication on the Flash Platform
P2P vs Sockets: Communication on the Flash PlatformP2P vs Sockets: Communication on the Flash Platform
P2P vs Sockets: Communication on the Flash Platformboushley
 
Adobe AIR - Mobile Performance – Tips & Tricks
Adobe AIR - Mobile Performance – Tips & TricksAdobe AIR - Mobile Performance – Tips & Tricks
Adobe AIR - Mobile Performance – Tips & TricksMihai Corlan
 
360|Flex Greenthreading In Flex
360|Flex Greenthreading In Flex360|Flex Greenthreading In Flex
360|Flex Greenthreading In FlexHuyen Tue Dao
 
Brief of mobile service
Brief of mobile serviceBrief of mobile service
Brief of mobile serviceSeungyul Kim
 
3 Keywords For Mobile
3 Keywords For Mobile3 Keywords For Mobile
3 Keywords For MobileSeungyul Kim
 
How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applicationsjeff tapper
 
Understanding the Mobile Ecosystem
Understanding the Mobile EcosystemUnderstanding the Mobile Ecosystem
Understanding the Mobile EcosystemAppia
 

Andere mochten auch (12)

Creating Custom Spark Components in Flex 4
Creating Custom Spark Components in Flex 4Creating Custom Spark Components in Flex 4
Creating Custom Spark Components in Flex 4
 
Osvrt Na Adobe Max 2009
Osvrt Na Adobe Max 2009Osvrt Na Adobe Max 2009
Osvrt Na Adobe Max 2009
 
Adobe Flex Don't Style It, Skin it!
Adobe Flex Don't Style It, Skin it!Adobe Flex Don't Style It, Skin it!
Adobe Flex Don't Style It, Skin it!
 
Migrating fx3tofx4
Migrating fx3tofx4Migrating fx3tofx4
Migrating fx3tofx4
 
P2P vs Sockets: Communication on the Flash Platform
P2P vs Sockets: Communication on the Flash PlatformP2P vs Sockets: Communication on the Flash Platform
P2P vs Sockets: Communication on the Flash Platform
 
Adobe AIR - Mobile Performance – Tips & Tricks
Adobe AIR - Mobile Performance – Tips & TricksAdobe AIR - Mobile Performance – Tips & Tricks
Adobe AIR - Mobile Performance – Tips & Tricks
 
360|Flex Greenthreading In Flex
360|Flex Greenthreading In Flex360|Flex Greenthreading In Flex
360|Flex Greenthreading In Flex
 
Brief of mobile service
Brief of mobile serviceBrief of mobile service
Brief of mobile service
 
3 Keywords For Mobile
3 Keywords For Mobile3 Keywords For Mobile
3 Keywords For Mobile
 
How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applications
 
Understanding the Mobile Ecosystem
Understanding the Mobile EcosystemUnderstanding the Mobile Ecosystem
Understanding the Mobile Ecosystem
 
The Mobile Ecosystem
The Mobile EcosystemThe Mobile Ecosystem
The Mobile Ecosystem
 

Ähnlich wie David Coletta Architecting A Shared Codebase For Browser And Desktop Final

Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4Juan Sanchez
 
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFlex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFrançois Le Droff
 
Xebia adobe flash mobile applications
Xebia adobe flash mobile applicationsXebia adobe flash mobile applications
Xebia adobe flash mobile applicationsMichael Chaize
 
Over the air 2.5 - Adobe AIR for Android
Over the air 2.5 - Adobe AIR for AndroidOver the air 2.5 - Adobe AIR for Android
Over the air 2.5 - Adobe AIR for AndroidMichael Chaize
 
Adobe MAX 2015 - Giving Flash Professional Another Look
Adobe MAX 2015 - Giving Flash Professional Another LookAdobe MAX 2015 - Giving Flash Professional Another Look
Adobe MAX 2015 - Giving Flash Professional Another LookJoseph Labrecque
 
Adobe flash platform java
Adobe flash platform javaAdobe flash platform java
Adobe flash platform javaCh'ti JUG
 
Adobe flash platform java
Adobe flash platform javaAdobe flash platform java
Adobe flash platform javaMichael Chaize
 
Adobe Max 2009 - Learnings
Adobe Max 2009 -  LearningsAdobe Max 2009 -  Learnings
Adobe Max 2009 - Learningsziblu
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsAmazon Web Services
 
We4IT lcty 2013 - infra-man - whats new in ibm domino application development
We4IT lcty 2013 - infra-man - whats new in ibm domino application developmentWe4IT lcty 2013 - infra-man - whats new in ibm domino application development
We4IT lcty 2013 - infra-man - whats new in ibm domino application developmentWe4IT Group
 
Flash Catalyst at Flex Camp Orange County
Flash Catalyst at Flex Camp Orange CountyFlash Catalyst at Flex Camp Orange County
Flash Catalyst at Flex Camp Orange CountyJuan Sanchez
 
Aras PLM's Browser Neutral Client
Aras PLM's Browser Neutral ClientAras PLM's Browser Neutral Client
Aras PLM's Browser Neutral ClientAras
 
Innovation and the Adobe Flash Platform
Innovation and the Adobe Flash PlatformInnovation and the Adobe Flash Platform
Innovation and the Adobe Flash PlatformMichael Chaize
 
Mihai Pricope
Mihai PricopeMihai Pricope
Mihai Pricopeevensys
 

Ähnlich wie David Coletta Architecting A Shared Codebase For Browser And Desktop Final (20)

Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4
 
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog CcFlex For Java Architects Ledroff Breizh Jug V Blog Cc
Flex For Java Architects Ledroff Breizh Jug V Blog Cc
 
Xebia adobe flash mobile applications
Xebia adobe flash mobile applicationsXebia adobe flash mobile applications
Xebia adobe flash mobile applications
 
Hello Gumbo
Hello GumboHello Gumbo
Hello Gumbo
 
Adobe Air
Adobe AirAdobe Air
Adobe Air
 
Over the air 2.5 - Adobe AIR for Android
Over the air 2.5 - Adobe AIR for AndroidOver the air 2.5 - Adobe AIR for Android
Over the air 2.5 - Adobe AIR for Android
 
Adobe Creative Cloud für Teams
Adobe Creative Cloud für TeamsAdobe Creative Cloud für Teams
Adobe Creative Cloud für Teams
 
Cold Fusion Deck
Cold Fusion DeckCold Fusion Deck
Cold Fusion Deck
 
Jax2001 adobe keynote
Jax2001 adobe keynoteJax2001 adobe keynote
Jax2001 adobe keynote
 
Adobe MAX 2015 - Giving Flash Professional Another Look
Adobe MAX 2015 - Giving Flash Professional Another LookAdobe MAX 2015 - Giving Flash Professional Another Look
Adobe MAX 2015 - Giving Flash Professional Another Look
 
Adobe flash platform java
Adobe flash platform javaAdobe flash platform java
Adobe flash platform java
 
Adobe flash platform java
Adobe flash platform javaAdobe flash platform java
Adobe flash platform java
 
Adobe Max 2009 - Learnings
Adobe Max 2009 -  LearningsAdobe Max 2009 -  Learnings
Adobe Max 2009 - Learnings
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
 
We4IT lcty 2013 - infra-man - whats new in ibm domino application development
We4IT lcty 2013 - infra-man - whats new in ibm domino application developmentWe4IT lcty 2013 - infra-man - whats new in ibm domino application development
We4IT lcty 2013 - infra-man - whats new in ibm domino application development
 
Bynet2.3 Adobe Flex builder 4
Bynet2.3 Adobe Flex builder 4Bynet2.3 Adobe Flex builder 4
Bynet2.3 Adobe Flex builder 4
 
Flash Catalyst at Flex Camp Orange County
Flash Catalyst at Flex Camp Orange CountyFlash Catalyst at Flex Camp Orange County
Flash Catalyst at Flex Camp Orange County
 
Aras PLM's Browser Neutral Client
Aras PLM's Browser Neutral ClientAras PLM's Browser Neutral Client
Aras PLM's Browser Neutral Client
 
Innovation and the Adobe Flash Platform
Innovation and the Adobe Flash PlatformInnovation and the Adobe Flash Platform
Innovation and the Adobe Flash Platform
 
Mihai Pricope
Mihai PricopeMihai Pricope
Mihai Pricope
 

David Coletta Architecting A Shared Codebase For Browser And Desktop Final

  • 1. Architecting a Shared Codebase for Browser and Desktop Replace with a graphic White Master David Coletta 400px tall & 290px wide Sr. Computer Scientist Adobe Systems Incorporated ® 1 Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 2. About me Developer and co-founder at Virtual Ubiquity, Inc.  Career focus on collaboration software  Background in C++ and web applications  Started using Flex 2.0 alpha in January 2006  Joined Adobe in December 2007 via acquisition  Blog: TheJoyOfFlex.com  ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 3. Core message Respect the platform. ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 4. Challenges User interface design  Shared code packaging  Abstracting the AIR APIs  Implementation issues  ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 5. User interface design Browser AIR ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 6. Demo Demo ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 7. Some UI considerations between browser app and AIR app Installation  Automatic updates  Menu bars  Multiple windows  Transition from browser to AIR app  Opening hyperlinks  Remember-me handling  URL display  Going to sleep and waking up  Modal dialogs  Language preference  ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 8. Shared code packaging Two models explored:  Browser SWFs included in AIR file and loaded at runtime  Mostly empty Applications and Modules with code linked from shared SWCs  Browser SWFs included in AIR file was preferable for us  We were already building separate modules  Looser coupling leads to faster builds  But requires use of Ant or similar tool for both development and production builds  ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 9. SWF loading Browser Organizer.swf FrameCSS.swf Resources.swf Loads Loads Buzzword.swf Frame.swf Editor.swf EditorFonts.swf PDFexport.swf AIR Buzzword.air Buzzword.swf Frame.swf Organizer.swf Editor.swf EditorFonts.swf PDFexport.swf Resources.swf ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 10. Project structure Frame.swf, Editor.swf, and Organizer.swf copied here by Ant Buzzword.swf and Frame.swf built here Editor.swf and Organizer.swf built and loaded from here in browser version ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 11. Abstracting AIR APIs Tempted to write code like:  if (isAIR) {...} else {...} Problems with this approach  It won’t work in shared code because the shared code doesn’t have access to the AIR APIs  Too easy for developers to forget that it’s shared code  Alternative approach  For each area of functionality, create an interface with two implementations  Create a broker for accessing interface instances  Put all the AIR implementations in the AIR project  Example: IPersistentSecureToken  ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 12. PlatformBroker PlatformBroker subclasses subclasses AIRPlatformBroker FlexPlatformBroker ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 13. IPersistentSecureToken IPersistentSecureToken implements implements BrowserCookie EncryptedLocalStorageCookie Uses ExternalInterface to Uses AIR make JavaScript calls that EncryptedLocalStore API to save and restore tokens save and restore tokens ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 14. Singletons Very convenient!  Can lead to problems when in multiple-document application  Example: frame interface  ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 15. Rich-text clipboard support Browser implementation  Flash Player does not provide much clipboard handling support at all  Need to cheat with hidden DIV or IFRAME  Extremely fragile  Limits range of supported browsers  AIR implementation  Problematic because AIR Clipboard API only provides raw HTML  Need to run HTML through some kind of normalization process  Easiest approach is to run it through an HTMLLoader  ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 16. More implementation issues (if time) Relaunching  Using the AIR update framework  Loading Flex menus and native menus from a single model  Internationalization and localization  Runtime CSS vs. compiled CSS  Idle tracking  ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
  • 17. Core message Respect the platform. ® Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.