SlideShare a Scribd company logo
SOA Development Using Javascript
          An alternative approach to web development

Carl Domingue
IBM Certified Solution Developer
carl.domingue@dsixe.com

http://dsixe-wpf.blogspot.com/
SOA Development Using Javascript


                         Typical web application: AJAX requests
      Browser            HTML fragments from servlet.
Asks servlet for HTML




                                                          Data


      Servlet               Web Service
Invokes WS and creates   Business logic and calls
   HTML for browser       to data repositories


                                                         Subsystem
SOA Development Using Javascript


                                   Javascript web application: AJAX requests
                Browser
          Asks servlet for HTML
                                   data directly from web service, manipulate
          Invokes web services     HTML using javascript.


HTML with templates                                                  Data


                 Servlet               Web Service
             Creates HTML for       Business logic and calls
                 browser             to data repositories


                                                                    Subsystem
SOA Development Using Javascript

Why do it this way?
• Serving HTML from a back end server to a browser is an
  antiquated design that predates modern browsers

• Cut out the middle man, more like developing
  traditional thick client applications

• Simplify AJAX – dynamic portions of user interface are
  built entirely with javascript, not with servlet

• Easier when implementing rich user interface which
  requires extensive manipulation of the DOM
SOA Development Using Javascript

Why do it this way?
• Improved performance - load distributed on many
  clients instead of single server

• Follows SOA approach
   • Presentation/UI layer – browser
   • Business logic – reusable web services
   • Data – database/subsystems

• Short learning curve, most developers know some
  javascript

• No need to render the whole page when user action is
  requested
SOA Development Using Javascript

Arguments for not using this approach

• Performance - dojo is too big/slow
   • Dojo is already being used in WPS 7 and has been
      load tested with excellent results, little additional
      overhead is required
   • Dojo classes are about 1k after compression

• No IDE for javascript
   • RAD offers extensive support for dojo, even custom
     classes

• Javascript is not an ideal language for enterprise
  development, easy to turn code into an unmaintainable
  mess
SOA Development Using Javascript

Arguments for not using this approach
• Security
   • Retrieve user id from web service using @Resource
     instead of request
   • Secure web service URL with group permissions at
     servlet level
   • Needs more thought

• Browser incompatibilities
   • Use dojo when possible to isolate code
   • Traditional approach faces same issues
SOA Development Using Javascript

Java bean class


package com.dsixe.evaluation.operations;

