SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Downloaden Sie, um offline zu lesen
Best Practices for
Delivering Framework Products
that include Ajax Features


Peter Laird
Oracle Safe Harbor

The following is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.
Your Speaker

• Architect for WebCenter and Portal products
  at Oracle
• 8 years on WebLogic Portal at BEA, acquired
  by Oracle in 2008
Session Goals
• Explain Oracle’s experience in the area of
  delivering products with Ajax and JavaScript
  capabilities
• Deliver a set of best practices
• Cover the Case Studies that support those
  best practices
Target Audience
• You develop a product that is used by web
  application developers, and
• You have/plan to introduce Ajax/JavaScript
  features into your product, and
• You support web application developers doing
  custom development on top of your product.
Defining Terms
• There are several types of JavaScript
  solutions
  •   Toolkit
  •   Framework
  •   Library
  •   API
• These best practices generally apply to all
  • So we won’t be precise during this talk
• Same goes for…
  • Ajax vs. JavaScript vs. DHTML
Agenda
• Introducing Oracle’s Case Studies
• Framework Selection Best Practices
  • Open Source vs. Custom
• Framework Features Best Practices
  • Client side JavaScript API
  • Client side eventing
  • Enhancing the XmlHttpRequest
• Related Best Practices
  • RESTful data APIs
  • Single Origin Policy
Oracle’s Case Studies
• Oracle provides Ajax and JavaScript enabled
  development platforms for different skill sets
• Case Studies
  •   ADF Faces Rich Client
  •   Application Express (APEX)
  •   WebLogic Portal (WLP)
  •   AquaLogic* Open Controls


       * AquaLogic was a BEA brand, no longer in use
ADF Faces Rich Client
• What it is
   • Ajax enabled JSF component library
• Skill sets
   • Java developers
   • 4GL developers (Oracle Forms, VB, PowerBuilder)
• Brief History
   •   UIX
   •   ADF Faces
   •   Apache Trinidad
   •   ADF Faces Rich Components
Application Express (APEX)
• What it is
   • A rapid web app development tool
   • Serves pages from out of Oracle database (!)
• Skill set
   • PL/SQL
• Brief History
   • HTML DB
   • Ajax introduced as an internal feature
WebLogic Portal
• What is it
   • Enterprise portal platform
• Skill set
   • Java developers
• Brief History
   • Java rendering framework
   • Ajax and JavaScript added much later
AquaLogic Open Controls
• What it is
   • JavaScript enabled JSF component library
   • Internal to BEA, for use by new BEA products
   • Has a unique feature to support .NET products
• Skill sets
   • Java developers
   • .NET developers
Agenda
• Introducing Oracle Case Studies
• Framework Selection Best Practices
  • Open Source vs. Custom
• Framework Features Best Practices
  • Client side JavaScript API
  • Client side eventing
  • Enhancing the XmlHttpRequest
• Related Best Practices
  • RESTful data APIs
  • Single Origin Policy
Open Source or Custom?
• Difficult to justify creating a custom
  Ajax/JavaScript framework anymore
• The open source frameworks provide sizable
  feature sets
• But there are niche cases where a custom
  framework is still called for

• Best Practice 1: unless you have unusual
  requirements, use an open source framework
Open Source Framework Features
•   Cross browser support
•   JavaScript packaging and compression
•   Localization
•   Accessibility
•   Pre-built widgets
•   Ajax utilities
•   …
Using an Open Source
              Framework
• Best Practices
  •   Public vs. Private
  •   Namespacing
  •   Versioning
  •   Support
  •   Licensing
• Case Studies:
  • WebLogic Portal and Dojo
  • APEX and jQuery
Public vs. Private
• Can developers use the open source
  framework you have embedded?
  • Just because it is discoverable, does not make it
    public
  • Litmus test: will you document code samples
    showing use of the framework?
• Will see why making it public is a big issue…

• Best Practice 2: prefer to keep the embedded
  framework as a private implementation detail.
Namespacing
• Will you repackage the framework into your
  own namespace?
• Pros
  • Allows developer to use a different version of the
    framework
  • Reduces need for you to deliver the “right” version
    of the framework
  • If private, namespacing reinforces the idea that it is
    an internal implementation detail
Namespacing
• Cons
  • Hinders the ability for developers to easily
    incorporate bug fixes from the project
  • May cause extra network traffic if developer uses
    non-namespaced version of same framework
  • May unwind CDN optimizations


• Best Practice 3: prefer to namespace the
  framework, as it gives developers more
  flexibility to use whatever they want
Versioning
• What version of the framework do you select?
  • Multiple considerations…
• What is your backwards compatibility story?
  • If a developer writes code against the public
    framework, what happens with your next release?
  • Not all frameworks promise backwards
    compatibility
  • You may be locked into the same version of the
    framework, forever
Versioning
• Will you have to fix the bugs in the open
  source framework?
  • Do your customers expect this from you?
  • You have to have a story:
     • You provide the fixes as a patch to your product, or
     • Allow the customer to uplevel the framework version
       on their own
  • What if the bug is in a part of the framework your
    code doesn’t use?
     • If its public, are you obligated to fix it?
  • If using an obscure framework, more likely you
    have to roll your own fixes
Versioning
• Do you allow customers to uplevel the
  embedded version?
  • Pro: allows them to adopt bug fixes, enhancements
    without work on your part
  • Con: if your product code is using the framework, it
    may break your code

