SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Building a Single-Page Web
    Application in Dart
      18h20 - 18h50 - Miles Davis B
Building a Single-Page Web
    Application in Dart




        Yohan Beschi
      So@t – Java Developer

       @yohanbeschi
                              27 au 29 mars 2013
Yohan Beschi
 • Started programming at 15 – 100% self-taught
 • Languages (Assembly, C/C++, Java, Python)
 • Blogger, Speaker, Instructor
 • Started Dart 6 months ago
Building Uis - Javascript ?
Building Uis - Java ?
Building Uis - But how ?
Programmatic Components with GWT
Java + GWT = Too verbose!




                                      lin es
                             n 1 00
                    e t ha
             M or
The Dart Way
 Table<User> table = new Table (sorting:true)
   ..addColumn('ID', new TextCell((User o) => o.id))
   ..addColumn('First name', new TextCell((User o) => o.firstName))
   ..addColumn('Last name', new TextCell((User o) => o.lastName))
   ..addColumn('Age', new TextCell((User o) => o.age))
   ..setData(objs);
The Dart Way
 Table<User> table = new Table (sorting:true)
   ..addColumn('ID', new TextCell((User o) => o.id))
   ..addColumn('First name', new TextCell((User o) => o.firstName))
   ..addColumn('Last name', new TextCell((User o) => o.lastName))
   ..addColumn('Age', new TextCell((User o) => o.age))
   ..setData(objs);




                             6lignes
Dart is the winner
Once upon a time…
Programmer productivity
Application scalability
Raw execution speed
Startup performance
And here we are!
 • Open Source (BSD)
 • Structured
 • Anti-revolutionary
 • Same goals as new Javascript frameworks
 • The goal is to not break the web
Dart - The language
Abstract Class
 abstract class Validatable {

 }
Abstract Method
 abstract class Validatable {
   List<Object> valuesToValidate();
 }
Generics
 abstract class Validator<T extends Validatable> {

 }
Implementing a method – 1/4
 abstract class Validator<T extends Validatable> {
   bool validate(T object) {

     }
 }
Implementing a method - for in – 2/4
 abstract class Validator<T extends Validatable> {
   bool validate(T object) {
     for (Object obj in object.valuesToValidate()) {

         }
     }
 }
Implementing a method – 3/4
 abstract class Validator<T extends Validatable> {
   bool validate(T object) {
     for (Object obj in object.valuesToValidate()) {
       if (StringUtils.isEmpty(obj.toString())) {

             }
         }
     }
 }
Implementing a method – 4/4
 abstract class Validator<T extends Validatable> {
   bool validate(T object) {
     for (Object obj in object.valuesToValidate()) {
       if (StringUtils.isEmpty(obj.toString())) {
         return false;
       }
     }

         return true;
     }
 }
Concrete class
 class User {

 }
Class as Interface
 class User implements Validatable {

 }
Class members
 class User implements Validatable {
   String username;
   String password;

 }
Private Class members
 class User implements Validatable {
   String _username;
   String _password;

 }
Accessors
 class User implements Validatable {
   String _username;
   String _password;

     String get username => this._username;
     String get password => this._password;
            set username(String username)
               => this._username = username;
            set password => this._password = password;
 }
Constructor – Sugar Syntax
 class User implements Validatable {
   String _username;
   String _password;

     User(String this._username, String this._password);
 }
Implementing an abstract method
 class User implements Validatable {
   String _username;
   String _password;

     User(String this._username, String this._password);

     List<Object> valuesToValidate() {
       return [_username, _password];
     }
 }
Dart Reference API
 •   Core            •   Unit Testing & Mocks
 •   HTML            •   Math

 •   Async           •   Logging

 •   IO              •   URI

 •   Crypto
                     •   I18N
                     •   etc.
 •   JSON
 •   Mirrors
 •   UTF
But there is more…
 • Mixins
 • Optionally typed
 • Top level functions
 • Mono process
Isolates
Dart Ecosystem
Virtual Machines
Dartium
DartEditor
Plugins
dart2js
dart2js
dart2js
 • Target HTML5
 • Tree Shaking
 • Aggregation/Minification
 • Optimization
Pub
Pub - pubspec.yaml
 name: pacifista_rocks
 description: The best application in the whole world
 version: 0.0.1
 dependencies:
    great_lib: any
dartdoc
 /// This is a single-line documentation comment.

 /**
  * This is a multi-line documentation comment.
  * To generate the documentation:
  * $ dartdoc <filename>
  */
 void main() {

 }
