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

PDF
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
Rodrigo Cândido da Silva
 
KEY
Offline Html5 3days
Shumpei Shiraishi
 
PDF
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis
 
PDF
MeteorJS Introduction
Nitya Narasimhan
 
PPTX
e-suap - client technologies- english version
Sabino Labarile
 
PDF
Simplify AJAX using jQuery
Siva Arunachalam
 
PDF
Suportando Aplicações Multi-tenancy com Java EE
Rodrigo Cândido da Silva
 
PPTX
Hdv309 - Real World Sandboxed Solutions
woutervugt
 
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
Rodrigo Cândido da Silva
 
Offline Html5 3days
Shumpei Shiraishi
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis
 
MeteorJS Introduction
Nitya Narasimhan
 
e-suap - client technologies- english version
Sabino Labarile
 
Simplify AJAX using jQuery
Siva Arunachalam
 
Suportando Aplicações Multi-tenancy com Java EE
Rodrigo Cândido da Silva
 
Hdv309 - Real World Sandboxed Solutions
woutervugt
 

What's hot (20)

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

Viewers also liked (20)

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

Similar to Soa development using javascript (20)

PDF
Integrating React.js Into a PHP Application
Andrew Rota
 
ODP
Javascript frameworks: Backbone.js
Soós Gábor
 
PDF
Building Applications Using Ajax
s_pradeep
 
PDF
netbeans
tutorialsruby
 
PDF
netbeans
tutorialsruby
 
PPTX
JavaScript on the server - Node.js
Rody Middelkoop
 
PDF
11-DWR-and-JQuery
tutorialsruby
 
PDF
11-DWR-and-JQuery
tutorialsruby
 
PPTX
Liferay (DXP) 7 Tech Meetup for Developers
Azilen Technologies Pvt. Ltd.
 
PPTX
Jquery beltranhomewrok
Catherine Beltran
 
PPTX
Jquery beltranhomewrok
Catherine Beltran
 
KEY
[Coscup 2012] JavascriptMVC
Alive Kuo
 
ODP
Ajax3
Brian Moschel
 
PPTX
Serverless archtiectures
Iegor Fadieiev
 
PPTX
JavaScript front end performance optimizations
Chris Love
 
PPT
Using Java to implement SOAP Web Services: JAX-WS
Katrien Verbert
 
PDF
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
SPTechCon
 
PDF
Apache Wicket Web Framework
Luther Baker
 
ODP
Groovy & Grails eXchange 2012 vert.x presentation
Stuart (Pid) Williams
 
PPTX
Advance Java Topics (J2EE)
slire
 
Integrating React.js Into a PHP Application
Andrew Rota
 
Javascript frameworks: Backbone.js
Soós Gábor
 
Building Applications Using Ajax
s_pradeep
 
netbeans
tutorialsruby
 
netbeans
tutorialsruby
 
JavaScript on the server - Node.js
Rody Middelkoop
 
11-DWR-and-JQuery
tutorialsruby
 
11-DWR-and-JQuery
tutorialsruby
 
Liferay (DXP) 7 Tech Meetup for Developers
Azilen Technologies Pvt. Ltd.
 
Jquery beltranhomewrok
Catherine Beltran
 
Jquery beltranhomewrok
Catherine Beltran
 
[Coscup 2012] JavascriptMVC
Alive Kuo
 
Serverless archtiectures
Iegor Fadieiev
 
JavaScript front end performance optimizations
Chris Love
 
Using Java to implement SOAP Web Services: JAX-WS
Katrien Verbert
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
SPTechCon
 
Apache Wicket Web Framework
Luther Baker
 
Groovy & Grails eXchange 2012 vert.x presentation
Stuart (Pid) Williams
 
Advance Java Topics (J2EE)
slire
 

Recently uploaded (20)

PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
This slide provides an overview Technology
mineshkharadi333
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Doc9.....................................
SofiaCollazos
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 

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