• Best Practice 4: whatever you decide, make
  sure:
  • All stakeholders are involved in the decision
  • Your support policies are clearly established
Licensing
• Different open source frameworks are offered
  under different licenses

• Best Practice 5: make sure the framework
  you choose has a license that is acceptable to
  your product
Case Study: WLP 10.2 and Dojo (DnD)
 • Portal Framework Drag and Drop (DnD)
   • Provides the ability to drag and drop portlets on a
     page
 • Narrow subset of Dojo .43
 • Namespaced and private
 • Supported, though no fixes have been
   required yet
 • Upleveling not supported
Case Study: WLP 10.2 and Dojo
             (DVT)
• Dynamic Visitor Tools (DVT)
  • Provides the portlet picker, inline page editing, etc
• Full Dojo 1.0
  • Serious debate between .43 and 1.0
• Entire feature offered as a “Sample” for first
  release to side step the complex issues
• All source code provided
• Dojo is public and not namespaced
• Customers may uplevel Dojo as they wish
• No official support for DVT or Dojo framework
Case Study: WLP 2009 and Dojo (DVT)
  • Next version of WLP will productize the DVT
  • Dojo 1.1
  • Semi-private and namespaced (“multiversioned”)
     • Limited customizations to standard DVT are allowed to use
       the namespaced version
         • But may not have forward compatibility with newer
           WLP releases
     • Any major work must use a customer provided toolkit
  • Customers will be allowed to uplevel the framework to
    any Dojo 1.x beyond 1.1
     • Upleveling will be the Dojo bug fix story
     • WLP will fix issues in it’s code that arise from this
     • Relies on Dojo’s backwards compatibility story
Case Study: APEX 4.0 and jQuery
 • APEX will embed jQuery for both internal use
   and customer use cases
 • jQuery 1.3 (or later, depends on 4.0 release date)
 • Public
 • Not namespaced
 • Upleveling will not be officially supported,
   though probably will just work
    • jQuery bugs will be handled on a case by case
      basis
Building a Custom Framework
• When does this make sense
• Case Studies
  •   ADF Faces Rich Client
  •   AquaLogic Open Controls
  •   APEX Ajax Framework
  •   WebLogic Portal Declarative Ajax
Building a Custom Framework
• Opposes the first best practice (use an open
  source one) but sometimes makes sense
  • You might have unique requirements
  • Once built, consider providing to open source


• Best Practice 6: when choosing to build a
  custom framework, make sure you have
  identified the reasons for doing so, and have
  exhausted all open source candidates
Building a Custom Framework
• Some of the open source issues apply:
  • Public vs. Private – still a decision to be made
• But most don’t:
  •   Namespacing – by definition, it is namespaced
  •   Support – of course you will be providing the fixes
  •   Backwards compatibility – in your hands
  •   Versioning – customers cannot uplevel on own
• A few new ones:
  • Cross browser support, localization, etc.
  • Documentation and sample code
Case Study: ADF Faces Rich Client
• Custom built JSF components
  • Did not use Tomahawk, Ajax4JSF etc
  • Did not use open source Ajax/JS framework
• Timing and ownership were major
  requirements
  • Foundation for Fusion Apps and Middleware
  • Need to own our own destiny
  • Built custom from the ground up
• Contributed back to open source (Trinidad)
Case Study: AquaLogic Open Ctrls
• Custom built JSF components
  • Did not use Tomahawk, Ajax4JSF etc
  • Did not use open source Ajax/JS framework
• Timing and ownership were major
  requirements
  • Started in 2005
  • Internally used by new BEA products
• Unique in that they are cross compiled as
  .NET Web Parts for .NET based products
Case Study: APEX Ajax Framework
• APEX 2.0 introduced SQL Workshop
  • Ajax powered interactive SQL editor
  • Built small custom framework to support unique
    requirements invoking HTTP requests at mod_plsql
• On public forums, customers were thrilled by
  Workshop, wanted to use same features
• APEX team decided to open up framework to the
  public, now heavily used by customers
• Will cover in more detail in a later section…
Case Study: WLP Declarative Ajax
• Feature enables WLP customers to just say “Ajax =
  yes” on a portlet/page, and framework handles the rest
• Ajax framework is small and very targeted:
   • Finds portal URLs in portlet markup
   • Rewrites URLs to use XHR to WLP’s Ajax servlet
   • Handles updating the DOM with the response
• Officially private in 9.2
   • But enables a very powerful use case so became public in a
     later release
• Will cover in more detail in a later section…
Agenda
• Introducing Oracle Case Studies
• Framework Selection Best Practices
  • Open Source vs. Custom
• Framework Features Best Practices
  • Client side JavaScript API
  • Client side eventing
  • Enhancing the XmlHttpRequest
• Related Best Practices
  • RESTful data APIs
  • Single Origin Policy
Client Side JavaScript API
• Complements the core framework (open
  source or custom)
   • Sits on top of the core Ajax/JavaScript framework
   • Aids developers in quickly building features
• Provides domain specific capabilities, like:
   • Application data model
   • Application actions
   • Application lifecycle hooks
Client Side JavaScript API
• Similar issues as with building a custom
  Ajax/JavaScript framework
   • Support
   • Documentation
   • Backwards compatibility


• Best Practice 7: provide a public domain-
  specific client side API in addition to the core
  framework