dartdoc
Uses
 • Single-page Web Apps
 • Client and server side applications
 • HTML Games
Démonstration




https://github.com/yohanbeschi/devoxxfr_20130327.dart

    https://github.com/yohanbeschi/pwt_proto.dart
                                                        27 au 29 mars 2013
Roadmap

Today: M3   ??: M4   Summer 2013 : V1 !
Want to know more ?
 •   DartLangFR
     •   Mailing-list : dartlangfr (https://groups.google.com/forum/?fromgroups=&hl=en#!forum/dartlangfr)
     •   Google+ : DartlangFR (https://plus.google.com/u/0/communities/104813951711720144450)
     •   Twitter : @dartlang_fr
     •   Blog : dartlangfr.net


 •   DartLang
     •   Site officiel : www.dartlang.org
     •   Mailing-list : dartlang (https://groups.google.com/a/dartlang.org/forum/?fromgroups&hl=en#!forum/misc)
     •   Google+ : Dart (https://plus.google.com/+dartlang)
     •   Google+ : Dartisans (https://plus.google.com/communities/114566943291919232850)
     •   Twitter : @dart_lang
     •   Blog : blog.dartwatch.com
     •   Newsletter : Dart weekly
Thanks




         Questions ?

Weitere ähnliche Inhalte

Ähnlich wie Building a Single-Page Web App in Dart

Golang slidesaudrey
Golang slidesaudreyGolang slidesaudrey
Golang slidesaudreyAudrey Lim
 
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)Jen Wong
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocolWoodruff Solutions LLC
 
Lecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdfLecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdfLê Thưởng
 
Explain Classes and methods in java (ch04).ppt
Explain Classes and methods in java (ch04).pptExplain Classes and methods in java (ch04).ppt
Explain Classes and methods in java (ch04).pptayaankim007
 
Building a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to SpaceBuilding a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to SpaceMaarten Balliauw
 
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby DeveloperVenturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby DeveloperJon Kruger
 
Android Automated Testing
Android Automated TestingAndroid Automated Testing
Android Automated Testingroisagiv
 
9781439035665 ppt ch08
9781439035665 ppt ch089781439035665 ppt ch08
9781439035665 ppt ch08Terry Yoast
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)arvind pandey
 
Java → kotlin: Tests Made Simple
Java → kotlin: Tests Made SimpleJava → kotlin: Tests Made Simple
Java → kotlin: Tests Made Simpleleonsabr
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 

Ähnlich wie Building a Single-Page Web App in Dart (20)

C Sharp Course 101.5
C Sharp Course 101.5C Sharp Course 101.5
C Sharp Course 101.5
 
Golang slidesaudrey
Golang slidesaudreyGolang slidesaudrey
Golang slidesaudrey
 
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
More on Fitnesse and Continuous Integration (Silicon Valley code camp 2012)
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocol
 
Lecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdfLecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdf
 
Explain Classes and methods in java (ch04).ppt
Explain Classes and methods in java (ch04).pptExplain Classes and methods in java (ch04).ppt
Explain Classes and methods in java (ch04).ppt
 
Building a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to SpaceBuilding a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to Space
 
Java for beginners
Java for beginnersJava for beginners
Java for beginners
 
Ruby Programming Assignment Help
Ruby Programming Assignment HelpRuby Programming Assignment Help
Ruby Programming Assignment Help
 
Ruby Programming Assignment Help
Ruby Programming Assignment HelpRuby Programming Assignment Help
Ruby Programming Assignment Help
 
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby DeveloperVenturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
 
Android Automated Testing
Android Automated TestingAndroid Automated Testing
Android Automated Testing
 
Structure on a freeform world
Structure on a freeform worldStructure on a freeform world
Structure on a freeform world
 
Os Secoske
Os SecoskeOs Secoske
Os Secoske
 
9781439035665 ppt ch08
9781439035665 ppt ch089781439035665 ppt ch08
9781439035665 ppt ch08
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
Java → kotlin: Tests Made Simple
Java → kotlin: Tests Made SimpleJava → kotlin: Tests Made Simple
Java → kotlin: Tests Made Simple
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 

Mehr von yohanbeschi

VoxxedDays LU 2016 - Thoughtworks Go - Continuous Deployment made easy and free
VoxxedDays LU 2016 - Thoughtworks Go - Continuous Deployment made easy and freeVoxxedDays LU 2016 - Thoughtworks Go - Continuous Deployment made easy and free
VoxxedDays LU 2016 - Thoughtworks Go - Continuous Deployment made easy and freeyohanbeschi
 
Java 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR BeneluxJava 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR Beneluxyohanbeschi
 
JVM Hardcore - Part 18 - Converting a logical expression into bytecode
JVM Hardcore - Part 18 - Converting a logical expression into bytecodeJVM Hardcore - Part 18 - Converting a logical expression into bytecode
JVM Hardcore - Part 18 - Converting a logical expression into bytecodeyohanbeschi
 
JVM Hardcore - Part 07 - Parsing (Productions stack states)
JVM Hardcore - Part 07 - Parsing (Productions stack states)JVM Hardcore - Part 07 - Parsing (Productions stack states)
JVM Hardcore - Part 07 - Parsing (Productions stack states)yohanbeschi
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924yohanbeschi
 
JVM Hardcode - Part 01 - How Frames work
JVM Hardcode - Part 01 - How Frames workJVM Hardcode - Part 01 - How Frames work
JVM Hardcode - Part 01 - How Frames workyohanbeschi
 
Introduction to dart - So@t - 20130410
Introduction to dart - So@t - 20130410Introduction to dart - So@t - 20130410
Introduction to dart - So@t - 20130410yohanbeschi
 
Dart - web_ui & Programmatic components - Paris JUG - 20130409
Dart - web_ui & Programmatic components - Paris JUG - 20130409Dart - web_ui & Programmatic components - Paris JUG - 20130409
Dart - web_ui & Programmatic components - Paris JUG - 20130409yohanbeschi
 
Introduction à dart
Introduction à dartIntroduction à dart
Introduction à dartyohanbeschi
 

Mehr von yohanbeschi (9)

VoxxedDays LU 2016 - Thoughtworks Go - Continuous Deployment made easy and free
VoxxedDays LU 2016 - Thoughtworks Go - Continuous Deployment made easy and freeVoxxedDays LU 2016 - Thoughtworks Go - Continuous Deployment made easy and free
VoxxedDays LU 2016 - Thoughtworks Go - Continuous Deployment made easy and free
 
Java 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR BeneluxJava 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR Benelux
 
JVM Hardcore - Part 18 - Converting a logical expression into bytecode
JVM Hardcore - Part 18 - Converting a logical expression into bytecodeJVM Hardcore - Part 18 - Converting a logical expression into bytecode
JVM Hardcore - Part 18 - Converting a logical expression into bytecode
 
JVM Hardcore - Part 07 - Parsing (Productions stack states)
JVM Hardcore - Part 07 - Parsing (Productions stack states)JVM Hardcore - Part 07 - Parsing (Productions stack states)
JVM Hardcore - Part 07 - Parsing (Productions stack states)
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924
 
JVM Hardcode - Part 01 - How Frames work
JVM Hardcode - Part 01 - How Frames workJVM Hardcode - Part 01 - How Frames work
JVM Hardcode - Part 01 - How Frames work
 
Introduction to dart - So@t - 20130410
Introduction to dart - So@t - 20130410Introduction to dart - So@t - 20130410
Introduction to dart - So@t - 20130410
 
Dart - web_ui & Programmatic components - Paris JUG - 20130409
Dart - web_ui & Programmatic components - Paris JUG - 20130409Dart - web_ui & Programmatic components - Paris JUG - 20130409
Dart - web_ui & Programmatic components - Paris JUG - 20130409
 
Introduction à dart
Introduction à dartIntroduction à dart
Introduction à dart
 

Kürzlich hochgeladen

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Kürzlich hochgeladen (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Building a Single-Page Web App in Dart

  • 1. Building a Single-Page Web Application in Dart 18h20 - 18h50 - Miles Davis B
  • 2. Building a Single-Page Web Application in Dart Yohan Beschi So@t – Java Developer @yohanbeschi 27 au 29 mars 2013
  • 3. Yohan Beschi • Started programming at 15 – 100% self-taught • Languages (Assembly, C/C++, Java, Python) • Blogger, Speaker, Instructor • Started Dart 6 months ago
  • 4. Building Uis - Javascript ?
  • 5. Building Uis - Java ?
  • 6. Building Uis - But how ?
  • 8. Java + GWT = Too verbose! lin es n 1 00 e t ha M or
  • 9. The Dart Way Table<User> table = new Table (sorting:true) ..addColumn('ID', new TextCell((User o) => o.id)) ..addColumn('First name', new TextCell((User o) => o.firstName)) ..addColumn('Last name', new TextCell((User o) => o.lastName)) ..addColumn('Age', new TextCell((User o) => o.age)) ..setData(objs);
  • 10. The Dart Way Table<User> table = new Table (sorting:true) ..addColumn('ID', new TextCell((User o) => o.id)) ..addColumn('First name', new TextCell((User o) => o.firstName)) ..addColumn('Last name', new TextCell((User o) => o.lastName)) ..addColumn('Age', new TextCell((User o) => o.age)) ..setData(objs); 6lignes
  • 11. Dart is the winner
  • 12. Once upon a time…
  • 17. And here we are! • Open Source (BSD) • Structured • Anti-revolutionary • Same goals as new Javascript frameworks • The goal is to not break the web
  • 18. Dart - The language
  • 19. Abstract Class abstract class Validatable { }
  • 20. Abstract Method abstract class Validatable { List<Object> valuesToValidate(); }
  • 21. Generics abstract class Validator<T extends Validatable> { }
  • 22. Implementing a method – 1/4 abstract class Validator<T extends Validatable> { bool validate(T object) { } }
  • 23. Implementing a method - for in – 2/4 abstract class Validator<T extends Validatable> { bool validate(T object) { for (Object obj in object.valuesToValidate()) { } } }
  • 24. Implementing a method – 3/4 abstract class Validator<T extends Validatable> { bool validate(T object) { for (Object obj in object.valuesToValidate()) { if (StringUtils.isEmpty(obj.toString())) { } } } }
  • 25. Implementing a method – 4/4 abstract class Validator<T extends Validatable> { bool validate(T object) { for (Object obj in object.valuesToValidate()) { if (StringUtils.isEmpty(obj.toString())) { return false; } } return true; } }
  • 27. Class as Interface class User implements Validatable { }
  • 28. Class members class User implements Validatable { String username; String password; }
  • 29. Private Class members class User implements Validatable { String _username; String _password; }
  • 30. Accessors class User implements Validatable { String _username; String _password; String get username => this._username; String get password => this._password; set username(String username) => this._username = username; set password => this._password = password; }
  • 31. Constructor – Sugar Syntax class User implements Validatable { String _username; String _password; User(String this._username, String this._password); }
  • 32. Implementing an abstract method class User implements Validatable { String _username; String _password; User(String this._username, String this._password); List<Object> valuesToValidate() { return [_username, _password]; } }
  • 33. Dart Reference API • Core • Unit Testing & Mocks • HTML • Math • Async • Logging • IO • URI • Crypto • I18N • etc. • JSON • Mirrors • UTF
  • 34. But there is more… • Mixins • Optionally typed • Top level functions • Mono process
  • 43. dart2js • Target HTML5 • Tree Shaking • Aggregation/Minification • Optimization
  • 44. Pub
  • 45. Pub - pubspec.yaml name: pacifista_rocks description: The best application in the whole world version: 0.0.1 dependencies: great_lib: any
  • 46. dartdoc /// This is a single-line documentation comment. /** * This is a multi-line documentation comment. * To generate the documentation: * $ dartdoc <filename> */ void main() { }
  • 48. Uses • Single-page Web Apps • Client and server side applications • HTML Games
  • 49. Démonstration https://github.com/yohanbeschi/devoxxfr_20130327.dart https://github.com/yohanbeschi/pwt_proto.dart 27 au 29 mars 2013
  • 50. Roadmap Today: M3 ??: M4 Summer 2013 : V1 !
  • 51. Want to know more ? • DartLangFR • Mailing-list : dartlangfr (https://groups.google.com/forum/?fromgroups=&hl=en#!forum/dartlangfr) • Google+ : DartlangFR (https://plus.google.com/u/0/communities/104813951711720144450) • Twitter : @dartlang_fr • Blog : dartlangfr.net • DartLang • Site officiel : www.dartlang.org • Mailing-list : dartlang (https://groups.google.com/a/dartlang.org/forum/?fromgroups&hl=en#!forum/misc) • Google+ : Dart (https://plus.google.com/+dartlang) • Google+ : Dartisans (https://plus.google.com/communities/114566943291919232850) • Twitter : @dart_lang • Blog : blog.dartwatch.com • Newsletter : Dart weekly
  • 52. Thanks Questions ?