SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
Best Practices in Widget Development
Examples and Counterexamples


Daniel Dahrendorf (IMC)

ROLE Developer Camp,
Lausanne, Switzerland
August 23, 2010



                               © www.role-project.eu
Dr Stephen Dann from flickr.com   jbvkoos from flickr.com




23.08.2010                                       © www.role-project.eu
DESIGN AND USABILITY



23.08.2010                   © www.role-project.eu
In General

• Focus on a single task
     – Give your end user a single functionality
• Own added Value
     – Do not create a Widget which requires a second widget
• Self explanatory interface
     – There should be no need for help text or support




23.08.2010                                                     © www.role-project.eu
Size of Widgets

• Use a standard height
• The widget should scale between 250px and 500px
     – Use a width of 100% for the main elements of the widget
     – Center elements
• Use views
     – Canvas, home and profile views




23.08.2010                                                   © www.role-project.eu
Customization

• Let the user customize the widget
     – Color
     – Background
     – Content
• Provide always default or sample values
  and include a “welcome mode”
• Use the user preferences feature
  of Google Gadgets




23.08.2010                                  © www.role-project.eu
Use Space effectively

• Avoid scrollbars
• Use tabs
• Use paging




23.08.2010              © www.role-project.eu
User Account

• Content should be interesting even the user is not logged in
• State the benefits of creating an account
• Use OAuth if possible




23.08.2010                                          © www.role-project.eu
DEVELOPMENT



23.08.2010          © www.role-project.eu
Development Environment

• Own Apache Shindig Server
     – A web application which can be run e.g.
       in a Apache Tomcat


• OSDE
     – Eclipse plugin with built in Apache
       Shindig server


• Google Gadget Editor
     – A Google gadget which provides an editor
       and the possibility to save the widgets at
       iGoogle




23.08.2010                                          © www.role-project.eu
Development Environment

• Own Apache Shindig Server
     – A web application which can be run e.g.
       in a Apache Tomcat


     – Comfortable way to create complex
       interacting widgets




23.08.2010                                       © www.role-project.eu
Using the features provided by the gadget API

• The Gadget and OpenSocial API provides a lot of useful
  features:
     – fetch social data
     – provide UI element
     – Get data from external sources




• Only available for type=“html’’ widgets


23.08.2010                                       © www.role-project.eu
Selected Features:

• Tabs
     – Creates customizable tabs


• Setprefs
     – Allows setting of user preferences