Case Study: WLP DISC
• DISC is the public client side API for WLP
• Provides
  • Access to the portal page’s data model
     • What portlet ID am I? What page ID am I on?
     • Often feeds data to invocations of WLP REST APIs
  • Actions such as portlet refresh (next release)
  • Hooks such as page rendering lifecycle
Case Study: APEX 4.0 Page Model
• APEX 4.0 will include a lightweight JavaScript
  API
• Will provide data model of the current page
  • What regions are visible, hidden
• Intends to support some light interactions, not
  persistent page customization
Client Side Eventing
• Enables wireup and communication between
  elements on the page
• Very useful for developers to inject new
  components and JavaScript onto a page that
  interact with existing elements
• Examples:
  • OpenAjax Hub publish/subscribe
  • Dojo publish/subscribe, Dojo connect
Client Side Eventing
• Drawbacks
  • No standard way to do this yet
  • Need to solve data marshalling issues


• Best Practice 8: provide a mechanism for
  your components to publish and subscribe to
  page events
Case Study: ADF Faces Rich Client
• Enables developers to add event hooks into
  the ADF components
• Hooks execute arbitrary JavaScript provided
  by the developer
• Enables developer to override default
  behavior of the components
Case Study: ADF Faces Rich Client
JSF Document:
<af:menu text=quot;Main Menu 1quot;>
   <af:commandMenuItem text=quot;Sub Menu 1_1quot;/>
   <af:clientListener method=quot;showquot; type=quot;mouseOverquot;/>
</af:menu>

Custom JavaScript
function show(event){
   var adfRichMenu = event.getSource();
   adfRichMenu.getPeer().show();
}
Enhancing the XmlHttpRequest
• XmlHttpRequest is the foundation of Ajax
• At times, this is the best place to provide
  functionality
• May require integration with your Ajax
  framework of choice

• Best Practice 9: consider enhancing the
  XmlHttpRequest for fine grained solutions
Case Study: WLP XmlPortletRequest
 • Remember the declarative Ajax feature
   discussed previously
 • When defined at the page level, multiple
   portlets may need to be re-rendered based on
   single request
 • WLP provides enhanced XHR to handle
   multiple markup payloads in the response
Case Study: WLP XmlPortletRequest
 <render:jspContentUrl contentUri=quot;/myportlet/data.jspquot; var=quot;dataUrlquot;/>
 <script type=quot;text/javascriptquot;>
    var dataUrl = '${dataUrl}';
    var xmlhttp = new bea.wlp.disc.io.XMLHttpRequest();

    xmlhttp.onreadystatechange = function() {
         if (xmlhttp.readyState == 4) {
            // this portlet’s markup is in xmlhttp.responseText
         }
    }

    xmlhttp.open('GET', dataUrl, true);
    xmlhttp.send();
 </script>
Case Study: APEX apex.ajax
• APEX receives HTTP requests through
  Apache+mod_plsql
• mod_plsql has very specific requirements on
  how requests are structured
  • Targeting the correct stored procedure
  • Passing lists of parameters
• Invoking XHR against mod_plsql directly is not
  easy
• apex.ajax.ondemand() was created as a
  wrapper that handles the messy details
Case Study: APEX apex.ajax
function OnDemand(){
  var apexRequest = new apex.ajax.ondemand('HELLO',
     function(){
       var l_s = p.readyState;
       if(l_s == 1||l_s == 2||l_s == 3){}
       else if(l_s == 4){alert(p.responseText);}
       else{return false;}
     }
  );
  apexRequest._get();
}
Agenda
• Introducing Oracle Case Studies
• Framework Selection Best Practices
  • Open Source vs. Custom
• Framework Features Best Practices
  • Client side JavaScript API
  • Client side eventing
  • Enhancing the XmlHttpRequest
• Related Best Practices
  • RESTful data APIs
  • Single Origin Policy
RESTful Data APIs
• Warrants more than a single slide, but here we are
• Think “web friendly API”
• RESTful APIs adhere to the semantics of HTTP to
  provide power with simplicity
   • URLs map to nouns in your system
   • HTTP verbs are significant: GET, POST, PUT, DELETE
   • Return payload might be XML, JSON, HTML
• In short, and massively oversimplified:
   • RESTful APIs provide data that is easily consumed by a
     browser via your Ajax framework (XHR)
RESTful Data APIs
• Best Practice 10: complement your client
  side frameworks and API with server side
  RESTful data APIs.
• Things to pay attention to:
  • Vibrant community discussions about proper REST
     • URL design is time consuming
  • Security concerns
     • Allow APIs to be disabled if customer chooses
     • Guard against CSRF attacks
  • Performance – paging through data sets
  • Providing batch update capabilities
Case Study: WLP and MSFT Popfly
• WLP has an embedded Content Management (CM)
  system
• Traditionally, not very easy to surface this content in
  other applications
   • Programmatic integration required
• Added RESTful APIs to WLP CM, and it opens up
  many possibilities
• Microsoft Popfly is a hosted JavaScript application
  creation tool
• RESTful APIs enables Popfly (and many other clients)
  to consume WLP content via XHR
Single Origin Policy
• Limits the reach of the XmlHttpRequest
   • Helps defend against malicious XSS attacks
   • There are ways around it, but...
• Consider proxy solutions if your product requires
  XHRs to different network domains
   • Custom building a proxy
   • Rely on an existing proxy solution (Squid, etc)
