SlideShare une entreprise Scribd logo
1  sur  76
Structured Web Apps with
AGENDA 
► What is Dart? 
► How Dart Works 
► Dart Features 
► Language Tour 
► CASE DEMOS 
► Questions
WHAT IS DART? 
“...an open-source, batteries-included 
developer platform for 
building HTML5 web apps.” 
dartlang.org
BY GOOGLE 
Gilad Bracha 
Software Engineer 
Lars Bak 
Computer Programmer 
► HotSpot 
VM 
► V8 
JavaScript 
Engine 
► Dart 
VM 
► Newspeak 
Language 
► Java 
Language 
Spec 
► Dart 
Language 
Spec
TYPICAL WEB APP 
SCENARIO
“Hey, I want 
a web app”
“Hey, I want 
a web app” 
Backbone.JS
“Hey, I want 
a web app” 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js”
“Hey, I want 
a web app” 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Underscore.JS
“Hey, I want 
a web app” 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Underscore.JS 
jQuery
“Hey, I want 
a web app” 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...”
“Hey, I want 
a web app” 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...” 
Moment.JS
“Hey, I want 
a web app” 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...” 
Moment.JS 
Modernizr
“Hey, I want 
a web app” 
jQueryUI 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...” 
Moment.JS 
Modernizr
“Hey, I want 
a web app” 
jQueryUI 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...” 
Moment.JS 
Modernizr 
Leaflet.JS
“Hey, I want 
a web app” 
jQueryUI 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...” 
Moment.JS 
Modernizr 
Leaflet.JS 
Jasmine BDD
“Hey, I want 
a web app” 
jQueryUI 
Backbone.JS 
“Backbone’s only hard dependency is Underscore.js” 
Raphael.JS 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...” 
Moment.JS 
Modernizr 
Leaflet.JS 
Jasmine BDD
“Hey, I want 
a web app” 
jQueryUI 
DOCS 
DOCS DOCS 
Backbone.JS 
DOCS 
“Backbone’s only hard dependency is Underscore.js” 
Raphael.JS 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...” 
Moment.JS 
Modernizr 
Leaflet.JS 
Jasmine BDD 
DOCS 
DOCS 
DOCS 
DOCS DOCS
“Hey, I want 
a web app” 
jQueryUI 
DOCS 
DOCS DOCS 
Backbone.JS 
DOCS 
“Backbone’s only hard dependency is Underscore.js” 
Raphael.JS 
Underscore.JS 
jQuery 
“For RESTful persistence, history support via 
Backbone.Router and DOM manipulation with 
Backbone.View, include jQuery...” 
Moment.JS 
Modernizr 
Leaflet.JS 
Jasmine BDD 
DOCS 
DOCS 
DOCS 
DOCS DOCS
CONSISTENT AND CLEAR 
DART SDK 
Packages 
MVC 
Web UI 
Unit test
OFFICIAL ECMA STANDARD 
ecma-international.org/publications/standards/Ecma-408.htm
DART BUNDLE 
IDE 
Dartium 
Dart SDK
DART BUNDLE 
IDE 
Dartium 
Dart SDK 
► Eclipse-based editor 
► Supports code completion, 
static analysis, Checked/ 
Production Mode etc… 
► Plugins for third-party IDE 
and Text-Editors
DART BUNDLE 
IDE 
Dartium 
Dart SDK 
► Eclipse-based editor 
► Supports code completion, 
static analysis, Checked/ 
Production Mode etc… 
► Plugins for third-party IDE 
and Text-Editors 
► Custom build of 
Chromium with 
the Dart VM
DART BUNDLE 
IDE 
Dartium 
Dart SDK 
► Eclipse-based editor 
► Supports code completion, 
static analysis, Checked/ 
Production Mode etc… 
► Plugins for third-party IDE 
and Text-Editors 
► Custom build of 
Chromium with 
the Dart VM 
► Dart VM, Core 
Libraries and 
Command line 
tools
COMMAND LINE TOOLS 
dart
COMMAND LINE TOOLS 
dart 
dartanalyzer
COMMAND LINE TOOLS 
dart 
dartanalyzer 
docgen
COMMAND LINE TOOLS 
dart 
dartanalyzer 
pub docgen
COMMAND LINE TOOLS 
dart 
dartanalyzer 
pub docgen 
dart2js
HOW DART WORKS 
index.dart
HOW DART WORKS 
index.dart 
Dart Virtual Machine 
standalone or browser
HOW DART WORKS 
index.dart 
Dart-to-JavaScript 
compiler 
Dart Virtual Machine 
standalone or browser
HOW DART WORKS 
index.dart Dart Virtual Machine 
Dart-to-JavaScript 
compiler 
standalone or browser 
index.dart.js
FOR MODERN BROWSERS
TREE-SHAKING COMPILER 
Source Application 
main 
Library 
fn() 
fn() 
fn() 
fn()
TREE-SHAKING COMPILER 
Source Application 
main 
Library 
fn() 
fn() 
fn() 
fn() 
imports
TREE-SHAKING COMPILER 
Source Application 
main 
Library 
fn() 
fn() 
fn() 
fn() 
calls 
imports
TREE-SHAKING COMPILER 
Source Application 
main 
Library 
fn() 
fn() 
fn() 
fn() 
calls 
imports 
calls
TREE-SHAKING COMPILER 
Source Application 
main 
Library 
fn() 
fn() 
fn() 
fn() 
calls 
imports 
calls 
dart2js
TREE-SHAKING COMPILER 
Source Application 
main 
Library 
fn() 
fn() 
fn() 
fn() 
calls 
imports 
calls 
main 
calls 
calls 
fn() 
fn() 
dart2js
BENCHMARKS 
dart dart2js js 
dartlang.org/performance
WHO USES DART? 
dartlang.org/community/who-uses-dart.html
ADOBE 
toolki@ordart.github.io
BLOSSOM 
blossom.io
SOUNDTRAP 
soundtrap.com
ANGULAR 
angulardart.org
DART FEATURES
► Object-oriented language 
► Single-threaded 
► Asynchronous Programming 
with Futures/Streams 
► Concurrency with Isolates 
► Lexical Scoping 
► Modularity and Scalability
LANGUAGE TOUR
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth);! 
}! 
! 
void main() {! 
!Person person = new Person(“Joe Bloggs”, 1975);! 
!print(person.name);! 
}! 
!!
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth);! 
}! 
! 
void main() {! 
!Person person = new Person(“Joe Bloggs”, 1975);! 
!print(person.name);! 
}! 
!! 
Shorthand Constructors
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth);! 
!Person.withDefaults() : this(‘No name’, 1768);! 
}! 
! 
void main() {! 
!Person person = new Person.withDefaults();! 
!print(person.name);! 
}! 
!! 
Named Constructors
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth);! 
!Person.withDefaults() : this(‘No name’, 1768);! 
}! 
! 
void main() {! 
!Person person = new Person.withDefaults();! 
!print(person.name);! 
}! 
!! 
Initialised defaults
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth, {String nationality: ‘unknown’});! 
!Person.withDefaults() : this(‘No name’, 1768);! 
}! 
! 
void main() {! 
!Person person = new Person(“Joe Bloggs”, 1975, nationality: ‘UK’);! 
!print(person.name);! 
}! 
!! 
Optional named parameters
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth, [String nationality = ‘unknown’]);! 
!Person.withDefaults() : this(‘No name’, 1768);! 
}! 
! 
void main() {! 
!Person person = new Person(“Joe Bloggs”, 1975, ‘UK’);! 
!print(person.name);! 
}! 
!! 
Optional positional parameters
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth, [String nationality = ‘unknown’]);! 
!Person.withDefaults() : this(‘No name’, 1768);! 
!! 
!Person operator +(Person other) {! 
! !return new Person(name + ‘ and ‘ + other.name, 9999);! 
!}! 
} !! 
Operator overrides
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth, [String nationality = ‘unknown’]);! 
!Person.withDefaults() : this(‘No name’, 1768);! 
!! 
!Person operator +(Person other) {! 
! !return new Person(name + ‘ and ‘ + other.name, 9999);! 
!}! 
! 
Shorthand functions 
!speak() => print(“$name is speaking”);! 
} !!
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person(this.name, this.yearOfBirth, [String nationality = ‘unknown’]);! 
!Person.withDefaults() : this(‘No name’, 1768);! 
!! 
!Person operator +(Person other) {! 
! !return new Person(name + ‘ and ‘ + other.name, 9999);! 
!}! 
! 
!speak() => print(“$name is speaking”);! 
} !! 
String interpolation
class Person {! 
!String _name;! 
!int _yearOfBirth;! 
! 
!Person(this._name, this._yearOfBirth);! 
!Person.withDefaults() : this(‘No name’, 1768);! 
! 
!Person operator +(Person other) {! 
! !return new Person(name + ‘ and ‘ + other.name, 9999);! 
!}! 
! 
getters and setters 
!speak() => print(“$_name is speaking”);! 
! 
!String get name => _name;! 
! set name(String value) => _name = value;! 
} !!
METHOD CASCADES
import “dart:html”;! 
! 
void main() {! 
!! 
!InputElement button = new InputElement();! 
! ! ! !button.id = “sendButton”;! 
! ! ! !button.text = “Donate Bruv!!!”;! 
! ! ! !button.classes.add(‘please’);! 
! ! ! !button.onClick.listen((e) => print(‘thanks!’));! 
! 
!document.body.children.add(button);! 
! ! ! ! ! 
} !!
import “dart:html”;! 
! 
void main() {! 
!! 
!InputElement button = new InputElement();! 
! ! ! !button.id = “sendButton”;! 
! ! ! !button.text = “Donate Bruv!!!”;! 
! ! ! !button.classes.add(‘please’);! 
! ! ! !button.onClick.listen((e) => print(‘thanks!’));! 
! 
!document.body.children.add(button);! 
! ! ! ! ! 
} !!
import “dart:html”;! 
! 
void main() {! 
!! 
!InputElement button = new InputElement()! 
! ! ! !..id = “sendButton”! 
! ! ! !..text = “Donate Bruv!!!”! 
! ! ! !..classes.add(‘please’)! 
! ! ! !..onClick.listen((e) => print(‘thanks!’));! 
Method Cascades 
! 
!document.body.children.add(button);! 
! ! ! ! ! 
} !!
class Person {! 
!String name;! 
!int yearOfBirth;! 
! 
!Person({this.name, this.yearOfBirth});! 
! 
!speak() => print(“$name is speaking”);! 
}! 
! 
void main() {! 
!Person person = new Person()! 
! ! ! !..name = “Joe Bloggs”! 
! ! ! !..yearOfBirth = 1985! 
! ! ! !..speak();! 
! 
!print(person.name);! 
}! 
!!
MIXINS
class Person {! 
!speak() => print(“person is speaking”);! 
}! 
! 
class Customer extends Person {! 
!String _name;! 
!Customer(this._name);! 
}! 
!!
class Person {! 
!speak() => print(“person is speaking”);! 
}! 
! 
class VIPPermissions extends Person {! 
!luxuryTreatment() => print(“Your royal suite is ready!”);! 
}! 
! 
class Customer extends VIPPermissions {! 
!String _name;! 
!Customer(this._name);! 
}! 
!!
class Person {! 
!speak() => print(“person is speaking”);! 
}! 
! 
class VIPPermissions extends Person {! 
!luxuryTreatment() => print(“Your royal suite is ready!”);! 
}! 
! 
class Customer extends VIPPermissions {! 
!String _name;! 
!Customer(this._name);! 
}! 
!! 
Customer 
IS 
NOT 
a 
VIPPermissions 
!!!
abstract class VIPPermissions {! 
!luxuryTreatment() => print(“Your royal suite is ready!”);! 
}! 
! 
class Person {! 
!speak() => print(“person is speaking”);! 
}! 
! 
class Customer extends Person with VIPPermissions {! 
!String _name;! 
!Customer(this._name);! 
}! 
!!
abstract class VIPPermissions {! 
!luxuryTreatment() => print(“Your royal suite is ready!”);! 
}! 
! 
class Person {! 
!speak() => print(“person is speaking”);! 
}! 
! 
class Customer extends Person with VIPPermissions {! 
!String _name;! 
!Customer(this._name);! 
}! 
! 
void main() {! 
!Customer customer = new Customer(‘Charles’)..luxuryTreatment();! 
}! 
!!
abstract class VIPPermissions {! 
!luxuryTreatment() => print(“Your royal suite is ready!”);! 
}! 
! 
class Person {! 
!speak() => print(“person is speaking”);! 
}! 
! 
class Customer extends Person with VIPPermissions {! 
!String _name;! 
!Customer(this._name);! 
}! 
! 
void main() {! 
!Customer customer = new Customer(‘Charles’)..luxuryTreatment();! 
}! 
!!
BUT THAT’S NOT ALL! 
► Generics 
► Mirrors/Reflections 
► Transformations 
► Metadata/ 
Annotations 
► Factories 
► Lazy-loading 
► Interoperate with JS 
► Observatory 
► Automatic 
Sanitization 
► Web Components 
► SIMD 
► and lots more…
JOIN THE DART SIDE 
► dartlang.org/codelabs 
► api.dartlang.org 
► pub.dartlang.org 
► @dartlang on Twitter
CASE DEMOS
THANK YOU.

