SlideShare une entreprise Scribd logo
1  sur  18
Teaching Old JavaScript New Tricks Experiences building a server-side JavaScript framework
Old JavaScript Over 15 years old Implemented everywhere: Browsers, Web Servers, Scripting, Phones Server Implementations (Old): Netscape, Rhino (JVM), Microsft IIS Old JavaScript feels “old” Namespacing, polluted globals, poor inheritance, not very modular.. Those platforms don’t give you much
New and Modern Tricks Modules, Namespacing “Separation of Concerns” Model, View, Controller (MVC): Request Routing (Controller) Object Relational Mapping (Model) Templating (Views) Binary, UTF-8, JSON, Callbacks Concise and Elegant
Microsoft Javascript JScript on IIS (ASP) Not modern or cool, but old, stable and Windows hosting can be found everywhere JScript.dll updated with IE (up to 8) so it’s not ancient Not JScript.NET, not JIT, but quick enough (compared to other interpreters of it’s era)
Why JS on the Server Code re-use, sure.. Real strength: Heaps of stuff already written and tested: Parsers, Crypto, ORM, Testing, etc. (I’ve even seen a Linux Emulator) Expressive and Powerful: Callbacks/handlers, Query Iteration, flexible inheritance, extendibility (override built-in methods) Poor dates, formatting, etc. But easily fixed.
The Framework Event Binding Bind to the “ready” event to attach controller code / route handlers Routes: Sinatra-style; named parameters Modules: load modules similar to common-JS Templating: compile your data in the route handler and then use template module to render your view Data Models: create your models, validation, methods and relationships Clean separation of code, helpful, intuitive interface
Into the Code Hello World:
Named Parameters Access to URL params Automatic JSON Output
Using Libraries Similar to require() but uses lib()
Application Structure /app /config /controllers /models /system /views /assets Public files (css, images, etc)
Now the Cool Stuff ActiveRecord for JavaScript Powerful modeling, no writing SQL HTML Parser, DOM implementation and jQuery on the Server Read html files from file system and populate with dynamic content Webpage scraping with ease Node.js based dev-server Uses windows scripting host behind Node to use framework without Schema-less doc-store, Binary, Crypto, Advance language/full-text-search features, Persistent sessions with namespacing, etc.
ActiveRecord Models are defined inside app/models Ported from Aptana’sActiveJS
Model Validation and Relationships hasOne, hasMany, belongsTo validatesPresenceOf, validatesUniquenessOf, validatesLengthOf, etc Custom Validation functions and getter Methods
Creating, Updating and Finding See Code
jQuery Server Side DOM See Code
Weaknesses and Future Development Needs better testing library (qunit) Debugging could be easier SQLite Adapter almost Working on adapters for other Server JS platforms (Apache + v8, Rhino on JVM) Good abstraction layers makes it not too closely coupled to current platform
Wrapping Up What can be learned from Do It Yourself Not Re-inventing the Wheel Re-using other open-source code Github: http://github.com/sstur/aspjs
Teaching old java script new tricks

Contenu connexe

Tendances

Increase automation to rest
Increase automation to restIncrease automation to rest
Increase automation to restvodQA
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCAnton Krasnoshchok
 
Web testing with selenium and by quontra solutions
Web testing with selenium and  by quontra solutionsWeb testing with selenium and  by quontra solutions
Web testing with selenium and by quontra solutionsQUONTRASOLUTIONS
 
React js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREReact js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREnearlearn
 
React js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREReact js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREnearlearn
 
Spring framework 3.2 > 4.0 — themes and trends
Spring framework 3.2 > 4.0 — themes and trendsSpring framework 3.2 > 4.0 — themes and trends
Spring framework 3.2 > 4.0 — themes and trendsArawn Park
 
Introduction To JavaScript Ajax
Introduction To JavaScript AjaxIntroduction To JavaScript Ajax
Introduction To JavaScript AjaxReema
 
Ch. 13 filters and wrappers
Ch. 13 filters and wrappersCh. 13 filters and wrappers
Ch. 13 filters and wrappersManolis Vavalis
 
20101220架構討論
20101220架構討論20101220架構討論
20101220架構討論Kyle Lin
 
MVC with Zend Framework
MVC with Zend FrameworkMVC with Zend Framework
MVC with Zend Frameworkwebholics
 

Tendances (20)

Rest api with node js and express
Rest api with node js and expressRest api with node js and express
Rest api with node js and express
 
Beginning In J2EE
Beginning In J2EEBeginning In J2EE
Beginning In J2EE
 