• Think carefully how to lock it down
   • Open proxies are dangerous
   • White lists, black lists
   • Defending against URL hacking
• Best Practice 11: don’t build your own proxy
Case Study: WLP WSRP Proxy
• Not a proxy that helps with the Single Origin
  Policy, but an interesting case study
• WSRP is an important portal standard
  • Long story short – requires implementers to build a
    proxy servlet
• Issues encountered:
  • Securing the proxy servlet
  • Cookie management
  • Opaque vs. transparent URLs
Questions?
Laird Best Practices Ajax World West2008

Weitere ähnliche Inhalte

Was ist angesagt?

LV Dev Efficiency NIDays 2015
LV Dev Efficiency NIDays 2015LV Dev Efficiency NIDays 2015
LV Dev Efficiency NIDays 2015
Jeffrey Habets
 
Exactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaExactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in Kostroma
Iosif Itkin
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
Hannes Lowette
 

Was ist angesagt? (20)

Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Gext-...
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
 
SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011
 
Distributed and Scalable JMeter
Distributed and Scalable JMeterDistributed and Scalable JMeter
Distributed and Scalable JMeter
 
LV Dev Efficiency NIDays 2015
LV Dev Efficiency NIDays 2015LV Dev Efficiency NIDays 2015
LV Dev Efficiency NIDays 2015
 
Test Engineering on Mobage
Test Engineering on MobageTest Engineering on Mobage
Test Engineering on Mobage
 
Prod-Like Integration Testing for Distributed Containerized Applications
Prod-Like Integration Testing for Distributed Containerized ApplicationsProd-Like Integration Testing for Distributed Containerized Applications
Prod-Like Integration Testing for Distributed Containerized Applications
 
You Were Lied To About Optimization
You Were Lied To About OptimizationYou Were Lied To About Optimization
You Were Lied To About Optimization
 
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчетыQA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
 
BDD with JBehave and Selenium
BDD with JBehave and SeleniumBDD with JBehave and Selenium
BDD with JBehave and Selenium
 
Continuous delivery from the trenches
Continuous delivery from the trenchesContinuous delivery from the trenches
Continuous delivery from the trenches
 
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | EdurekaDevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
 
Unit testing - A&BP CC
Unit testing - A&BP CCUnit testing - A&BP CC
Unit testing - A&BP CC
 
DLW Europe - JavaScript Tooling
DLW Europe - JavaScript ToolingDLW Europe - JavaScript Tooling
DLW Europe - JavaScript Tooling
 
Drupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond JenkinsDrupal Continuous Integration and devops - Beyond Jenkins
Drupal Continuous Integration and devops - Beyond Jenkins
 
Real World Technologies
Real World TechnologiesReal World Technologies
Real World Technologies
 
Exactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaExactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in Kostroma
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginners
 
Automated Visual Regression Testing by Dave Sadlon
Automated Visual Regression Testing by Dave SadlonAutomated Visual Regression Testing by Dave Sadlon
Automated Visual Regression Testing by Dave Sadlon
 

Andere mochten auch

I Phone Presentation Jan Linden Gips
I Phone Presentation Jan Linden GipsI Phone Presentation Jan Linden Gips
I Phone Presentation Jan Linden Gips
rajivmordani
 
Ajax World West I Phone Summit
Ajax World West I Phone SummitAjax World West I Phone Summit
Ajax World West I Phone Summit
rajivmordani
 
08 10 12 Meebo Ajaxworld Preso
08 10 12 Meebo Ajaxworld Preso08 10 12 Meebo Ajaxworld Preso
08 10 12 Meebo Ajaxworld Preso
rajivmordani
 
Ajax World2008 Eric Farrar
Ajax World2008 Eric FarrarAjax World2008 Eric Farrar
Ajax World2008 Eric Farrar
rajivmordani
 
Ajax Integration Guide
Ajax Integration GuideAjax Integration Guide
Ajax Integration Guide
rajivmordani
 

Andere mochten auch (8)

I Phone Presentation Jan Linden Gips
I Phone Presentation Jan Linden GipsI Phone Presentation Jan Linden Gips
I Phone Presentation Jan Linden Gips
 
Design Based Dev
Design Based DevDesign Based Dev
Design Based Dev
 
Ajax World Fall08
Ajax World Fall08Ajax World Fall08
Ajax World Fall08
 
Ajax World West I Phone Summit
Ajax World West I Phone SummitAjax World West I Phone Summit
Ajax World West I Phone Summit
 
08 10 12 Meebo Ajaxworld Preso
08 10 12 Meebo Ajaxworld Preso08 10 12 Meebo Ajaxworld Preso
08 10 12 Meebo Ajaxworld Preso
 
Ajax World2008 Eric Farrar
Ajax World2008 Eric FarrarAjax World2008 Eric Farrar
Ajax World2008 Eric Farrar
 
Ajax Integration Guide
Ajax Integration GuideAjax Integration Guide
Ajax Integration Guide
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
 

Ähnlich wie Laird Best Practices Ajax World West2008

Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
oscon2007
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYB
nukeevry1
 

Ähnlich wie Laird Best Practices Ajax World West2008 (20)

Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Ilog Ria2
Ilog Ria2Ilog Ria2
Ilog Ria2
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example
 