Contenu connexe

Tendances

建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版Joseph Chiang
 
Better Selenium Tests with Geb - Selenium Conf 2014
Better Selenium Tests with Geb - Selenium Conf 2014Better Selenium Tests with Geb - Selenium Conf 2014
Better Selenium Tests with Geb - Selenium Conf 2014Naresha K
 
An in-depth look at jQuery UI
An in-depth look at jQuery UIAn in-depth look at jQuery UI
An in-depth look at jQuery UIPaul Bakaus
 
Presentation for Linked Ancient World Data Institute
Presentation for Linked Ancient World Data InstitutePresentation for Linked Ancient World Data Institute
Presentation for Linked Ancient World Data Institutedejp3
 
React.js & Om: A hands-on walkthrough of better ways to build web UIs
React.js & Om: A hands-on walkthrough of better ways to build web UIsReact.js & Om: A hands-on walkthrough of better ways to build web UIs
React.js & Om: A hands-on walkthrough of better ways to build web UIsAdam Solove
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Knowgirish82
 
JQuery: JavaScript Library of the Future
JQuery: JavaScript Library of the FutureJQuery: JavaScript Library of the Future
JQuery: JavaScript Library of the FutureMatthew Taylor
 

Tendances (13)

建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Better Selenium Tests with Geb - Selenium Conf 2014
Better Selenium Tests with Geb - Selenium Conf 2014Better Selenium Tests with Geb - Selenium Conf 2014
Better Selenium Tests with Geb - Selenium Conf 2014
 
