SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

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.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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 Processorsdebabhi2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
🐬 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
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
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...Drew Madelung
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
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.pdfsudhanshuwaghmare1
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Último (20)

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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

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