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

Más contenido relacionado

La actualidad más candente

建立前端開發團隊 - 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
 

La actualidad más candente (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
 

Destacado

Анжеро-Судженск бюджет 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
 

Destacado (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
 

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

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

Último

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
 
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
 
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
 
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...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 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
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - 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
 

Último (20)

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
 
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...
 
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...
 
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...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - 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
 

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