Learn css3
Learn css3Learn css3
Learn css3
 
An in-depth look at jQuery UI
An in-depth look at jQuery UIAn in-depth look at jQuery UI
An in-depth look at jQuery UI
 
Presentation for Linked Ancient World Data Institute
Presentation for Linked Ancient World Data InstitutePresentation for Linked Ancient World Data Institute
Presentation for Linked Ancient World Data Institute
 
React.js & Om: A hands-on walkthrough of better ways to build web UIs
React.js & Om: A hands-on walkthrough of better ways to build web UIsReact.js & Om: A hands-on walkthrough of better ways to build web UIs
React.js & Om: A hands-on walkthrough of better ways to build web UIs
 
Ten Ways to Destroy Your Database
Ten Ways to Destroy Your DatabaseTen Ways to Destroy Your Database
Ten Ways to Destroy Your Database
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
 
End-to-end testing with geb
End-to-end testing with gebEnd-to-end testing with geb
End-to-end testing with geb
 
Php Sq Lite
Php Sq LitePhp Sq Lite
Php Sq Lite
 
JQuery: JavaScript Library of the Future
JQuery: JavaScript Library of the FutureJQuery: JavaScript Library of the Future
JQuery: JavaScript Library of the Future
 
Jquery ui
Jquery uiJquery ui
Jquery ui
 

