SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Structured	
  Web	
  Apps	
  
Tim	
  Tian	
  
Outline	
  
•  Front	
  End	
  Development	
  Challenges	
  
•  JavaScript	
  Frameworks	
  
•  New	
  Languages	
  
2	
  
Frond	
  End	
  Development	
  Challenges	
  
•  JavaScript,	
  DOM	
  and	
  BOM	
  NaFve	
  API	
  
•  Web	
  App	
  Infrastructure	
  
•  Rich	
  ApplicaFon	
  Architecture	
  
•  UI	
  InteracFon	
  
•  Development	
  Toolchain	
  
3	
  
NaFve	
  API	
  Problems	
  (1/2)	
  
•  Hard	
  to	
  Use	
  
•  Browser	
  CompaFbility	
  Issues	
  
4	
  
NaFve	
  API	
  Problems	
  (2/2)	
  
•  Early	
  Frameworks	
  (e.g.	
  jQuery)	
  all	
  focus	
  on	
  fixing	
  these	
  
issues.	
  
–  DOM	
  tree	
  query	
  and	
  manipulaFon	
  
–  DOM	
  event	
  handling	
  
–  Ajax	
  
•  Simplify	
  XMLH[pRequest	
  API	
  
•  Enhance	
  it’s	
  semanFc	
  (Deferred	
  &	
  Promises)	
  
–  JavaScript	
  Language	
  Enhancements	
  
•  UFlity	
  Libraries.	
  e.g.	
  underscore.Js,	
  Lo-­‐Dash	
  
•  HTML	
  5,	
  ECMAScript	
  5,	
  ECMAScript	
  Harmony	
  and	
  CSS3	
  
–  New	
  APIs	
  are	
  eliminaFng	
  the	
  necessity	
  of	
  these	
  frameworks,	
  
e.g.	
  document.querySelector,	
  CSS3	
  animaFons	
  
5	
  
Web	
  App	
  Infrastructure	
  (1/4)	
  
•  Modularity	
  
– Problems	
  
•  Avoid	
  Global	
  Variables	
  ConflicFng	
  
•  Dependency	
  Management	
  
•  Build	
  and	
  Package	
  
– Standards	
  
•  AMD	
  (Asynchronous	
  Module	
  DefiniFon)	
  
–  RequireJS,	
  Dojo	
  
•  CommonJS	
  
–  Node.js	
  
6	
  
Web	
  App	
  Infrastructure	
  (2/4)	
  
•  Object-­‐Oriented	
  Programming	
  
–  JavaScript	
  is	
  a	
  prototype-­‐based	
  language	
  
•  simulate	
  many	
  class-­‐based	
  features	
  
–  Frameworks	
  
•  YUI	
  extend	
  
•  MooTools	
  Class	
  
•  Dojo	
  
•  Prototype	
  
•  Backbone.Model.extend	
  
•  etc.	
  
–  Reference	
  
•  Douglas	
  Crockford	
  –	
  Classical	
  Inheritance	
  in	
  JavaScript	
  
•  John	
  Resig	
  –	
  Simple	
  JavaScript	
  Inheritance	
  
•  Nicholas	
  Zakas	
  –	
  Does	
  JavaScript	
  need	
  classes?	
  
7	
  
Web	
  App	
  Infrastructure	
  (3/4)	
  
•  Customized	
  Event	
  System	
  
– Event	
  Driven	
  Architecture	
  
– Design	
  Pa[erns	
  
•  Pub-­‐Sub	
  
•  Observer	
  
•  Mediator	
  
– Example	
  
•  Dojo	
  Pub-­‐Sub	
  
•  Jquery	
  trigger	
  /	
  on	
  
8	
  
Web	
  App	
  Infrastructure	
  (4/4)	
  
•  Widget	
  
– Widget	
  DefiniFon	
  
– Inter-­‐widget	
  CommunicaFon	
  
•  e.g.	
  Tuplespace	
  for	
  inter-­‐widget	
  communicaFon	
  
–  Sheng	
  Tian	
  
– Example	
  
•  Dojo	
  gadget	
  
•  jQuery	
  UI	
  widget	
  
9	
  
Rich	
  ApplicaFon	
  Architecture	
  (1/2)	
  
•  SeparaFon	
  of	
  UI,	
  Business	
  Logic,	
  and	
  Data	
  
ManipulaFon	
  
–  MV*	
  Pa[erns	
  
•  MVC	
  Design	
  Pa[ern	
  
•  MVP	
  (Model-­‐View-­‐Presenter)	
  
•  MVVM	
  (Model-­‐View-­‐ViewModel)	
  
•  Reference	
  
–  Addy	
  Osmani	
  -­‐	
  
Journey	
  Through	
  The	
  JavaScript	
  MVC	
  Jungle	
  
10	
  
Rich	
  ApplicaFon	
  Architecture	
  (2/2)	
  
•  Data	
  Binding	
  
–  Bind	
  the	
  data	
  with	
  UI	
  
•  Data	
  SynchronizaFon	
  
–  e.g.	
  Backbone.Model.sync	
  
•  Template	
  Rendering	
  
–  Mustache	
  
–  Underscore	
  Template	
  
–  Dojo	
  Django	
  Template	
  
•  Router,	
  History	
  Management	
  
–  Single	
  Page	
  ApplicaFon,	
  e.g.	
  YouPost	
  
•  Backward	
  /	
  Forward	
  Bu[on,	
  e.g.	
  Backbone.Route	
  /	
  
Backbone.History	
  
11	
  
UI	
  InteracFon	
  
•  Effects	
  and	
  AnimaFons	
  
– e.g.	
  jQuery	
  effects	
  
– CSS3	
  animaFons	
  
•  UI	
  Widgets	
  
– e.g.	
  YUI,	
  Dojo,	
  ExtJs,	
  jQueryUI	
  
•  Drawing	
  
– HTML5	
  Canvas	
  2D,	
  Canvas	
  WebGL	
  3D	
  
– SVG	
  /	
  VML,	
  e.g.	
  Raphael,	
  D3.js	
  
12	
  
Development	
  Toolchain	
  (1/3)	
  
•  JavaScript	
  Build	
  and	
  OpFmizer	
  
– Google	
  Closure	
  Library	
  
– RequireJS	
  
– Dojo,	
  YUI,	
  etc.	
  
•  Task	
  Manager	
  
– Grunt.js	
  
– Jake	
  
13	
  
Development	
  Toolchain	
  (2/3)	
  
•  Package	
  Management	
  (Like	
  Maven	
  in	
  Java)	
  
– Twi[er	
  Bower	
  
– Ender.js	
  (open	
  module	
  JavaScript	
  framework)	
  
– Volo.js	
  
– Component	
  
14	
  
Development	
  Toolchain	
  (3/3)	
  
•  JavaScript	
  Unit	
  Test	
  Tools	
  
– QUnit	
  	
  –	
  An	
  easy-­‐to-­‐use	
  JS	
  unit	
  tesFng	
  framework	
  
– Jasmine	
  –	
  A	
  behavior-­‐driven	
  development	
  
framework	
  
– Mocha	
  –	
  A	
  feature-­‐rich	
  JS	
  test	
  framwork	
  running	
  
on	
  node	
  and	
  the	
  browser	
  
•  Browser	
  AutomaFon	
  Test	
  	
  
– Selenium	
  IDE	
  &	
  WebDriver	
  
– Dojo	
  ObjecFve	
  Harness	
  (DOH)	
  
15	
  
JavaScript	
  Frameworks	
  Summary	
  (1/3)	
  
•  API	
  Wrappers	
  Frameworks	
  
–  Example	
  
•  jQuery	
  
•  MooTools	
  
–  Pros	
  
•  Lighweight	
  
•  Easy	
  to	
  use	
  
–  Cos	
  
•  Have	
  to	
  spend	
  too	
  much	
  Fme	
  on	
  choosing	
  other	
  frameworks	
  
•  May	
  cause	
  bad	
  code	
  quality	
  
16	
  
JavaScript	
  Frameworks	
  Summary	
  	
  (2/3)	
  
•  Full-­‐Featured	
  Frameworks	
  
–  Examples	
  
•  Dojo	
  
•  YUI	
  
•  ExtJs	
  
•  Google	
  Closure	
  Library	
  
–  Pros	
  
•  Good	
  code	
  quality	
  
•  Well-­‐documented	
  
•  All	
  covered,	
  usually	
  no	
  third	
  party	
  libraries	
  required	
  
–  Cons	
  
•  Heavyweight	
  
•  Steep	
  Learning	
  Curve	
  
17	
  
JavaScript	
  Frameworks	
  Summary	
  	
  (3/3)	
  
•  Single	
  Page	
  ApplicaFon	
  
–  Example	
  
•  MVC:	
  Ember.js,	
  AngularJS	
  
•  MVP:	
  Backbone.js	
  
•  MVVM:	
  Knockout.js	
  
•  Event	
  Driven:	
  Twi[er	
  Flight	
  
–  Pros	
  
•  Less	
  server	
  requests	
  
•  Be[er	
  UI	
  experience	
  
•  Specially	
  suit	
  for	
  rich	
  /	
  complex	
  client	
  applicaFon	
  
–  Problems	
  
•  Architecture	
  style	
  
–  MVC,	
  MVP	
  or	
  MVVM	
  
•  Intrusive	
  and	
  exclusive	
  Frameworks	
  
–  Intrusive	
  and	
  exclusive:	
  Ember.js	
  and	
  AngularJS,	
  Twi[er	
  Flight	
  
–  Non-­‐intrusive:	
  Backbone.js	
  and	
  Knockout.js	
  
•  View	
  
–  String	
  based	
  template	
  (Ember.js,	
  Backbone.js)	
  
–  DOM	
  enhancement	
  (AngularJS,	
  Knockout.js)	
  
18	
  
New	
  Languages	
  
•  TypeScript,	
  by	
  Microsoq	
  
•  CoffeeScript	
  
•  ClosureScript	
  
•  Dart,	
  by	
  Google	
  
19	
  
TypeScript	
  
•  A	
  Typed	
  Superset	
  of	
  JavaScript	
  that	
  compiles	
  to	
  plain	
  
JavaScript	
  
•  Superset	
  of	
  ECMAScript	
  6	
  
•  Created	
  by	
  Anders	
  Hejlsberg,	
  father	
  of	
  Pascal	
  and	
  C#	
  
20	
  
TypeScript	
   JavaScript	
  
CoffeeScript	
  
•  A	
  li[le	
  language	
  that	
  compiles	
  into	
  JavaScript	
  
•  An	
  a[empt	
  to	
  expose	
  the	
  good	
  parts	
  of	
  JavaScript	
  in	
  a	
  simple	
  way	
  
•  GitHub	
  languages	
  ranking	
  10	
  and	
  sFll	
  raising	
  
•  Simple	
  Syntax	
  (Combine	
  of	
  Python	
  and	
  Ruby)	
  
•  Fully	
  object-­‐oriented	
  
•  Always	
  follows	
  the	
  best	
  pracFce	
  of	
  JavaScript	
  
–  e.g.	
  No	
  global	
  variables,	
  no	
  ‘with’	
  keyword	
  
•  Editor:	
  Sublime	
  Text	
  
•  Debug:	
  Firebug	
  +	
  Source	
  map	
  
21	
  
CoffeeScript	
  
JavaScript	
  
ClojureScript	
  
•  ClojureScript	
  is	
  Lisp	
  for	
  Frond	
  end	
  
development	
  
22	
  
Dart	
  
•  Dart	
  is	
  a	
  new	
  language	
  but	
  looks	
  similar	
  to	
  JavaScript	
  
•  It’s	
  targeFng	
  for	
  applicaFon	
  development	
  
•  Language	
  Features	
  
–  Classes	
  
–  OpFonal	
  types	
  
–  Lexical	
  scoping	
  
–  Libraries	
  
–  Isolates	
  
•  All	
  dart	
  code	
  runs	
  inside	
  of	
  isolates.	
  Each	
  isolate	
  has	
  its	
  own	
  
memory	
  heap.	
  
–  Toolability	
  
23	
  
Trend	
  
•  Web	
  Apps	
  are	
  becoming	
  more	
  dynamic,	
  be[er	
  
user	
  experience	
  
•  Logic	
  are	
  moving	
  from	
  server	
  side	
  to	
  client	
  side	
  
•  noBackend	
  in	
  Front-­‐Trends	
  2013	
  
–  noBackend	
  is	
  an	
  approache	
  to	
  decouple	
  apps	
  from	
  
backends,	
  by	
  abstracFng	
  backend	
  tasks	
  with	
  frontend	
  
code.	
  This	
  allows	
  frontend	
  developers	
  to	
  focus	
  on	
  
user	
  experience	
  and	
  gives	
  backend	
  developers	
  more	
  
flexibility	
  on	
  the	
  implementaFon	
  side.	
  
24	
  
Q	
  &	
  A	
  
25	
  

Weitere ähnliche Inhalte

Was ist angesagt?

Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Gabriel Villa
 
1st Chinaonrails Open Course
1st Chinaonrails Open Course1st Chinaonrails Open Course
1st Chinaonrails Open Course
Jesse Cai
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratch
tutorialsruby
 
Ruby on Rails Crash course
Ruby on Rails Crash courseRuby on Rails Crash course
Ruby on Rails Crash course
andreanodari
 
Charles Nutter Presentations
Charles Nutter PresentationsCharles Nutter Presentations
Charles Nutter Presentations
webuploader
 

Was ist angesagt? (20)

Java
JavaJava
Java
 
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and GruntOpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
 
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
 
1st Chinaonrails Open Course
1st Chinaonrails Open Course1st Chinaonrails Open Course
1st Chinaonrails Open Course
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
 
Drupal training-1-in-mumbai
Drupal training-1-in-mumbaiDrupal training-1-in-mumbai
Drupal training-1-in-mumbai
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
 
Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 Projects
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratch
 
Agile sites @ telmore
Agile sites @ telmore Agile sites @ telmore
Agile sites @ telmore
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
 
Agile sites2
Agile sites2Agile sites2
Agile sites2
 
OpenCms Days 2016: Multilingual websites with OpenCms
OpenCms Days 2016:   Multilingual websites with OpenCmsOpenCms Days 2016:   Multilingual websites with OpenCms
OpenCms Days 2016: Multilingual websites with OpenCms
 
Domino java
Domino javaDomino java
Domino java
 
OpenCms Days 2016: OpenCms at the swiss seismological service
OpenCms Days 2016: OpenCms at the swiss seismological serviceOpenCms Days 2016: OpenCms at the swiss seismological service
OpenCms Days 2016: OpenCms at the swiss seismological service
 
Road Trip To Component
Road Trip To ComponentRoad Trip To Component
Road Trip To Component
 
Ruby on Rails Crash course
Ruby on Rails Crash courseRuby on Rails Crash course
Ruby on Rails Crash course
 
Getting started with angular js
Getting started with angular jsGetting started with angular js
Getting started with angular js
 
Charles Nutter Presentations
Charles Nutter PresentationsCharles Nutter Presentations
Charles Nutter Presentations
 
RubyonRails
RubyonRailsRubyonRails
RubyonRails
 

Andere mochten auch (7)

Slides chapter 17
Slides chapter 17Slides chapter 17
Slides chapter 17
 
Slides chapters 26-27
Slides chapters 26-27Slides chapters 26-27
Slides chapters 26-27
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
 
Web Application Testing
Web Application TestingWeb Application Testing
Web Application Testing
 
Testing web application
Testing web applicationTesting web application
Testing web application
 
PCB review techniques
PCB review techniquesPCB review techniques
PCB review techniques
 
Volleyball presentation
Volleyball presentationVolleyball presentation
Volleyball presentation
 

Ähnlich wie Structured web apps

Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Jeremy Likness
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratch
tutorialsruby
 
Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014
Sean McCullough
 
6 weeks 6 months live project summer industrial training in cmc limited 2012
6 weeks  6 months live project summer industrial training in cmc limited  20126 weeks  6 months live project summer industrial training in cmc limited  2012
6 weeks 6 months live project summer industrial training in cmc limited 2012
CMC Limited
 
9781305078444 ppt ch01
9781305078444 ppt ch019781305078444 ppt ch01
9781305078444 ppt ch01
Terry Yoast
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
jeresig
 

Ähnlich wie Structured web apps (20)

Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
 
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European BankAlfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European Bank
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratch
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEAN
 
Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the Enterprise
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
6 weeks 6 months live project summer industrial training in cmc limited 2012
6 weeks  6 months live project summer industrial training in cmc limited  20126 weeks  6 months live project summer industrial training in cmc limited  2012
6 weeks 6 months live project summer industrial training in cmc limited 2012
 
Full Stack Developer Course | Infinite Graphix Technologies
Full Stack Developer Course | Infinite Graphix TechnologiesFull Stack Developer Course | Infinite Graphix Technologies
Full Stack Developer Course | Infinite Graphix Technologies
 
9781305078444 ppt ch01
9781305078444 ppt ch019781305078444 ppt ch01
9781305078444 ppt ch01
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Best DotNet Training in Delhi
Best   DotNet Training  in DelhiBest   DotNet Training  in Delhi
Best DotNet Training in Delhi
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
 
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
Enhancing Spring MVC Web Applications Progressively with Spring JavaScriptEnhancing Spring MVC Web Applications Progressively with Spring JavaScript
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

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
 
[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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Structured web apps

  • 1. Structured  Web  Apps   Tim  Tian  
  • 2. Outline   •  Front  End  Development  Challenges   •  JavaScript  Frameworks   •  New  Languages   2  
  • 3. Frond  End  Development  Challenges   •  JavaScript,  DOM  and  BOM  NaFve  API   •  Web  App  Infrastructure   •  Rich  ApplicaFon  Architecture   •  UI  InteracFon   •  Development  Toolchain   3  
  • 4. NaFve  API  Problems  (1/2)   •  Hard  to  Use   •  Browser  CompaFbility  Issues   4  
  • 5. NaFve  API  Problems  (2/2)   •  Early  Frameworks  (e.g.  jQuery)  all  focus  on  fixing  these   issues.   –  DOM  tree  query  and  manipulaFon   –  DOM  event  handling   –  Ajax   •  Simplify  XMLH[pRequest  API   •  Enhance  it’s  semanFc  (Deferred  &  Promises)   –  JavaScript  Language  Enhancements   •  UFlity  Libraries.  e.g.  underscore.Js,  Lo-­‐Dash   •  HTML  5,  ECMAScript  5,  ECMAScript  Harmony  and  CSS3   –  New  APIs  are  eliminaFng  the  necessity  of  these  frameworks,   e.g.  document.querySelector,  CSS3  animaFons   5  
  • 6. Web  App  Infrastructure  (1/4)   •  Modularity   – Problems   •  Avoid  Global  Variables  ConflicFng   •  Dependency  Management   •  Build  and  Package   – Standards   •  AMD  (Asynchronous  Module  DefiniFon)   –  RequireJS,  Dojo   •  CommonJS   –  Node.js   6  
  • 7. Web  App  Infrastructure  (2/4)   •  Object-­‐Oriented  Programming   –  JavaScript  is  a  prototype-­‐based  language   •  simulate  many  class-­‐based  features   –  Frameworks   •  YUI  extend   •  MooTools  Class   •  Dojo   •  Prototype   •  Backbone.Model.extend   •  etc.   –  Reference   •  Douglas  Crockford  –  Classical  Inheritance  in  JavaScript   •  John  Resig  –  Simple  JavaScript  Inheritance   •  Nicholas  Zakas  –  Does  JavaScript  need  classes?   7  
  • 8. Web  App  Infrastructure  (3/4)   •  Customized  Event  System   – Event  Driven  Architecture   – Design  Pa[erns   •  Pub-­‐Sub   •  Observer   •  Mediator   – Example   •  Dojo  Pub-­‐Sub   •  Jquery  trigger  /  on   8  
  • 9. Web  App  Infrastructure  (4/4)   •  Widget   – Widget  DefiniFon   – Inter-­‐widget  CommunicaFon   •  e.g.  Tuplespace  for  inter-­‐widget  communicaFon   –  Sheng  Tian   – Example   •  Dojo  gadget   •  jQuery  UI  widget   9  
  • 10. Rich  ApplicaFon  Architecture  (1/2)   •  SeparaFon  of  UI,  Business  Logic,  and  Data   ManipulaFon   –  MV*  Pa[erns   •  MVC  Design  Pa[ern   •  MVP  (Model-­‐View-­‐Presenter)   •  MVVM  (Model-­‐View-­‐ViewModel)   •  Reference   –  Addy  Osmani  -­‐   Journey  Through  The  JavaScript  MVC  Jungle   10  
  • 11. Rich  ApplicaFon  Architecture  (2/2)   •  Data  Binding   –  Bind  the  data  with  UI   •  Data  SynchronizaFon   –  e.g.  Backbone.Model.sync   •  Template  Rendering   –  Mustache   –  Underscore  Template   –  Dojo  Django  Template   •  Router,  History  Management   –  Single  Page  ApplicaFon,  e.g.  YouPost   •  Backward  /  Forward  Bu[on,  e.g.  Backbone.Route  /   Backbone.History   11  
  • 12. UI  InteracFon   •  Effects  and  AnimaFons   – e.g.  jQuery  effects   – CSS3  animaFons   •  UI  Widgets   – e.g.  YUI,  Dojo,  ExtJs,  jQueryUI   •  Drawing   – HTML5  Canvas  2D,  Canvas  WebGL  3D   – SVG  /  VML,  e.g.  Raphael,  D3.js   12  
  • 13. Development  Toolchain  (1/3)   •  JavaScript  Build  and  OpFmizer   – Google  Closure  Library   – RequireJS   – Dojo,  YUI,  etc.   •  Task  Manager   – Grunt.js   – Jake   13  
  • 14. Development  Toolchain  (2/3)   •  Package  Management  (Like  Maven  in  Java)   – Twi[er  Bower   – Ender.js  (open  module  JavaScript  framework)   – Volo.js   – Component   14  
  • 15. Development  Toolchain  (3/3)   •  JavaScript  Unit  Test  Tools   – QUnit    –  An  easy-­‐to-­‐use  JS  unit  tesFng  framework   – Jasmine  –  A  behavior-­‐driven  development   framework   – Mocha  –  A  feature-­‐rich  JS  test  framwork  running   on  node  and  the  browser   •  Browser  AutomaFon  Test     – Selenium  IDE  &  WebDriver   – Dojo  ObjecFve  Harness  (DOH)   15  
  • 16. JavaScript  Frameworks  Summary  (1/3)   •  API  Wrappers  Frameworks   –  Example   •  jQuery   •  MooTools   –  Pros   •  Lighweight   •  Easy  to  use   –  Cos   •  Have  to  spend  too  much  Fme  on  choosing  other  frameworks   •  May  cause  bad  code  quality   16  
  • 17. JavaScript  Frameworks  Summary    (2/3)   •  Full-­‐Featured  Frameworks   –  Examples   •  Dojo   •  YUI   •  ExtJs   •  Google  Closure  Library   –  Pros   •  Good  code  quality   •  Well-­‐documented   •  All  covered,  usually  no  third  party  libraries  required   –  Cons   •  Heavyweight   •  Steep  Learning  Curve   17  
  • 18. JavaScript  Frameworks  Summary    (3/3)   •  Single  Page  ApplicaFon   –  Example   •  MVC:  Ember.js,  AngularJS   •  MVP:  Backbone.js   •  MVVM:  Knockout.js   •  Event  Driven:  Twi[er  Flight   –  Pros   •  Less  server  requests   •  Be[er  UI  experience   •  Specially  suit  for  rich  /  complex  client  applicaFon   –  Problems   •  Architecture  style   –  MVC,  MVP  or  MVVM   •  Intrusive  and  exclusive  Frameworks   –  Intrusive  and  exclusive:  Ember.js  and  AngularJS,  Twi[er  Flight   –  Non-­‐intrusive:  Backbone.js  and  Knockout.js   •  View   –  String  based  template  (Ember.js,  Backbone.js)   –  DOM  enhancement  (AngularJS,  Knockout.js)   18  
  • 19. New  Languages   •  TypeScript,  by  Microsoq   •  CoffeeScript   •  ClosureScript   •  Dart,  by  Google   19  
  • 20. TypeScript   •  A  Typed  Superset  of  JavaScript  that  compiles  to  plain   JavaScript   •  Superset  of  ECMAScript  6   •  Created  by  Anders  Hejlsberg,  father  of  Pascal  and  C#   20   TypeScript   JavaScript  
  • 21. CoffeeScript   •  A  li[le  language  that  compiles  into  JavaScript   •  An  a[empt  to  expose  the  good  parts  of  JavaScript  in  a  simple  way   •  GitHub  languages  ranking  10  and  sFll  raising   •  Simple  Syntax  (Combine  of  Python  and  Ruby)   •  Fully  object-­‐oriented   •  Always  follows  the  best  pracFce  of  JavaScript   –  e.g.  No  global  variables,  no  ‘with’  keyword   •  Editor:  Sublime  Text   •  Debug:  Firebug  +  Source  map   21   CoffeeScript   JavaScript  
  • 22. ClojureScript   •  ClojureScript  is  Lisp  for  Frond  end   development   22  
  • 23. Dart   •  Dart  is  a  new  language  but  looks  similar  to  JavaScript   •  It’s  targeFng  for  applicaFon  development   •  Language  Features   –  Classes   –  OpFonal  types   –  Lexical  scoping   –  Libraries   –  Isolates   •  All  dart  code  runs  inside  of  isolates.  Each  isolate  has  its  own   memory  heap.   –  Toolability   23  
  • 24. Trend   •  Web  Apps  are  becoming  more  dynamic,  be[er   user  experience   •  Logic  are  moving  from  server  side  to  client  side   •  noBackend  in  Front-­‐Trends  2013   –  noBackend  is  an  approache  to  decouple  apps  from   backends,  by  abstracFng  backend  tasks  with  frontend   code.  This  allows  frontend  developers  to  focus  on   user  experience  and  gives  backend  developers  more   flexibility  on  the  implementaFon  side.   24  
  • 25. Q  &  A   25