Your SlideShare is downloading. ×
Java script everywhere
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Java script everywhere

212
views

Published on

"JavaScript Everywhere: Backend to Web and to Mobile Apps" Slide site on WSO2Con

"JavaScript Everywhere: Backend to Web and to Mobile Apps" Slide site on WSO2Con

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
212
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. JavaScript Everywhere: Backend to Web and to Mobile Apps Ruchira Wageesha & Madhuka Udantha WSO2 Inc.
  • 2. Path • Why JavaScript • We will mainly discuss about JaggeryJS • Jaggery APIs • Start with a high level discussion • Then Hands On
  • 3. Reaching Out the Last Mile • Users no longer accept average user experience • Users Interfaces (UIs) covers the last mile • Often decides the success and how much it will integrate with the user’s lives.
  • 4. Evolution of Web Applications
  • 5. Evolution of Web Applications
  • 6. Web Apps •Mobiles •Internet /networks •Desktops/PC •Portal Devices •Tabs/Tablets
  • 7. Types of Web Application • Client side (Static HTML) • Client driven, blocking (old Forms based submit ) • Client driven, non blocking (AJAX) • Client and server driven, non-blocking (web sockets)
  • 8. User Interface
  • 9. Revolution of UI in Web Apps • Javascript has become the defacto technology • Variuos Javascript libaries • Supported by all browsers • Thanks goe to •Web 2.0 •HTML5 • No longer simplistic applications • Widely used
  • 10. Javascript end to end?
  • 11. Javascript end to end? (Contd.) ● No complexities in data binding (UI to Business logic thanks to JSON) ● No serialization / de-serialization ● Rich space with many common javascript libraries ● Rapid application development ● Resourcful ● No compiling, making & building
  • 12. What my options • NodeJS - o Based on Google V8 JS engine o Event driven, non-blocking processing • Jaggery o Provided traditional development experience like in PHP/JSP o De-facto framework for all WSO2 user facing applications
  • 13. https://github.com/wso2/jaggery
  • 14. Introduction to Jaggery • Like JSP/ PHP, but user writes code completely in javascript (Data access / Business Logic / UI) • Runs as a Web app (e.g. tomcat) • Runs on top of Java • Provides very close integration with WSO2 Products (e.g. Users, Web service calls, access to the registry, access OSGI services etc. )
  • 15. First Look {jaggery.js} Nothing complex If (you are familiar with WSO2) { server runtimes, it’s the same thing } Else { extract the zip, run sh /bin/server.sh/.bat } http://dist.wso2.org/snapshots/maven2/org/jaggeryjs/jaggery/0.9.0-SNAPSHOT/jaggery-0.9.0-20140321.143805-240.zip
  • 16. Hello Jaggery!! • Most straight forward Sample • Open up a text editor • Create {JAGGERY_HOME}/apps/carshop/hello.jag • Browser to :http://localhost:9763/carshop/hello.jag
  • 17. Out Put Syntax
  • 18. Data Storage • Create a DB connection (DB config) • Perform CRUD operations • Results sent as json
  • 19. Using Databases and Registry • <jaggery-home>carbonrepositorycomponentslib • Drivers for DB • MetadataStore collection Resource
  • 20. Process APIs • Server details
  • 21. RESTful Service URIMatcher "urlMappings": [{ "url": "/sample/uri-mapping", "path": "/index.jag“ }]
  • 22. RESTful Service (application.serve())
  • 23. RESTful Service - router https://github.com/splinter/jaggery-pipe
  • 24. Demo • Use-case?
  • 25. Demo
  • 26. Demo REST service call
  • 27. Calling out a SOAP Service
  • 28. Demo SOAP service invoke
  • 29. HTML5 and WebSockets
  • 30. Demo Web Socket
  • 31. Including 3rd party js libraries • {{ mustache }} • Handlebars.js • base64 js
  • 32. Java and Jaggery • Writing HostObject for Jaggery • Java Class accessing http://madhukaudantha.blogspot.com/2014/02/writing-hostobject-for-jaggery.html
  • 33. Configuration
  • 34. Configuration (Cont.)
  • 35. Visualization
  • 36. WSO2 and Jaggery
  • 37. WSO2 and Jaggery
  • 38. Develop RESTful Service & Routering • URL Mapping Using inbuilt jaggery.conf • Front End Controller Concept Application.serve() var pipe=require('pipe'); var router=require('router'); pipe.plug(router);
  • 39. Presentation https://github.com/wso2/caramel
  • 40. If not test? https://github.com/Madhuka/jaggery-test-framewrok
  • 41. Some utilities • Carbon module • File API • Email API • Feed API • oauth • uuid https://github.com/wso2/jaggery-extensions
  • 42. Summary • Why js • Jaggery.js • Jaggery API • Router • Jaggery-test • Finally….
  • 43. References • jaggeryjs.org • wso2.com • https://github.com/wso2/caramel • https://github.com/splinter/jaggery-pipe • https://github.com/Madhuka/jaggery-test-framewrok • http://ruchirawageesha.blogspot.com/ • http://madhukaudantha.blogspot.com/
  • 44. QA
  • 45. Thank you