En vedette

Анжеро-Судженск бюджет 2015
Анжеро-Судженск бюджет 2015Анжеро-Судженск бюджет 2015
Анжеро-Судженск бюджет 2015anzhero
 
304 304 l-data-sheets-1-28-13
304 304 l-data-sheets-1-28-13304 304 l-data-sheets-1-28-13
304 304 l-data-sheets-1-28-13Wander Santos
 
リメディアル教育学会・発表1
リメディアル教育学会・発表1リメディアル教育学会・発表1
リメディアル教育学会・発表1Keiji Shibata
 
Area sales manager kpis
Area sales manager kpisArea sales manager kpis
Area sales manager kpishanperaca
 
Анжеро-Судженск. Проект бюджет для граждан на 2017 г.
Анжеро-Судженск. Проект бюджет для граждан на 2017 г.Анжеро-Судженск. Проект бюджет для граждан на 2017 г.
Анжеро-Судженск. Проект бюджет для граждан на 2017 г.anzhero
 
Анжеро-Судженск исполнение 2015 г.
Анжеро-Судженск исполнение 2015 г.Анжеро-Судженск исполнение 2015 г.
Анжеро-Судженск исполнение 2015 г.anzhero
 
Lecture 4 (part c) empirical models
Lecture 4 (part c)   empirical modelsLecture 4 (part c)   empirical models
Lecture 4 (part c) empirical modelspenalissthima
 
Debloquer samsung gratuit
Debloquer samsung gratuitDebloquer samsung gratuit
Debloquer samsung gratuitOscar Faure
 