Increase automation to rest
Increase automation to restIncrease automation to rest
Increase automation to rest
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
003. ReactJS basic
003. ReactJS basic003. ReactJS basic
003. ReactJS basic
 
Ember Data
Ember DataEmber Data
Ember Data
 
Web testing with selenium and by quontra solutions
Web testing with selenium and  by quontra solutionsWeb testing with selenium and  by quontra solutions
Web testing with selenium and by quontra solutions
 
Zend framework 02 - mvc
Zend framework 02 - mvcZend framework 02 - mvc
Zend framework 02 - mvc
 
Introduction to Node.JS
Introduction to Node.JSIntroduction to Node.JS
Introduction to Node.JS
 
Ch. 11 deploying
Ch. 11 deployingCh. 11 deploying
Ch. 11 deploying
 
React js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREReact js TRAINING IN BANGALORE
React js TRAINING IN BANGALORE
 
React js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREReact js TRAINING IN BANGALORE
React js TRAINING IN BANGALORE
 
Spring framework 3.2 > 4.0 — themes and trends
Spring framework 3.2 > 4.0 — themes and trendsSpring framework 3.2 > 4.0 — themes and trends
Spring framework 3.2 > 4.0 — themes and trends
 
Nodejs + Rails
Nodejs + RailsNodejs + Rails
Nodejs + Rails
 
Introduction To JavaScript Ajax
Introduction To JavaScript AjaxIntroduction To JavaScript Ajax
Introduction To JavaScript Ajax
 
Ch. 13 filters and wrappers
Ch. 13 filters and wrappersCh. 13 filters and wrappers
Ch. 13 filters and wrappers
 
Whats New In Spring 3.0 ?
Whats New In Spring 3.0 ?Whats New In Spring 3.0 ?
Whats New In Spring 3.0 ?
 
20101220架構討論
20101220架構討論20101220架構討論
20101220架構討論
 
MVC with Zend Framework
MVC with Zend FrameworkMVC with Zend Framework
MVC with Zend Framework
 
Web Workers
Web WorkersWeb Workers
Web Workers
 

Similaire à Teaching old java script new tricks

Full stack Java Developer
Full stack Java DeveloperFull stack Java Developer
Full stack Java DeveloperMdHasan872214
 
Sofea and SOUI - Web future without web frameworks
Sofea and SOUI - Web future without web frameworksSofea and SOUI - Web future without web frameworks
Sofea and SOUI - Web future without web frameworksAndré Neubauer
 
Javascript Client & Server Architectures
Javascript Client & Server ArchitecturesJavascript Client & Server Architectures
Javascript Client & Server ArchitecturesPedro Melo Pereira
 
Server-side Web development via Ruby on Rails
Server-side Web development via Ruby on RailsServer-side Web development via Ruby on Rails
Server-side Web development via Ruby on Railsg3ppy
 
Ram Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar - Sr. Certified Mule ESB Integration DeveloperRam Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar - Sr. Certified Mule ESB Integration DeveloperRam Kumar
 
Beginners' guide to Ruby on Rails
Beginners' guide to Ruby on RailsBeginners' guide to Ruby on Rails
Beginners' guide to Ruby on RailsVictor Porof
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
 
Sid K
Sid KSid K
Sid KSid K
 
Rajiv ranjan resume-us
Rajiv ranjan  resume-usRajiv ranjan  resume-us
Rajiv ranjan resume-usRajiv Ranjan
 
Node PDX: Intro to Sails.js
Node PDX: Intro to Sails.jsNode PDX: Intro to Sails.js
Node PDX: Intro to Sails.jsMike McNeil
 
Crash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesUdita Plaha
 
Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh Dasari
 
Resume - Shashesh Silwal
Resume - Shashesh SilwalResume - Shashesh Silwal
Resume - Shashesh SilwalShashesh Silwal
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbonezonathen
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jibanJibanananda Sana
 

Similaire à Teaching old java script new tricks (20)

Full stack Java Developer
Full stack Java DeveloperFull stack Java Developer
Full stack Java Developer
 
Sofea and SOUI - Web future without web frameworks
Sofea and SOUI - Web future without web frameworksSofea and SOUI - Web future without web frameworks
Sofea and SOUI - Web future without web frameworks
 
Ranjith_Reddy Yallampalli Resume
Ranjith_Reddy Yallampalli ResumeRanjith_Reddy Yallampalli Resume
Ranjith_Reddy Yallampalli Resume
 
Javascript Client & Server Architectures
Javascript Client & Server ArchitecturesJavascript Client & Server Architectures
Javascript Client & Server Architectures
 