public class Evaluation {
private static int DAYS_TO_SUBMIT = 10; // ???

private   String   evaluationID = "";
private   String   teacherID;
private   String   startDate;
private   String   savedDate;
private   String   completedDate;
private   String   evaluatorName;
SOA Development Using Javascript

Javascript bean class

dojo.provide(“com.dsixe.evaluation.operations.Evaluation");
dojo.require(“com.dsixe._BeanBase");

dojo.declare(“com.dsixe.evaluation.operations.Evaluation",
com.dsixe._BeanBase, {

// By default all fields are private
_evaluationID : null,
_teacherID : null,
_startDate : null,                     Javascript generated with
_savedDate : null,                      Fast Code eclipse plugin
_completedDate : null,                  using custom template,
_evaluatorName : null,                   minimal hand coding
SOA Development Using Javascript


            UI.htm                             Controller.js




Dojo
                          Service proxy
                          Custom code




 Generated javascript   Generated javascript       Generated javascript
     bean class             bean class                 bean class
SOA Development Using Javascript
goGetSubjects(“600”, “02”, updateUISubjects);          Controller




goGetSubjects : function(schoolID, gradeID, callback){
     var params = new dojox.wire.ml.XmlElement("getSubjects");
     params.setPropertyValue("SchoolID", schoolID);
     params.setPropertyValue("GradeID", gradeID);
     var deferred = myService.getSubjects(params); Service proxy

      // ajax callback                                                                 Javascript bean
      deferred.addCallback(function(xmlData){                                               class
           var info = new com.dsixe.commonListService.objects.subject.Subject();
           var subjList = info.createFromXML(xmlData);
           callback(subjList);
      });
}




function updateUISubjects(/* com.dsixe.commonListService.objects.subject.Subject */oSubjects){
var selector = dojo.byId("subject");
selector.options.length = 0; // wipe out list         Controller

    for (var x=0; x < oSubjects.length; x++){
       var opt = new Option(oSubjects[x].getDeptDesc(), oSubjects[x].getDeptCode());
       selector.options[x] = opt;
    }
}
SOA Development Using Javascript
Using ibm_soap dojo module
     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:gcp="http://k12.gcps.ga.us/GCPSCommonListServices">
      <soapenv:Header/>
      <soapenv:Body>
        <gcp:getSubjects>
                                                                  Raw XML from SoapUI
          <SchoolID>600</SchoolID>
          <GradeID>02</GradeID>
        </gcp:getSubjects>
      </soapenv:Body>
     </soapenv:Envelope>


 myService = new ibm_soap.rpc.SoapService(gcpsCommonService);
 myService.serviceUrl = "http://localhost:81/MyListServices_WS/MyListServices";

 goGetSubjects : function(schoolID, gradeID, callback){
      var params = new dojox.wire.ml.XmlElement("getSubjects");                         Service proxy
      params.setPropertyValue("SchoolID", schoolID);
      params.setPropertyValue("GradeID", gradeID);
      var deferred = myService.getSubjects(params);

       // ajax callback
       deferred.addCallback(function(xmlData){
            var info = new k12.gcps.commonListService.objects.subject.Subject();
            var subjList = info.createFromXML(xmlData);
                                                                              Pass in XML
            callback(subjList);
                                       Array of Subject                        response
       });
 }                                                 classes

More Related Content

What's hot (20)

More Cache for Less Cash
More Cache for Less Cash
Michael Collier
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAX
Makarand Bhatambarekar
 
10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail
Michael Collier
 
Servlet sessions
Servlet sessions
vantinhkhuc
 
DirectToWeb 2.0
DirectToWeb 2.0
WO Community
 
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRoller
WO Community
 
MongoDB & NoSQL 101
MongoDB & NoSQL 101
Jollen Chen
 
Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
AoteaStudios
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Ajax
Ajax
gauravashq
 
Xml http request
Xml http request
Jayalakshmi Ayyappan
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
Rodrigo Cândido da Silva
 
Ajax and Jquery
Ajax and Jquery
People Strategists
 
Introduction to Node.js Platform
Introduction to Node.js Platform
Naresh Chintalcheru
 
jQuery Ajax
jQuery Ajax
Anand Kumar Rajana
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
Daniel Bryant
 
Microservices/dropwizard
Microservices/dropwizard
FKM Naimul Huda, PMP
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
Michał Orman
 
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
MongoDB
 
jsf2 Notes
jsf2 Notes
Rajiv Gupta
 
More Cache for Less Cash
More Cache for Less Cash
Michael Collier
 
10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail
Michael Collier
 
Servlet sessions
Servlet sessions
vantinhkhuc
 
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRoller
WO Community
 
MongoDB & NoSQL 101
MongoDB & NoSQL 101
Jollen Chen
 
Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
AoteaStudios
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
Rodrigo Cândido da Silva
 
Introduction to Node.js Platform
Introduction to Node.js Platform
Naresh Chintalcheru
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
Daniel Bryant
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
Michał Orman
 
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
MongoDB
 

Viewers also liked (20)

Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)
Tekno Paul
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the web
kriszyp
 
Services Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQL
Joe Stump
 
SOA And Cloud Computing
SOA And Cloud Computing
David Chou
 
The real makalah ( reaksi kimia dalam larutan air )
The real makalah ( reaksi kimia dalam larutan air )
Sylvester Saragih
 
Assignment 12
Assignment 12
debbie14
 
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Sylvester Saragih
 
2013 awards master (website)
2013 awards master (website)
TLMI
 
Presentacion Informatica
Presentacion Informatica
Adolfo Momparler Martínez
 
Un sencillo gesto con importantes consecuencias medio ambientales
Un sencillo gesto con importantes consecuencias medio ambientales
ecarbono18
 
Strenthening   students' language skills through technology
Strenthening   students' language skills through technology
Telly J Hajny
 
11 Telephone Phrases
11 Telephone Phrases
Balqis Thaahaveettil
 
100 104 9115-
100 104 9115-
Latif Ahmad
 
Omega City Plots on NH8
Omega City Plots on NH8
aurusconsulting
 
General info
General info
Najihah Mahmud
 
Media studies mark_scheme
Media studies mark_scheme
debbie14
 
Primero corporate presentation january 2015 update final
Primero corporate presentation january 2015 update final
primero_mining
 
Cesi meet 2012
Cesi meet 2012
Dermot Donnelly
 
Merry Christmas
Merry Christmas
hbwmike
 
Kaolin
Kaolin
Sylvester Saragih
 
Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)
Tekno Paul
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the web
kriszyp
 
Services Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQL
Joe Stump
 
SOA And Cloud Computing
SOA And Cloud Computing
David Chou
 
The real makalah ( reaksi kimia dalam larutan air )
The real makalah ( reaksi kimia dalam larutan air )
Sylvester Saragih
 
Assignment 12
Assignment 12
debbie14
 
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Sylvester Saragih
 
2013 awards master (website)
2013 awards master (website)
TLMI
 
Un sencillo gesto con importantes consecuencias medio ambientales
Un sencillo gesto con importantes consecuencias medio ambientales
ecarbono18
 
Strenthening   students' language skills through technology
Strenthening   students' language skills through technology
Telly J Hajny
 
Media studies mark_scheme
Media studies mark_scheme
debbie14
 
Primero corporate presentation january 2015 update final
Primero corporate presentation january 2015 update final
primero_mining
 
Merry Christmas
Merry Christmas
hbwmike
 
Ad

Similar to Soa development using javascript (20)

Building Real-World Dojo Web Applications
Building Real-World Dojo Web Applications
Andrew Ferrier
 
Rich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkit
alexklaeser
 
Ria with dojo
Ria with dojo
Tom Mahieu
 
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf
 
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SPTechCon
 
Lotusphere 2008 - Jumpstart 206 - Web Services Bootcamp
Lotusphere 2008 - Jumpstart 206 - Web Services Bootcamp
Bill Buchan
 
jmp206 - Lotus Domino Web Services Jumpstart
jmp206 - Lotus Domino Web Services Jumpstart
Bill Buchan
 
Brice Leblevennec @ FOWA Feb 07
Brice Leblevennec @ FOWA Feb 07
carsonsystems
 
JavaScript Library Overview
JavaScript Library Overview
jeresig
 
Take Your XPages Development to the Next Level
Take Your XPages Development to the Next Level
balassaitis
 
Nllug 2010 - Web-services bootcamp
Nllug 2010 - Web-services bootcamp
Bill Buchan
 
Nllug 2010-web-services
Nllug 2010-web-services
Bill Buchan
 
Roma introduction and concepts
Roma introduction and concepts
Luca Garulli
 
Google Dev Day2007
Google Dev Day2007
lucclaes
 
Woa. Reloaded
Woa. Reloaded
Emiliano Pecis
 
Admin2012 buchan web_services-v101
Admin2012 buchan web_services-v101
Bill Buchan
 
Life In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPages
Ulrich Krause
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
balassaitis
 
Application Services On The Web Sales Forcecom
Application Services On The Web Sales Forcecom
QConLondon2008
 
Dojo - from web page to web apps
Dojo - from web page to web apps
yoavrubin
 
Building Real-World Dojo Web Applications
Building Real-World Dojo Web Applications
Andrew Ferrier
 
Rich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkit
alexklaeser
 
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf
 
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SPTechCon
 
Lotusphere 2008 - Jumpstart 206 - Web Services Bootcamp
Lotusphere 2008 - Jumpstart 206 - Web Services Bootcamp
Bill Buchan
 
jmp206 - Lotus Domino Web Services Jumpstart
jmp206 - Lotus Domino Web Services Jumpstart
Bill Buchan
 
Brice Leblevennec @ FOWA Feb 07
Brice Leblevennec @ FOWA Feb 07
carsonsystems
 
JavaScript Library Overview
JavaScript Library Overview
jeresig
 
Take Your XPages Development to the Next Level
Take Your XPages Development to the Next Level
balassaitis
 
Nllug 2010 - Web-services bootcamp
Nllug 2010 - Web-services bootcamp
Bill Buchan
 
Nllug 2010-web-services
Nllug 2010-web-services
Bill Buchan
 
Roma introduction and concepts
Roma introduction and concepts
Luca Garulli
 
Google Dev Day2007
Google Dev Day2007
lucclaes
 
Admin2012 buchan web_services-v101
Admin2012 buchan web_services-v101
Bill Buchan
 
Life In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPages
Ulrich Krause
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
balassaitis
 
Application Services On The Web Sales Forcecom
Application Services On The Web Sales Forcecom
QConLondon2008
 
Dojo - from web page to web apps
Dojo - from web page to web apps
yoavrubin
 
Ad

Recently uploaded (20)

War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 

Soa development using javascript

  • 1. SOA Development Using Javascript An alternative approach to web development Carl Domingue IBM Certified Solution Developer [email protected] http://dsixe-wpf.blogspot.com/
  • 2. SOA Development Using Javascript Typical web application: AJAX requests Browser HTML fragments from servlet. Asks servlet for HTML Data Servlet Web Service Invokes WS and creates Business logic and calls HTML for browser to data repositories Subsystem
  • 3. SOA Development Using Javascript Javascript web application: AJAX requests Browser Asks servlet for HTML data directly from web service, manipulate Invokes web services HTML using javascript. HTML with templates Data Servlet Web Service Creates HTML for Business logic and calls browser to data repositories Subsystem
  • 4. SOA Development Using Javascript Why do it this way? • Serving HTML from a back end server to a browser is an antiquated design that predates modern browsers • Cut out the middle man, more like developing traditional thick client applications • Simplify AJAX – dynamic portions of user interface are built entirely with javascript, not with servlet • Easier when implementing rich user interface which requires extensive manipulation of the DOM
  • 5. SOA Development Using Javascript Why do it this way? • Improved performance - load distributed on many clients instead of single server • Follows SOA approach • Presentation/UI layer – browser • Business logic – reusable web services • Data – database/subsystems • Short learning curve, most developers know some javascript • No need to render the whole page when user action is requested
  • 6. SOA Development Using Javascript Arguments for not using this approach • Performance - dojo is too big/slow • Dojo is already being used in WPS 7 and has been load tested with excellent results, little additional overhead is required • Dojo classes are about 1k after compression • No IDE for javascript • RAD offers extensive support for dojo, even custom classes • Javascript is not an ideal language for enterprise development, easy to turn code into an unmaintainable mess
  • 7. SOA Development Using Javascript Arguments for not using this approach • Security • Retrieve user id from web service using @Resource instead of request • Secure web service URL with group permissions at servlet level • Needs more thought • Browser incompatibilities • Use dojo when possible to isolate code • Traditional approach faces same issues
  • 8. SOA Development Using Javascript Java bean class package com.dsixe.evaluation.operations; public class Evaluation { private static int DAYS_TO_SUBMIT = 10; // ??? private String evaluationID = ""; private String teacherID; private String startDate; private String savedDate; private String completedDate; private String evaluatorName;
  • 9. SOA Development Using Javascript Javascript bean class dojo.provide(“com.dsixe.evaluation.operations.Evaluation"); dojo.require(“com.dsixe._BeanBase"); dojo.declare(“com.dsixe.evaluation.operations.Evaluation", com.dsixe._BeanBase, { // By default all fields are private _evaluationID : null, _teacherID : null, _startDate : null, Javascript generated with _savedDate : null, Fast Code eclipse plugin _completedDate : null, using custom template, _evaluatorName : null, minimal hand coding
  • 10. SOA Development Using Javascript UI.htm Controller.js Dojo Service proxy Custom code Generated javascript Generated javascript Generated javascript bean class bean class bean class
  • 11. SOA Development Using Javascript goGetSubjects(“600”, “02”, updateUISubjects); Controller goGetSubjects : function(schoolID, gradeID, callback){ var params = new dojox.wire.ml.XmlElement("getSubjects"); params.setPropertyValue("SchoolID", schoolID); params.setPropertyValue("GradeID", gradeID); var deferred = myService.getSubjects(params); Service proxy // ajax callback Javascript bean deferred.addCallback(function(xmlData){ class var info = new com.dsixe.commonListService.objects.subject.Subject(); var subjList = info.createFromXML(xmlData); callback(subjList); }); } function updateUISubjects(/* com.dsixe.commonListService.objects.subject.Subject */oSubjects){ var selector = dojo.byId("subject"); selector.options.length = 0; // wipe out list Controller for (var x=0; x < oSubjects.length; x++){ var opt = new Option(oSubjects[x].getDeptDesc(), oSubjects[x].getDeptCode()); selector.options[x] = opt; } }
  • 12. SOA Development Using Javascript Using ibm_soap dojo module <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gcp="http://k12.gcps.ga.us/GCPSCommonListServices"> <soapenv:Header/> <soapenv:Body> <gcp:getSubjects> Raw XML from SoapUI <SchoolID>600</SchoolID> <GradeID>02</GradeID> </gcp:getSubjects> </soapenv:Body> </soapenv:Envelope> myService = new ibm_soap.rpc.SoapService(gcpsCommonService); myService.serviceUrl = "http://localhost:81/MyListServices_WS/MyListServices"; goGetSubjects : function(schoolID, gradeID, callback){ var params = new dojox.wire.ml.XmlElement("getSubjects"); Service proxy params.setPropertyValue("SchoolID", schoolID); params.setPropertyValue("GradeID", gradeID); var deferred = myService.getSubjects(params); // ajax callback deferred.addCallback(function(xmlData){ var info = new k12.gcps.commonListService.objects.subject.Subject(); var subjList = info.createFromXML(xmlData); Pass in XML callback(subjList); Array of Subject response }); } classes