Instagram for Ecommerce Marketing
Instagram for Ecommerce MarketingInstagram for Ecommerce Marketing
Instagram for Ecommerce MarketingElla Smith
 
Бюджет для граждан 2015
Бюджет для граждан 2015Бюджет для граждан 2015
Бюджет для граждан 2015anzhero
 
Бюджет для граждан 2014
Бюджет для граждан 2014Бюджет для граждан 2014
Бюджет для граждан 2014anzhero
 
Logowanie do-platformy-edu-spoldzielnie
Logowanie do-platformy-edu-spoldzielnieLogowanie do-platformy-edu-spoldzielnie
Logowanie do-platformy-edu-spoldzielniehotelbania
 

En vedette (13)

Cloudformation
CloudformationCloudformation
Cloudformation
 
Анжеро-Судженск бюджет 2015
Анжеро-Судженск бюджет 2015Анжеро-Судженск бюджет 2015
Анжеро-Судженск бюджет 2015
 
304 304 l-data-sheets-1-28-13
304 304 l-data-sheets-1-28-13304 304 l-data-sheets-1-28-13
304 304 l-data-sheets-1-28-13
 
リメディアル教育学会・発表1
リメディアル教育学会・発表1リメディアル教育学会・発表1
リメディアル教育学会・発表1
 
Area sales manager kpis
Area sales manager kpisArea sales manager kpis
Area sales manager kpis
 
Анжеро-Судженск. Проект бюджет для граждан на 2017 г.
Анжеро-Судженск. Проект бюджет для граждан на 2017 г.Анжеро-Судженск. Проект бюджет для граждан на 2017 г.
Анжеро-Судженск. Проект бюджет для граждан на 2017 г.
 
Анжеро-Судженск исполнение 2015 г.
Анжеро-Судженск исполнение 2015 г.Анжеро-Судженск исполнение 2015 г.
Анжеро-Судженск исполнение 2015 г.
 
Lecture 4 (part c) empirical models
Lecture 4 (part c)   empirical modelsLecture 4 (part c)   empirical models
Lecture 4 (part c) empirical models
 
Debloquer samsung gratuit
Debloquer samsung gratuitDebloquer samsung gratuit
Debloquer samsung gratuit
 
Instagram for Ecommerce Marketing
Instagram for Ecommerce MarketingInstagram for Ecommerce Marketing
Instagram for Ecommerce Marketing
 
Бюджет для граждан 2015
Бюджет для граждан 2015Бюджет для граждан 2015
Бюджет для граждан 2015
 
Бюджет для граждан 2014
Бюджет для граждан 2014Бюджет для граждан 2014
Бюджет для граждан 2014
 
Logowanie do-platformy-edu-spoldzielnie
Logowanie do-platformy-edu-spoldzielnieLogowanie do-platformy-edu-spoldzielnie
Logowanie do-platformy-edu-spoldzielnie
 

Similaire à Structured Apps with Google Dart

Getting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkGetting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkSarah Sexton
 
Word Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TraceryWord Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TracerySarah Sexton
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...BradNeuberg
 
How to actually use promises - Jakob Mattsson, FishBrain
How to actually use promises - Jakob Mattsson, FishBrainHow to actually use promises - Jakob Mattsson, FishBrain
How to actually use promises - Jakob Mattsson, FishBrainCodemotion Tel Aviv
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricksambiescent
 
Web Development Study Jam #2 _ Basic JavaScript.pptx
Web Development Study Jam #2 _ Basic JavaScript.pptxWeb Development Study Jam #2 _ Basic JavaScript.pptx
Web Development Study Jam #2 _ Basic JavaScript.pptxSekarMaduKusumawarda1
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)Joel Lord
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Ortus Solutions, Corp
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainKen Collins
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentationguest5d87aa6
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4Heather Rock
 
What’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth LaddWhat’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth Laddjaxconf
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑Pokai Chang
 
"Writing Maintainable JavaScript". Jon Bretman, Badoo
"Writing Maintainable JavaScript". Jon Bretman, Badoo"Writing Maintainable JavaScript". Jon Bretman, Badoo
"Writing Maintainable JavaScript". Jon Bretman, BadooYandex
 

Similaire à Structured Apps with Google Dart (20)

Getting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkGetting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot Framework
 
Word Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TraceryWord Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with Tracery
 
Sprockets
SprocketsSprockets
Sprockets
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
 