Server-side Web development via Ruby on Rails
Server-side Web development via Ruby on RailsServer-side Web development via Ruby on Rails
Server-side Web development via Ruby on Rails
 
Ram Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar - Sr. Certified Mule ESB Integration DeveloperRam Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar - Sr. Certified Mule ESB Integration Developer
 
Beginners' guide to Ruby on Rails
Beginners' guide to Ruby on RailsBeginners' guide to Ruby on Rails
Beginners' guide to Ruby on Rails
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
Vishnu(java)
Vishnu(java)Vishnu(java)
Vishnu(java)
 
Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
 
Sid K
Sid KSid K
Sid K
 
Bhargav
BhargavBhargav
Bhargav
 
Rajiv ranjan resume-us
Rajiv ranjan  resume-usRajiv ranjan  resume-us
Rajiv ranjan resume-us
 
Node PDX: Intro to Sails.js
Node PDX: Intro to Sails.jsNode PDX: Intro to Sails.js
Node PDX: Intro to Sails.js
 
Crash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails Slides
 
Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead Nitesh_Sr._Java_developer_Lead
Nitesh_Sr._Java_developer_Lead
 
Resume - Shashesh Silwal
Resume - Shashesh SilwalResume - Shashesh Silwal
Resume - Shashesh Silwal
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbone
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Dernier (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Teaching old java script new tricks

  • 1. Teaching Old JavaScript New Tricks Experiences building a server-side JavaScript framework
  • 2. Old JavaScript Over 15 years old Implemented everywhere: Browsers, Web Servers, Scripting, Phones Server Implementations (Old): Netscape, Rhino (JVM), Microsft IIS Old JavaScript feels “old” Namespacing, polluted globals, poor inheritance, not very modular.. Those platforms don’t give you much
  • 3. New and Modern Tricks Modules, Namespacing “Separation of Concerns” Model, View, Controller (MVC): Request Routing (Controller) Object Relational Mapping (Model) Templating (Views) Binary, UTF-8, JSON, Callbacks Concise and Elegant
  • 4. Microsoft Javascript JScript on IIS (ASP) Not modern or cool, but old, stable and Windows hosting can be found everywhere JScript.dll updated with IE (up to 8) so it’s not ancient Not JScript.NET, not JIT, but quick enough (compared to other interpreters of it’s era)
  • 5. Why JS on the Server Code re-use, sure.. Real strength: Heaps of stuff already written and tested: Parsers, Crypto, ORM, Testing, etc. (I’ve even seen a Linux Emulator) Expressive and Powerful: Callbacks/handlers, Query Iteration, flexible inheritance, extendibility (override built-in methods) Poor dates, formatting, etc. But easily fixed.
  • 6. The Framework Event Binding Bind to the “ready” event to attach controller code / route handlers Routes: Sinatra-style; named parameters Modules: load modules similar to common-JS Templating: compile your data in the route handler and then use template module to render your view Data Models: create your models, validation, methods and relationships Clean separation of code, helpful, intuitive interface
  • 7. Into the Code Hello World:
  • 8. Named Parameters Access to URL params Automatic JSON Output
  • 9. Using Libraries Similar to require() but uses lib()
  • 10. Application Structure /app /config /controllers /models /system /views /assets Public files (css, images, etc)
  • 11. Now the Cool Stuff ActiveRecord for JavaScript Powerful modeling, no writing SQL HTML Parser, DOM implementation and jQuery on the Server Read html files from file system and populate with dynamic content Webpage scraping with ease Node.js based dev-server Uses windows scripting host behind Node to use framework without Schema-less doc-store, Binary, Crypto, Advance language/full-text-search features, Persistent sessions with namespacing, etc.
  • 12. ActiveRecord Models are defined inside app/models Ported from Aptana’sActiveJS
  • 13. Model Validation and Relationships hasOne, hasMany, belongsTo validatesPresenceOf, validatesUniquenessOf, validatesLengthOf, etc Custom Validation functions and getter Methods
  • 14. Creating, Updating and Finding See Code
  • 15. jQuery Server Side DOM See Code
  • 16. Weaknesses and Future Development Needs better testing library (qunit) Debugging could be easier SQLite Adapter almost Working on adapters for other Server JS platforms (Apache + v8, Rhino on JVM) Good abstraction layers makes it not too closely coupled to current platform
  • 17. Wrapping Up What can be learned from Do It Yourself Not Re-inventing the Wheel Re-using other open-source code Github: http://github.com/sstur/aspjs