• Pubsub (OpenSocial 0.8 only)
     – Inter-widget-communication
     – Use OpenApp instead
       (http://code.google.com/p/open-app/)


• Internationalization
     – Provides a mechanism to
       translate widgets



23.08.2010                                    © www.role-project.eu
makeRequest and the Same Origin Policy

• The gadget API provides a function to fetch
  HTML/XML/JSON content (OpenSocial 0.8):

    gadgets.io.makeRequest(url, callback, opt_params)




• As widgets run in iFrames this proxy approach allows to
  fetch data from other domains (same origin policy)
• Other approaches to solve cross domain problems are:
     – JSONP (retrieving JSON via Script Tags)
     – PMRPC (http://code.google.com/p/pmrpc/)


23.08.2010                                              © www.role-project.eu
Caching Problems




• If you are using makeRequest() to fetch content that is
  updated more than once an hour, such as feed data, you
  might not get the latest updates




23.08.2010                                       © www.role-project.eu
Refreshing the Content Cache

• Solution: create a wrapper with a refresh interval

 function makeCachedRequest(url, callback, params,
    refreshInterval) {

      var timestamp = new Date().getTime();
      var sep = "?";
      if (refreshInterval && refreshInterval > 0) {
         timestamp =
            Math.floor(timestamp / (refreshInterval * 1000));
      }
      if (url.indexOf("?") > -1) {
         sep = "&";
      }
      url = [ url, sep, "nocache=", timestamp ].join("");
      gadgets.io.makeRequest(url, callback, params);
 }


23.08.2010                                             © www.role-project.eu
Caching of external files

• Container caches:
     – JavaScript added with <script>
     – CSS added with <link>
     – Content got using the gadget API
• Further because of the widget infrastructure only absolute
  links are allowed




• External files are needed if the widget becomes more
  complex

23.08.2010                                          © www.role-project.eu
Loading JavaScript / CSS dynamically
                                                         http://www.bitsbythepound.com/include-
1. Determine the location of the xml                     external-javascript-and-css-files-with-a-
                                                         google-wave-gadget-249.html
function getModuleBase() {
    if (window.__moduleBase)
        return window.__moduleBase;
    if (_args){
        var moduleBase = _args()['url'];
        moduleBase = moduleBase.substring(0, moduleBase.lastIndexOf('/') + 1);
        window.__moduleBase = moduleBase;
        return window.__moduleBase;
    }
    alert('Can not find module base. Gadget may not work properly.');
    return '';
};

2. Create mechanism for loading JS and CSS
      jQuery provides a cross-browser require script plugin (requireScript)
3. Load the js/css in gadget init
function init() {
   var useCaching = false;
   addScript("js/default.js",useCaching);
   addStylesheet("css/style.css",useCaching);
};
gadgets.util.registerOnLoadHandler(init);

23.08.2010                                                            © www.role-project.eu
Performance

• Goal: Reduce size of the files and number of HTTP requests

• Minify JavaScript code
     – E.g. http://www.crockford.com/javascript/jsmin.html
• Pack all stuff in one XML file
     – Suggestion of Google
• Use the containers’ cache
     – gadgets.io.getProxyUrl
• More sources for optimization:
     – http://code.google.com/intl/de-DE/apis/gadgets/docs/publish.html
     – http://wiki.opensocial.org/index.php?title=OpenSocial_Latency_Meas
       urement

             Maintainability VS. Performance?
23.08.2010                                                   © www.role-project.eu
Performance Testing and debugging

• Use e.g. the Firebug extension of Firefox for debugging and
  measuring the performance




23.08.2010                                         © www.role-project.eu
Conclusions

• Guidelines are helping to provide a user friendly interface
• Customizations allows users to personalize their widgets
• An own Apache Shindig server can be used to develop
  interacting widgets
• Using the Gadget API prevents to “reinvent the wheel”
• Caching and cross domain problems can be handled with
  several methods
• A widget can be optimized regarding its performance
• Tools are available for debugging and performance
  measuring




23.08.2010                                           © www.role-project.eu
ROLE ALLIANCE PROGRAM


                  What is the Alliance Program?
       A partner network of strategic users, vendors and other
                             stakeholder

                Why should I become a member?
       As a member you have a lot of benefits e.g., access to our
         showcase platform, free visit of specific workshops, test
         of prototypes or attendance at Alliance Partner meetings

        How can I become part of the Alliance Program?
                        Please register under
              http://www.roleproject.eu/AllianceProgram


23.08.2010                                             © www.role-project.eu
References

• http://www.google.com/webmasters/gadgets/guidelines.html
• http://www.seoish.com/how-to-internationalize-google-
  gadgets/
• Lal, R. and Chava, L. C. 2010 Developing Web Widget with
  Html, Css, JSON and Ajax: a Complete Guide to Web
  Widget. CreateSpace.
• http://www.bitsbythepound.com/include-external-javascript-
  and-css-files-with-a-google-wave-gadget-249.html
• http://code.google.com/intl/de/apis/gadgets/docs/remote-
  content.html




23.08.2010                                        © www.role-project.eu

Weitere ähnliche Inhalte

Was ist angesagt?

MozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: TaichungMozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: Taichunglittlebtc
 
Write a Google Closure Editor Plugin
Write a Google Closure Editor PluginWrite a Google Closure Editor Plugin
Write a Google Closure Editor Pluginyinhm .
 
Jetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserJetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserlittlebtc
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipeilittlebtc
 
Web Components the best marriage for a PWA
Web Components the best marriage for a PWAWeb Components the best marriage for a PWA
Web Components the best marriage for a PWAManuel Carrasco Moñino
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Nuxeo
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Springsdeeg
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xWong Hoi Sing Edison
 
Drupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuDrupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuRené Lasseron
 

Was ist angesagt? (11)

MozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: TaichungMozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: Taichung
 
Dojo (QCon 2007 Slides)
Dojo (QCon 2007 Slides)Dojo (QCon 2007 Slides)
Dojo (QCon 2007 Slides)
 
Write a Google Closure Editor Plugin
Write a Google Closure Editor PluginWrite a Google Closure Editor Plugin
Write a Google Closure Editor Plugin
 
Jetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserJetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browser
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipei
 
Web Components the best marriage for a PWA
Web Components the best marriage for a PWAWeb Components the best marriage for a PWA
Web Components the best marriage for a PWA
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Spring
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.x
 
The Heron Mapping Client
The Heron Mapping ClientThe Heron Mapping Client
The Heron Mapping Client
 
Drupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuDrupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of Tartu
 

Ähnlich wie Best Practices in Widget Development - Examples and Counterexamples

jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesTeamstudio
 
Contributions: what they are and how to find them
Contributions: what they are and how to find themContributions: what they are and how to find them
Contributions: what they are and how to find themPedro Cambra
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!_Dewy_
 
Vincent Burckhardt - Exending Connections with OpenSocial Gadgets
Vincent Burckhardt - Exending Connections with OpenSocial GadgetsVincent Burckhardt - Exending Connections with OpenSocial Gadgets
Vincent Burckhardt - Exending Connections with OpenSocial GadgetsLetsConnect
 
Open social gadgets in ibm connections
Open social gadgets in ibm connectionsOpen social gadgets in ibm connections
Open social gadgets in ibm connectionsVincent Burckhardt
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Anupam Ranku
 
Vuejs and Web components - current state
Vuejs and Web components - current stateVuejs and Web components - current state
Vuejs and Web components - current stateMikhail Kuznetcov
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Custom Activities in UiPath (Activity Builder)
Custom Activities in UiPath (Activity Builder)Custom Activities in UiPath (Activity Builder)
Custom Activities in UiPath (Activity Builder)Cristina Vidu
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
JIO and WebViewers: interoperability for Javascript and Web Applications
JIO and WebViewers: interoperability  for Javascript and Web ApplicationsJIO and WebViewers: interoperability  for Javascript and Web Applications
JIO and WebViewers: interoperability for Javascript and Web ApplicationsXWiki
 
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesTulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesMark Rackley
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide shareMike Ensor
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQueryAnil Kumar
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with BackstageOpsta
 
Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013SPC Adriatics
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
 

Ähnlich wie Best Practices in Widget Development - Examples and Counterexamples (20)

jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
 
uMobile Development Strategies
uMobile Development StrategiesuMobile Development Strategies
uMobile Development Strategies
 
Contributions: what they are and how to find them
Contributions: what they are and how to find themContributions: what they are and how to find them
Contributions: what they are and how to find them
 
Html5 Future of WEB
Html5 Future of WEBHtml5 Future of WEB
Html5 Future of WEB
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!
 
Vincent Burckhardt - Exending Connections with OpenSocial Gadgets
Vincent Burckhardt - Exending Connections with OpenSocial GadgetsVincent Burckhardt - Exending Connections with OpenSocial Gadgets
Vincent Burckhardt - Exending Connections with OpenSocial Gadgets
 
Open social gadgets in ibm connections
Open social gadgets in ibm connectionsOpen social gadgets in ibm connections
Open social gadgets in ibm connections
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
Vuejs and Web components - current state
Vuejs and Web components - current stateVuejs and Web components - current state
Vuejs and Web components - current state
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
April 2012 uPortal Community Call
April 2012 uPortal Community CallApril 2012 uPortal Community Call
April 2012 uPortal Community Call
 
Custom Activities in UiPath (Activity Builder)
Custom Activities in UiPath (Activity Builder)Custom Activities in UiPath (Activity Builder)
Custom Activities in UiPath (Activity Builder)
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
JIO and WebViewers: interoperability for Javascript and Web Applications
JIO and WebViewers: interoperability  for Javascript and Web ApplicationsJIO and WebViewers: interoperability  for Javascript and Web Applications
JIO and WebViewers: interoperability for Javascript and Web Applications
 
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesTulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide share
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJS
 

Mehr von ROLE Project

Build your Responsive Open Learning Environment (Part II)
Build your Responsive Open Learning Environment (Part II)Build your Responsive Open Learning Environment (Part II)
Build your Responsive Open Learning Environment (Part II)ROLE Project
 
Build your Responsive Open Learning Environment (Part I)
Build your Responsive Open Learning Environment (Part I)Build your Responsive Open Learning Environment (Part I)
Build your Responsive Open Learning Environment (Part I)ROLE Project
 
Sharing Personal Learning Environments for Widget Based Systems using a Widge...
Sharing Personal Learning Environments for Widget Based Systems using a Widge...Sharing Personal Learning Environments for Widget Based Systems using a Widge...
Sharing Personal Learning Environments for Widget Based Systems using a Widge...ROLE Project
 
Towards self-regulated workplace learning
Towards self-regulated workplace learningTowards self-regulated workplace learning
Towards self-regulated workplace learningROLE Project
 
Personal Learning Management Systems: Concept, Classification, Evaluation
Personal Learning Management Systems: Concept, Classification, EvaluationPersonal Learning Management Systems: Concept, Classification, Evaluation
Personal Learning Management Systems: Concept, Classification, EvaluationROLE Project
 
Finding and using web widgets for self-regulated learning
Finding and using web widgets for self-regulated learningFinding and using web widgets for self-regulated learning
Finding and using web widgets for self-regulated learningROLE Project
 
Self-regulated learning in a PLMS
Self-regulated learning in a PLMSSelf-regulated learning in a PLMS
Self-regulated learning in a PLMSROLE Project
 
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....ROLE Project
 
English Learning Scenario
English Learning ScenarioEnglish Learning Scenario
English Learning ScenarioROLE Project
 
ROLE Project Status Meeting (January 2011)
ROLE Project Status Meeting (January 2011)ROLE Project Status Meeting (January 2011)
ROLE Project Status Meeting (January 2011)ROLE Project
 
From widgets to competencies
From widgets to competenciesFrom widgets to competencies
From widgets to competenciesROLE Project
 
Connecting the ROLE tools
Connecting the ROLE toolsConnecting the ROLE tools
Connecting the ROLE toolsROLE Project
 
A Single Sign-on mechanism for Widgets
A Single Sign-on mechanism for WidgetsA Single Sign-on mechanism for Widgets
A Single Sign-on mechanism for WidgetsROLE Project
 
Psycho pedagogical approach
Psycho pedagogical approachPsycho pedagogical approach
Psycho pedagogical approachROLE Project
 

Mehr von ROLE Project (14)

Build your Responsive Open Learning Environment (Part II)
Build your Responsive Open Learning Environment (Part II)Build your Responsive Open Learning Environment (Part II)
Build your Responsive Open Learning Environment (Part II)
 
Build your Responsive Open Learning Environment (Part I)
Build your Responsive Open Learning Environment (Part I)Build your Responsive Open Learning Environment (Part I)
Build your Responsive Open Learning Environment (Part I)
 
Sharing Personal Learning Environments for Widget Based Systems using a Widge...
Sharing Personal Learning Environments for Widget Based Systems using a Widge...Sharing Personal Learning Environments for Widget Based Systems using a Widge...
Sharing Personal Learning Environments for Widget Based Systems using a Widge...
 
Towards self-regulated workplace learning
Towards self-regulated workplace learningTowards self-regulated workplace learning
Towards self-regulated workplace learning
 
Personal Learning Management Systems: Concept, Classification, Evaluation
Personal Learning Management Systems: Concept, Classification, EvaluationPersonal Learning Management Systems: Concept, Classification, Evaluation
Personal Learning Management Systems: Concept, Classification, Evaluation
 
Finding and using web widgets for self-regulated learning
Finding and using web widgets for self-regulated learningFinding and using web widgets for self-regulated learning
Finding and using web widgets for self-regulated learning
 
Self-regulated learning in a PLMS
Self-regulated learning in a PLMSSelf-regulated learning in a PLMS
Self-regulated learning in a PLMS
 
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
 
English Learning Scenario
English Learning ScenarioEnglish Learning Scenario
English Learning Scenario
 
ROLE Project Status Meeting (January 2011)
ROLE Project Status Meeting (January 2011)ROLE Project Status Meeting (January 2011)
ROLE Project Status Meeting (January 2011)
 
From widgets to competencies
From widgets to competenciesFrom widgets to competencies
From widgets to competencies
 
Connecting the ROLE tools
Connecting the ROLE toolsConnecting the ROLE tools
Connecting the ROLE tools
 
A Single Sign-on mechanism for Widgets
A Single Sign-on mechanism for WidgetsA Single Sign-on mechanism for Widgets
A Single Sign-on mechanism for Widgets
 
Psycho pedagogical approach
Psycho pedagogical approachPsycho pedagogical approach
Psycho pedagogical approach
 

Kürzlich hochgeladen

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

Best Practices in Widget Development - Examples and Counterexamples

  • 1. Best Practices in Widget Development Examples and Counterexamples Daniel Dahrendorf (IMC) ROLE Developer Camp, Lausanne, Switzerland August 23, 2010 © www.role-project.eu
  • 2. Dr Stephen Dann from flickr.com jbvkoos from flickr.com 23.08.2010 © www.role-project.eu
  • 3. DESIGN AND USABILITY 23.08.2010 © www.role-project.eu
  • 4. In General • Focus on a single task – Give your end user a single functionality • Own added Value – Do not create a Widget which requires a second widget • Self explanatory interface – There should be no need for help text or support 23.08.2010 © www.role-project.eu
  • 5. Size of Widgets • Use a standard height • The widget should scale between 250px and 500px – Use a width of 100% for the main elements of the widget – Center elements • Use views – Canvas, home and profile views 23.08.2010 © www.role-project.eu
  • 6. Customization • Let the user customize the widget – Color – Background – Content • Provide always default or sample values and include a “welcome mode” • Use the user preferences feature of Google Gadgets 23.08.2010 © www.role-project.eu
  • 7. Use Space effectively • Avoid scrollbars • Use tabs • Use paging 23.08.2010 © www.role-project.eu
  • 8. User Account • Content should be interesting even the user is not logged in • State the benefits of creating an account • Use OAuth if possible 23.08.2010 © www.role-project.eu
  • 9. DEVELOPMENT 23.08.2010 © www.role-project.eu
  • 10. Development Environment • Own Apache Shindig Server – A web application which can be run e.g. in a Apache Tomcat • OSDE – Eclipse plugin with built in Apache Shindig server • Google Gadget Editor – A Google gadget which provides an editor and the possibility to save the widgets at iGoogle 23.08.2010 © www.role-project.eu
  • 11. Development Environment • Own Apache Shindig Server – A web application which can be run e.g. in a Apache Tomcat – Comfortable way to create complex interacting widgets 23.08.2010 © www.role-project.eu
  • 12. Using the features provided by the gadget API • The Gadget and OpenSocial API provides a lot of useful features: – fetch social data – provide UI element – Get data from external sources • Only available for type=“html’’ widgets 23.08.2010 © www.role-project.eu
  • 13. Selected Features: • Tabs – Creates customizable tabs • Setprefs – Allows setting of user preferences • Pubsub (OpenSocial 0.8 only) – Inter-widget-communication – Use OpenApp instead (http://code.google.com/p/open-app/) • Internationalization – Provides a mechanism to translate widgets 23.08.2010 © www.role-project.eu
  • 14. makeRequest and the Same Origin Policy • The gadget API provides a function to fetch HTML/XML/JSON content (OpenSocial 0.8): gadgets.io.makeRequest(url, callback, opt_params) • As widgets run in iFrames this proxy approach allows to fetch data from other domains (same origin policy) • Other approaches to solve cross domain problems are: – JSONP (retrieving JSON via Script Tags) – PMRPC (http://code.google.com/p/pmrpc/) 23.08.2010 © www.role-project.eu
  • 15. Caching Problems • If you are using makeRequest() to fetch content that is updated more than once an hour, such as feed data, you might not get the latest updates 23.08.2010 © www.role-project.eu
  • 16. Refreshing the Content Cache • Solution: create a wrapper with a refresh interval function makeCachedRequest(url, callback, params, refreshInterval) { var timestamp = new Date().getTime(); var sep = "?"; if (refreshInterval && refreshInterval > 0) { timestamp = Math.floor(timestamp / (refreshInterval * 1000)); } if (url.indexOf("?") > -1) { sep = "&"; } url = [ url, sep, "nocache=", timestamp ].join(""); gadgets.io.makeRequest(url, callback, params); } 23.08.2010 © www.role-project.eu
  • 17. Caching of external files • Container caches: – JavaScript added with <script> – CSS added with <link> – Content got using the gadget API • Further because of the widget infrastructure only absolute links are allowed • External files are needed if the widget becomes more complex 23.08.2010 © www.role-project.eu
  • 18. Loading JavaScript / CSS dynamically http://www.bitsbythepound.com/include- 1. Determine the location of the xml external-javascript-and-css-files-with-a- google-wave-gadget-249.html function getModuleBase() { if (window.__moduleBase) return window.__moduleBase; if (_args){ var moduleBase = _args()['url']; moduleBase = moduleBase.substring(0, moduleBase.lastIndexOf('/') + 1); window.__moduleBase = moduleBase; return window.__moduleBase; } alert('Can not find module base. Gadget may not work properly.'); return ''; }; 2. Create mechanism for loading JS and CSS jQuery provides a cross-browser require script plugin (requireScript) 3. Load the js/css in gadget init function init() { var useCaching = false; addScript("js/default.js",useCaching); addStylesheet("css/style.css",useCaching); }; gadgets.util.registerOnLoadHandler(init); 23.08.2010 © www.role-project.eu
  • 19. Performance • Goal: Reduce size of the files and number of HTTP requests • Minify JavaScript code – E.g. http://www.crockford.com/javascript/jsmin.html • Pack all stuff in one XML file – Suggestion of Google • Use the containers’ cache – gadgets.io.getProxyUrl • More sources for optimization: – http://code.google.com/intl/de-DE/apis/gadgets/docs/publish.html – http://wiki.opensocial.org/index.php?title=OpenSocial_Latency_Meas urement Maintainability VS. Performance? 23.08.2010 © www.role-project.eu
  • 20. Performance Testing and debugging • Use e.g. the Firebug extension of Firefox for debugging and measuring the performance 23.08.2010 © www.role-project.eu
  • 21. Conclusions • Guidelines are helping to provide a user friendly interface • Customizations allows users to personalize their widgets • An own Apache Shindig server can be used to develop interacting widgets • Using the Gadget API prevents to “reinvent the wheel” • Caching and cross domain problems can be handled with several methods • A widget can be optimized regarding its performance • Tools are available for debugging and performance measuring 23.08.2010 © www.role-project.eu
  • 22. ROLE ALLIANCE PROGRAM What is the Alliance Program? A partner network of strategic users, vendors and other stakeholder Why should I become a member? As a member you have a lot of benefits e.g., access to our showcase platform, free visit of specific workshops, test of prototypes or attendance at Alliance Partner meetings How can I become part of the Alliance Program? Please register under http://www.roleproject.eu/AllianceProgram 23.08.2010 © www.role-project.eu
  • 23. References • http://www.google.com/webmasters/gadgets/guidelines.html • http://www.seoish.com/how-to-internationalize-google- gadgets/ • Lal, R. and Chava, L. C. 2010 Developing Web Widget with Html, Css, JSON and Ajax: a Complete Guide to Web Widget. CreateSpace. • http://www.bitsbythepound.com/include-external-javascript- and-css-files-with-a-google-wave-gadget-249.html • http://code.google.com/intl/de/apis/gadgets/docs/remote- content.html 23.08.2010 © www.role-project.eu