How to actually use promises - Jakob Mattsson, FishBrain
How to actually use promises - Jakob Mattsson, FishBrainHow to actually use promises - Jakob Mattsson, FishBrain
How to actually use promises - Jakob Mattsson, FishBrain
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricks
 
Web Development Study Jam #2 _ Basic JavaScript.pptx
Web Development Study Jam #2 _ Basic JavaScript.pptxWeb Development Study Jam #2 _ Basic JavaScript.pptx
Web Development Study Jam #2 _ Basic JavaScript.pptx
 
I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)I Don't Care About Security (And Neither Should You)
I Don't Care About Security (And Neither Should You)
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
前端概述
前端概述前端概述
前端概述
 
Fantom and Tales
Fantom and TalesFantom and Tales
Fantom and Tales
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
 
What’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth LaddWhat’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth Ladd
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑
 
"Writing Maintainable JavaScript". Jon Bretman, Badoo
"Writing Maintainable JavaScript". Jon Bretman, Badoo"Writing Maintainable JavaScript". Jon Bretman, Badoo
"Writing Maintainable JavaScript". Jon Bretman, Badoo
 

Dernier

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Dernier (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Structured Apps with Google Dart

  • 2. AGENDA ► What is Dart? ► How Dart Works ► Dart Features ► Language Tour ► CASE DEMOS ► Questions
  • 3. WHAT IS DART? “...an open-source, batteries-included developer platform for building HTML5 web apps.” dartlang.org
  • 4. BY GOOGLE Gilad Bracha Software Engineer Lars Bak Computer Programmer ► HotSpot VM ► V8 JavaScript Engine ► Dart VM ► Newspeak Language ► Java Language Spec ► Dart Language Spec
  • 5. TYPICAL WEB APP SCENARIO
  • 6. “Hey, I want a web app”
  • 7. “Hey, I want a web app” Backbone.JS
  • 8. “Hey, I want a web app” Backbone.JS “Backbone’s only hard dependency is Underscore.js”
  • 9. “Hey, I want a web app” Backbone.JS “Backbone’s only hard dependency is Underscore.js” Underscore.JS
  • 10. “Hey, I want a web app” Backbone.JS “Backbone’s only hard dependency is Underscore.js” Underscore.JS jQuery
  • 11. “Hey, I want a web app” Backbone.JS “Backbone’s only hard dependency is Underscore.js” Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...”
  • 12. “Hey, I want a web app” Backbone.JS “Backbone’s only hard dependency is Underscore.js” Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...” Moment.JS
  • 13. “Hey, I want a web app” Backbone.JS “Backbone’s only hard dependency is Underscore.js” Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...” Moment.JS Modernizr
  • 14. “Hey, I want a web app” jQueryUI Backbone.JS “Backbone’s only hard dependency is Underscore.js” Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...” Moment.JS Modernizr
  • 15. “Hey, I want a web app” jQueryUI Backbone.JS “Backbone’s only hard dependency is Underscore.js” Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...” Moment.JS Modernizr Leaflet.JS
  • 16. “Hey, I want a web app” jQueryUI Backbone.JS “Backbone’s only hard dependency is Underscore.js” Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...” Moment.JS Modernizr Leaflet.JS Jasmine BDD
  • 17. “Hey, I want a web app” jQueryUI Backbone.JS “Backbone’s only hard dependency is Underscore.js” Raphael.JS Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...” Moment.JS Modernizr Leaflet.JS Jasmine BDD
  • 18. “Hey, I want a web app” jQueryUI DOCS DOCS DOCS Backbone.JS DOCS “Backbone’s only hard dependency is Underscore.js” Raphael.JS Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...” Moment.JS Modernizr Leaflet.JS Jasmine BDD DOCS DOCS DOCS DOCS DOCS
  • 19. “Hey, I want a web app” jQueryUI DOCS DOCS DOCS Backbone.JS DOCS “Backbone’s only hard dependency is Underscore.js” Raphael.JS Underscore.JS jQuery “For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include jQuery...” Moment.JS Modernizr Leaflet.JS Jasmine BDD DOCS DOCS DOCS DOCS DOCS
  • 20. CONSISTENT AND CLEAR DART SDK Packages MVC Web UI Unit test
  • 21. OFFICIAL ECMA STANDARD ecma-international.org/publications/standards/Ecma-408.htm
  • 22. DART BUNDLE IDE Dartium Dart SDK
  • 23. DART BUNDLE IDE Dartium Dart SDK ► Eclipse-based editor ► Supports code completion, static analysis, Checked/ Production Mode etc… ► Plugins for third-party IDE and Text-Editors
  • 24. DART BUNDLE IDE Dartium Dart SDK ► Eclipse-based editor ► Supports code completion, static analysis, Checked/ Production Mode etc… ► Plugins for third-party IDE and Text-Editors ► Custom build of Chromium with the Dart VM
  • 25. DART BUNDLE IDE Dartium Dart SDK ► Eclipse-based editor ► Supports code completion, static analysis, Checked/ Production Mode etc… ► Plugins for third-party IDE and Text-Editors ► Custom build of Chromium with the Dart VM ► Dart VM, Core Libraries and Command line tools
  • 27. COMMAND LINE TOOLS dart dartanalyzer
  • 28. COMMAND LINE TOOLS dart dartanalyzer docgen
  • 29. COMMAND LINE TOOLS dart dartanalyzer pub docgen
  • 30. COMMAND LINE TOOLS dart dartanalyzer pub docgen dart2js
  • 31. HOW DART WORKS index.dart
  • 32. HOW DART WORKS index.dart Dart Virtual Machine standalone or browser
  • 33. HOW DART WORKS index.dart Dart-to-JavaScript compiler Dart Virtual Machine standalone or browser
  • 34. HOW DART WORKS index.dart Dart Virtual Machine Dart-to-JavaScript compiler standalone or browser index.dart.js
  • 36. TREE-SHAKING COMPILER Source Application main Library fn() fn() fn() fn()
  • 37. TREE-SHAKING COMPILER Source Application main Library fn() fn() fn() fn() imports
  • 38. TREE-SHAKING COMPILER Source Application main Library fn() fn() fn() fn() calls imports
  • 39. TREE-SHAKING COMPILER Source Application main Library fn() fn() fn() fn() calls imports calls
  • 40. TREE-SHAKING COMPILER Source Application main Library fn() fn() fn() fn() calls imports calls dart2js
  • 41. TREE-SHAKING COMPILER Source Application main Library fn() fn() fn() fn() calls imports calls main calls calls fn() fn() dart2js
  • 42. BENCHMARKS dart dart2js js dartlang.org/performance
  • 43. WHO USES DART? dartlang.org/community/who-uses-dart.html
  • 49. ► Object-oriented language ► Single-threaded ► Asynchronous Programming with Futures/Streams ► Concurrency with Isolates ► Lexical Scoping ► Modularity and Scalability
  • 51. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth);! }! ! void main() {! !Person person = new Person(“Joe Bloggs”, 1975);! !print(person.name);! }! !!
  • 52. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth);! }! ! void main() {! !Person person = new Person(“Joe Bloggs”, 1975);! !print(person.name);! }! !! Shorthand Constructors
  • 53. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth);! !Person.withDefaults() : this(‘No name’, 1768);! }! ! void main() {! !Person person = new Person.withDefaults();! !print(person.name);! }! !! Named Constructors
  • 54. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth);! !Person.withDefaults() : this(‘No name’, 1768);! }! ! void main() {! !Person person = new Person.withDefaults();! !print(person.name);! }! !! Initialised defaults
  • 55. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth, {String nationality: ‘unknown’});! !Person.withDefaults() : this(‘No name’, 1768);! }! ! void main() {! !Person person = new Person(“Joe Bloggs”, 1975, nationality: ‘UK’);! !print(person.name);! }! !! Optional named parameters
  • 56. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth, [String nationality = ‘unknown’]);! !Person.withDefaults() : this(‘No name’, 1768);! }! ! void main() {! !Person person = new Person(“Joe Bloggs”, 1975, ‘UK’);! !print(person.name);! }! !! Optional positional parameters
  • 57. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth, [String nationality = ‘unknown’]);! !Person.withDefaults() : this(‘No name’, 1768);! !! !Person operator +(Person other) {! ! !return new Person(name + ‘ and ‘ + other.name, 9999);! !}! } !! Operator overrides
  • 58. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth, [String nationality = ‘unknown’]);! !Person.withDefaults() : this(‘No name’, 1768);! !! !Person operator +(Person other) {! ! !return new Person(name + ‘ and ‘ + other.name, 9999);! !}! ! Shorthand functions !speak() => print(“$name is speaking”);! } !!
  • 59. class Person {! !String name;! !int yearOfBirth;! ! !Person(this.name, this.yearOfBirth, [String nationality = ‘unknown’]);! !Person.withDefaults() : this(‘No name’, 1768);! !! !Person operator +(Person other) {! ! !return new Person(name + ‘ and ‘ + other.name, 9999);! !}! ! !speak() => print(“$name is speaking”);! } !! String interpolation
  • 60. class Person {! !String _name;! !int _yearOfBirth;! ! !Person(this._name, this._yearOfBirth);! !Person.withDefaults() : this(‘No name’, 1768);! ! !Person operator +(Person other) {! ! !return new Person(name + ‘ and ‘ + other.name, 9999);! !}! ! getters and setters !speak() => print(“$_name is speaking”);! ! !String get name => _name;! ! set name(String value) => _name = value;! } !!
  • 62. import “dart:html”;! ! void main() {! !! !InputElement button = new InputElement();! ! ! ! !button.id = “sendButton”;! ! ! ! !button.text = “Donate Bruv!!!”;! ! ! ! !button.classes.add(‘please’);! ! ! ! !button.onClick.listen((e) => print(‘thanks!’));! ! !document.body.children.add(button);! ! ! ! ! ! } !!
  • 63. import “dart:html”;! ! void main() {! !! !InputElement button = new InputElement();! ! ! ! !button.id = “sendButton”;! ! ! ! !button.text = “Donate Bruv!!!”;! ! ! ! !button.classes.add(‘please’);! ! ! ! !button.onClick.listen((e) => print(‘thanks!’));! ! !document.body.children.add(button);! ! ! ! ! ! } !!
  • 64. import “dart:html”;! ! void main() {! !! !InputElement button = new InputElement()! ! ! ! !..id = “sendButton”! ! ! ! !..text = “Donate Bruv!!!”! ! ! ! !..classes.add(‘please’)! ! ! ! !..onClick.listen((e) => print(‘thanks!’));! Method Cascades ! !document.body.children.add(button);! ! ! ! ! ! } !!
  • 65. class Person {! !String name;! !int yearOfBirth;! ! !Person({this.name, this.yearOfBirth});! ! !speak() => print(“$name is speaking”);! }! ! void main() {! !Person person = new Person()! ! ! ! !..name = “Joe Bloggs”! ! ! ! !..yearOfBirth = 1985! ! ! ! !..speak();! ! !print(person.name);! }! !!
  • 67. class Person {! !speak() => print(“person is speaking”);! }! ! class Customer extends Person {! !String _name;! !Customer(this._name);! }! !!
  • 68. class Person {! !speak() => print(“person is speaking”);! }! ! class VIPPermissions extends Person {! !luxuryTreatment() => print(“Your royal suite is ready!”);! }! ! class Customer extends VIPPermissions {! !String _name;! !Customer(this._name);! }! !!
  • 69. class Person {! !speak() => print(“person is speaking”);! }! ! class VIPPermissions extends Person {! !luxuryTreatment() => print(“Your royal suite is ready!”);! }! ! class Customer extends VIPPermissions {! !String _name;! !Customer(this._name);! }! !! Customer IS NOT a VIPPermissions !!!
  • 70. abstract class VIPPermissions {! !luxuryTreatment() => print(“Your royal suite is ready!”);! }! ! class Person {! !speak() => print(“person is speaking”);! }! ! class Customer extends Person with VIPPermissions {! !String _name;! !Customer(this._name);! }! !!
  • 71. abstract class VIPPermissions {! !luxuryTreatment() => print(“Your royal suite is ready!”);! }! ! class Person {! !speak() => print(“person is speaking”);! }! ! class Customer extends Person with VIPPermissions {! !String _name;! !Customer(this._name);! }! ! void main() {! !Customer customer = new Customer(‘Charles’)..luxuryTreatment();! }! !!
  • 72. abstract class VIPPermissions {! !luxuryTreatment() => print(“Your royal suite is ready!”);! }! ! class Person {! !speak() => print(“person is speaking”);! }! ! class Customer extends Person with VIPPermissions {! !String _name;! !Customer(this._name);! }! ! void main() {! !Customer customer = new Customer(‘Charles’)..luxuryTreatment();! }! !!
  • 73. BUT THAT’S NOT ALL! ► Generics ► Mirrors/Reflections ► Transformations ► Metadata/ Annotations ► Factories ► Lazy-loading ► Interoperate with JS ► Observatory ► Automatic Sanitization ► Web Components ► SIMD ► and lots more…
  • 74. JOIN THE DART SIDE ► dartlang.org/codelabs ► api.dartlang.org ► pub.dartlang.org ► @dartlang on Twitter