Adrian Pomilio - Flex Ajax Bridge and Legacy Applications
Adrian Pomilio - Flex Ajax Bridge and Legacy ApplicationsAdrian Pomilio - Flex Ajax Bridge and Legacy Applications
Adrian Pomilio - Flex Ajax Bridge and Legacy Applications
 
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty MarketAPIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
 
Wes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your ApplicationWes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your Application
 
C# 4.0 - Whats New
C# 4.0 - Whats NewC# 4.0 - Whats New
C# 4.0 - Whats New
 
Application Architecture Trends
Application Architecture TrendsApplication Architecture Trends
Application Architecture Trends
 
Ajax World West
Ajax World WestAjax World West
Ajax World West
 
Apache Cordova
Apache CordovaApache Cordova
Apache Cordova
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
 
Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009
 
Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009
 
Symfony for non-techies
Symfony for non-techiesSymfony for non-techies
Symfony for non-techies
 
Administrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA HumAdministrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA Hum
 
Administrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA HumAdministrivia: Golden Tips for Making JIRA Hum
Administrivia: Golden Tips for Making JIRA Hum
 
Javascript Framework Roundup FYB
Javascript Framework Roundup FYBJavascript Framework Roundup FYB
Javascript Framework Roundup FYB
 
Drupal
DrupalDrupal
Drupal
 
Nuxeo Roadmap 2008/06
Nuxeo Roadmap 2008/06Nuxeo Roadmap 2008/06
Nuxeo Roadmap 2008/06
 

Mehr von rajivmordani

Web 2 0 Data Visualization With Jsf
Web 2 0 Data Visualization With JsfWeb 2 0 Data Visualization With Jsf
Web 2 0 Data Visualization With Jsf
rajivmordani
 
X Aware Ajax World V1
X Aware Ajax World V1X Aware Ajax World V1
X Aware Ajax World V1
rajivmordani
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
rajivmordani
 
Tripit Ajaxworld V5
Tripit Ajaxworld V5Tripit Ajaxworld V5
Tripit Ajaxworld V5
rajivmordani
 
Turbo Enterprise Web 2.0 Ajax World 20081
Turbo Enterprise Web 2.0 Ajax World 20081Turbo Enterprise Web 2.0 Ajax World 20081
Turbo Enterprise Web 2.0 Ajax World 20081
rajivmordani
 
Sue Googe Spice Up Ux
Sue Googe Spice Up UxSue Googe Spice Up Ux
Sue Googe Spice Up Ux
rajivmordani
 
Social Networking Intranet
Social Networking IntranetSocial Networking Intranet
Social Networking Intranet
rajivmordani
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
rajivmordani
 
Server Side Javascript
Server Side JavascriptServer Side Javascript
Server Side Javascript
rajivmordani
 
Slow Cool 20081009 Final
Slow Cool 20081009 FinalSlow Cool 20081009 Final
Slow Cool 20081009 Final
rajivmordani
 
Pushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax WPushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax W
rajivmordani
 
I Phone Dev Summit Prezo Guy Naor Final
I Phone Dev Summit Prezo Guy Naor FinalI Phone Dev Summit Prezo Guy Naor Final
I Phone Dev Summit Prezo Guy Naor Final
rajivmordani
 
Netapp Michael Galpin
Netapp Michael GalpinNetapp Michael Galpin
Netapp Michael Galpin
rajivmordani
 
Mike Grushin Developing Ugc Sites That Scale
Mike Grushin    Developing Ugc Sites That ScaleMike Grushin    Developing Ugc Sites That Scale
Mike Grushin Developing Ugc Sites That Scale
rajivmordani
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1
rajivmordani
 
Good Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas CrockfordGood Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas Crockford
rajivmordani
 
Flying Pixels Ent Apps Jeremy Chone
Flying Pixels Ent Apps Jeremy ChoneFlying Pixels Ent Apps Jeremy Chone
Flying Pixels Ent Apps Jeremy Chone
rajivmordani
 

Mehr von rajivmordani (20)

Web 2 0 Data Visualization With Jsf
Web 2 0 Data Visualization With JsfWeb 2 0 Data Visualization With Jsf
Web 2 0 Data Visualization With Jsf
 
X Aware Ajax World V1
X Aware Ajax World V1X Aware Ajax World V1
X Aware Ajax World V1
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
Tripit Ajaxworld V5
Tripit Ajaxworld V5Tripit Ajaxworld V5
Tripit Ajaxworld V5
 
Turbo Enterprise Web 2.0 Ajax World 20081
Turbo Enterprise Web 2.0 Ajax World 20081Turbo Enterprise Web 2.0 Ajax World 20081
Turbo Enterprise Web 2.0 Ajax World 20081
 
Sue Googe Spice Up Ux
Sue Googe Spice Up UxSue Googe Spice Up Ux
Sue Googe Spice Up Ux
 
Social Networking Intranet
Social Networking IntranetSocial Networking Intranet
Social Networking Intranet
 
Ssjs Presentation
Ssjs PresentationSsjs Presentation
Ssjs Presentation
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
Server Side Javascript
Server Side JavascriptServer Side Javascript
Server Side Javascript
 
Ria Enterprise
Ria EnterpriseRia Enterprise
Ria Enterprise
 
Slow Cool 20081009 Final
Slow Cool 20081009 FinalSlow Cool 20081009 Final
Slow Cool 20081009 Final
 
Pushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax WPushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax W
 
