SlideShare une entreprise Scribd logo
1  sur  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 ?

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
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
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
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
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
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
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
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
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Dernier (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
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
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
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
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
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"
 
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
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

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 ?