I Phone Dev Summit Prezo Guy Naor Final
I Phone Dev Summit Prezo Guy Naor FinalI Phone Dev Summit Prezo Guy Naor Final
I Phone Dev Summit Prezo Guy Naor Final
 
Netapp Michael Galpin
Netapp Michael GalpinNetapp Michael Galpin
Netapp Michael Galpin
 
Mike Grushin Developing Ugc Sites That Scale
Mike Grushin    Developing Ugc Sites That ScaleMike Grushin    Developing Ugc Sites That Scale
Mike Grushin Developing Ugc Sites That Scale
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1
 
Good Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas CrockfordGood Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas Crockford
 
Flying Pixels Ent Apps Jeremy Chone
Flying Pixels Ent Apps Jeremy ChoneFlying Pixels Ent Apps Jeremy Chone
Flying Pixels Ent Apps Jeremy Chone
 
I Phone Dev
I Phone DevI Phone Dev
I Phone Dev
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Laird Best Practices Ajax World West2008

  • 1.
  • 2. Best Practices for Delivering Framework Products that include Ajax Features Peter Laird
  • 3. Oracle Safe Harbor The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. Your Speaker • Architect for WebCenter and Portal products at Oracle • 8 years on WebLogic Portal at BEA, acquired by Oracle in 2008
  • 5. Session Goals • Explain Oracle’s experience in the area of delivering products with Ajax and JavaScript capabilities • Deliver a set of best practices • Cover the Case Studies that support those best practices
  • 6. Target Audience • You develop a product that is used by web application developers, and • You have/plan to introduce Ajax/JavaScript features into your product, and • You support web application developers doing custom development on top of your product.
  • 7. Defining Terms • There are several types of JavaScript solutions • Toolkit • Framework • Library • API • These best practices generally apply to all • So we won’t be precise during this talk • Same goes for… • Ajax vs. JavaScript vs. DHTML
  • 8. Agenda • Introducing Oracle’s Case Studies • Framework Selection Best Practices • Open Source vs. Custom • Framework Features Best Practices • Client side JavaScript API • Client side eventing • Enhancing the XmlHttpRequest • Related Best Practices • RESTful data APIs • Single Origin Policy
  • 9. Oracle’s Case Studies • Oracle provides Ajax and JavaScript enabled development platforms for different skill sets • Case Studies • ADF Faces Rich Client • Application Express (APEX) • WebLogic Portal (WLP) • AquaLogic* Open Controls * AquaLogic was a BEA brand, no longer in use
  • 10. ADF Faces Rich Client • What it is • Ajax enabled JSF component library • Skill sets • Java developers • 4GL developers (Oracle Forms, VB, PowerBuilder) • Brief History • UIX • ADF Faces • Apache Trinidad • ADF Faces Rich Components
  • 11. Application Express (APEX) • What it is • A rapid web app development tool • Serves pages from out of Oracle database (!) • Skill set • PL/SQL • Brief History • HTML DB • Ajax introduced as an internal feature
  • 12. WebLogic Portal • What is it • Enterprise portal platform • Skill set • Java developers • Brief History • Java rendering framework • Ajax and JavaScript added much later
  • 13. AquaLogic Open Controls • What it is • JavaScript enabled JSF component library • Internal to BEA, for use by new BEA products • Has a unique feature to support .NET products • Skill sets • Java developers • .NET developers
  • 14. Agenda • Introducing Oracle Case Studies • Framework Selection Best Practices • Open Source vs. Custom • Framework Features Best Practices • Client side JavaScript API • Client side eventing • Enhancing the XmlHttpRequest • Related Best Practices • RESTful data APIs • Single Origin Policy
  • 15. Open Source or Custom? • Difficult to justify creating a custom Ajax/JavaScript framework anymore • The open source frameworks provide sizable feature sets • But there are niche cases where a custom framework is still called for • Best Practice 1: unless you have unusual requirements, use an open source framework
  • 16. Open Source Framework Features • Cross browser support • JavaScript packaging and compression • Localization • Accessibility • Pre-built widgets • Ajax utilities • …
  • 17. Using an Open Source Framework • Best Practices • Public vs. Private • Namespacing • Versioning • Support • Licensing • Case Studies: • WebLogic Portal and Dojo • APEX and jQuery
  • 18. Public vs. Private • Can developers use the open source framework you have embedded? • Just because it is discoverable, does not make it public • Litmus test: will you document code samples showing use of the framework? • Will see why making it public is a big issue… • Best Practice 2: prefer to keep the embedded framework as a private implementation detail.
  • 19. Namespacing • Will you repackage the framework into your own namespace? • Pros • Allows developer to use a different version of the framework • Reduces need for you to deliver the “right” version of the framework • If private, namespacing reinforces the idea that it is an internal implementation detail
  • 20. Namespacing • Cons • Hinders the ability for developers to easily incorporate bug fixes from the project • May cause extra network traffic if developer uses non-namespaced version of same framework • May unwind CDN optimizations • Best Practice 3: prefer to namespace the framework, as it gives developers more flexibility to use whatever they want
  • 21. Versioning • What version of the framework do you select? • Multiple considerations… • What is your backwards compatibility story? • If a developer writes code against the public framework, what happens with your next release? • Not all frameworks promise backwards compatibility • You may be locked into the same version of the framework, forever
  • 22. Versioning • Will you have to fix the bugs in the open source framework? • Do your customers expect this from you? • You have to have a story: • You provide the fixes as a patch to your product, or • Allow the customer to uplevel the framework version on their own • What if the bug is in a part of the framework your code doesn’t use? • If its public, are you obligated to fix it? • If using an obscure framework, more likely you have to roll your own fixes
  • 23. Versioning • Do you allow customers to uplevel the embedded version? • Pro: allows them to adopt bug fixes, enhancements without work on your part • Con: if your product code is using the framework, it may break your code • Best Practice 4: whatever you decide, make sure: • All stakeholders are involved in the decision • Your support policies are clearly established
  • 24. Licensing • Different open source frameworks are offered under different licenses • Best Practice 5: make sure the framework you choose has a license that is acceptable to your product
  • 25. Case Study: WLP 10.2 and Dojo (DnD) • Portal Framework Drag and Drop (DnD) • Provides the ability to drag and drop portlets on a page • Narrow subset of Dojo .43 • Namespaced and private • Supported, though no fixes have been required yet • Upleveling not supported
  • 26. Case Study: WLP 10.2 and Dojo (DVT) • Dynamic Visitor Tools (DVT) • Provides the portlet picker, inline page editing, etc • Full Dojo 1.0 • Serious debate between .43 and 1.0 • Entire feature offered as a “Sample” for first release to side step the complex issues • All source code provided • Dojo is public and not namespaced • Customers may uplevel Dojo as they wish • No official support for DVT or Dojo framework
  • 27. Case Study: WLP 2009 and Dojo (DVT) • Next version of WLP will productize the DVT • Dojo 1.1 • Semi-private and namespaced (“multiversioned”) • Limited customizations to standard DVT are allowed to use the namespaced version • But may not have forward compatibility with newer WLP releases • Any major work must use a customer provided toolkit • Customers will be allowed to uplevel the framework to any Dojo 1.x beyond 1.1 • Upleveling will be the Dojo bug fix story • WLP will fix issues in it’s code that arise from this • Relies on Dojo’s backwards compatibility story
  • 28. Case Study: APEX 4.0 and jQuery • APEX will embed jQuery for both internal use and customer use cases • jQuery 1.3 (or later, depends on 4.0 release date) • Public • Not namespaced • Upleveling will not be officially supported, though probably will just work • jQuery bugs will be handled on a case by case basis
  • 29. Building a Custom Framework • When does this make sense • Case Studies • ADF Faces Rich Client • AquaLogic Open Controls • APEX Ajax Framework • WebLogic Portal Declarative Ajax
  • 30. Building a Custom Framework • Opposes the first best practice (use an open source one) but sometimes makes sense • You might have unique requirements • Once built, consider providing to open source • Best Practice 6: when choosing to build a custom framework, make sure you have identified the reasons for doing so, and have exhausted all open source candidates
  • 31. Building a Custom Framework • Some of the open source issues apply: • Public vs. Private – still a decision to be made • But most don’t: • Namespacing – by definition, it is namespaced • Support – of course you will be providing the fixes • Backwards compatibility – in your hands • Versioning – customers cannot uplevel on own • A few new ones: • Cross browser support, localization, etc. • Documentation and sample code
  • 32. Case Study: ADF Faces Rich Client • Custom built JSF components • Did not use Tomahawk, Ajax4JSF etc • Did not use open source Ajax/JS framework • Timing and ownership were major requirements • Foundation for Fusion Apps and Middleware • Need to own our own destiny • Built custom from the ground up • Contributed back to open source (Trinidad)
  • 33. Case Study: AquaLogic Open Ctrls • Custom built JSF components • Did not use Tomahawk, Ajax4JSF etc • Did not use open source Ajax/JS framework • Timing and ownership were major requirements • Started in 2005 • Internally used by new BEA products • Unique in that they are cross compiled as .NET Web Parts for .NET based products
  • 34. Case Study: APEX Ajax Framework • APEX 2.0 introduced SQL Workshop • Ajax powered interactive SQL editor • Built small custom framework to support unique requirements invoking HTTP requests at mod_plsql • On public forums, customers were thrilled by Workshop, wanted to use same features • APEX team decided to open up framework to the public, now heavily used by customers • Will cover in more detail in a later section…
  • 35. Case Study: WLP Declarative Ajax • Feature enables WLP customers to just say “Ajax = yes” on a portlet/page, and framework handles the rest • Ajax framework is small and very targeted: • Finds portal URLs in portlet markup • Rewrites URLs to use XHR to WLP’s Ajax servlet • Handles updating the DOM with the response • Officially private in 9.2 • But enables a very powerful use case so became public in a later release • Will cover in more detail in a later section…
  • 36. Agenda • Introducing Oracle Case Studies • Framework Selection Best Practices • Open Source vs. Custom • Framework Features Best Practices • Client side JavaScript API • Client side eventing • Enhancing the XmlHttpRequest • Related Best Practices • RESTful data APIs • Single Origin Policy
  • 37. Client Side JavaScript API • Complements the core framework (open source or custom) • Sits on top of the core Ajax/JavaScript framework • Aids developers in quickly building features • Provides domain specific capabilities, like: • Application data model • Application actions • Application lifecycle hooks
  • 38. Client Side JavaScript API • Similar issues as with building a custom Ajax/JavaScript framework • Support • Documentation • Backwards compatibility • Best Practice 7: provide a public domain- specific client side API in addition to the core framework
  • 39. Case Study: WLP DISC • DISC is the public client side API for WLP • Provides • Access to the portal page’s data model • What portlet ID am I? What page ID am I on? • Often feeds data to invocations of WLP REST APIs • Actions such as portlet refresh (next release) • Hooks such as page rendering lifecycle
  • 40. Case Study: APEX 4.0 Page Model • APEX 4.0 will include a lightweight JavaScript API • Will provide data model of the current page • What regions are visible, hidden • Intends to support some light interactions, not persistent page customization
  • 41. Client Side Eventing • Enables wireup and communication between elements on the page • Very useful for developers to inject new components and JavaScript onto a page that interact with existing elements • Examples: • OpenAjax Hub publish/subscribe • Dojo publish/subscribe, Dojo connect
  • 42. Client Side Eventing • Drawbacks • No standard way to do this yet • Need to solve data marshalling issues • Best Practice 8: provide a mechanism for your components to publish and subscribe to page events
  • 43. Case Study: ADF Faces Rich Client • Enables developers to add event hooks into the ADF components • Hooks execute arbitrary JavaScript provided by the developer • Enables developer to override default behavior of the components
  • 44. Case Study: ADF Faces Rich Client JSF Document: <af:menu text=quot;Main Menu 1quot;> <af:commandMenuItem text=quot;Sub Menu 1_1quot;/> <af:clientListener method=quot;showquot; type=quot;mouseOverquot;/> </af:menu> Custom JavaScript function show(event){ var adfRichMenu = event.getSource(); adfRichMenu.getPeer().show(); }
  • 45. Enhancing the XmlHttpRequest • XmlHttpRequest is the foundation of Ajax • At times, this is the best place to provide functionality • May require integration with your Ajax framework of choice • Best Practice 9: consider enhancing the XmlHttpRequest for fine grained solutions
  • 46. Case Study: WLP XmlPortletRequest • Remember the declarative Ajax feature discussed previously • When defined at the page level, multiple portlets may need to be re-rendered based on single request • WLP provides enhanced XHR to handle multiple markup payloads in the response
  • 47. Case Study: WLP XmlPortletRequest <render:jspContentUrl contentUri=quot;/myportlet/data.jspquot; var=quot;dataUrlquot;/> <script type=quot;text/javascriptquot;> var dataUrl = '${dataUrl}'; var xmlhttp = new bea.wlp.disc.io.XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { // this portlet’s markup is in xmlhttp.responseText } } xmlhttp.open('GET', dataUrl, true); xmlhttp.send(); </script>
  • 48. Case Study: APEX apex.ajax • APEX receives HTTP requests through Apache+mod_plsql • mod_plsql has very specific requirements on how requests are structured • Targeting the correct stored procedure • Passing lists of parameters • Invoking XHR against mod_plsql directly is not easy • apex.ajax.ondemand() was created as a wrapper that handles the messy details
  • 49. Case Study: APEX apex.ajax function OnDemand(){ var apexRequest = new apex.ajax.ondemand('HELLO', function(){ var l_s = p.readyState; if(l_s == 1||l_s == 2||l_s == 3){} else if(l_s == 4){alert(p.responseText);} else{return false;} } ); apexRequest._get(); }
  • 50. Agenda • Introducing Oracle Case Studies • Framework Selection Best Practices • Open Source vs. Custom • Framework Features Best Practices • Client side JavaScript API • Client side eventing • Enhancing the XmlHttpRequest • Related Best Practices • RESTful data APIs • Single Origin Policy
  • 51. RESTful Data APIs • Warrants more than a single slide, but here we are • Think “web friendly API” • RESTful APIs adhere to the semantics of HTTP to provide power with simplicity • URLs map to nouns in your system • HTTP verbs are significant: GET, POST, PUT, DELETE • Return payload might be XML, JSON, HTML • In short, and massively oversimplified: • RESTful APIs provide data that is easily consumed by a browser via your Ajax framework (XHR)
  • 52. RESTful Data APIs • Best Practice 10: complement your client side frameworks and API with server side RESTful data APIs. • Things to pay attention to: • Vibrant community discussions about proper REST • URL design is time consuming • Security concerns • Allow APIs to be disabled if customer chooses • Guard against CSRF attacks • Performance – paging through data sets • Providing batch update capabilities
  • 53. Case Study: WLP and MSFT Popfly • WLP has an embedded Content Management (CM) system • Traditionally, not very easy to surface this content in other applications • Programmatic integration required • Added RESTful APIs to WLP CM, and it opens up many possibilities • Microsoft Popfly is a hosted JavaScript application creation tool • RESTful APIs enables Popfly (and many other clients) to consume WLP content via XHR
  • 54. Single Origin Policy • Limits the reach of the XmlHttpRequest • Helps defend against malicious XSS attacks • There are ways around it, but... • Consider proxy solutions if your product requires XHRs to different network domains • Custom building a proxy • Rely on an existing proxy solution (Squid, etc) • Think carefully how to lock it down • Open proxies are dangerous • White lists, black lists • Defending against URL hacking • Best Practice 11: don’t build your own proxy
  • 55. Case Study: WLP WSRP Proxy • Not a proxy that helps with the Single Origin Policy, but an interesting case study • WSRP is an important portal standard • Long story short – requires implementers to build a proxy servlet • Issues encountered: • Securing the proxy servlet • Cookie management • Opaque vs. transparent URLs