SlideShare une entreprise Scribd logo
1  sur  44
DART
             Yohan BESCHI – Développeur Java
                      @yohanbeschi
                      +Yohan Beschi
2013-02-13                 Introduction à DART   1
Pourquoi ce talk ?
CellTable<User> table = new CellTable<User>();                                                                }
                                                                                                            });
TextColumn<User> idColumn = new TextColumn<User>() {                                         columnSortHandler.setComparator(firstNameColumn,
  @Override                                                                                                 new Comparator<Tester.User>() {
  public String getValue(User user) {                                                                         public int compare(User o1, User o2) {
               return user.id;                                                                                             if (o1 == o2) {
  }                                                                                                                          return 0;
};                                                                                                                         }

TextColumn<User> firstNameColumn = new TextColumn<User>() {                                                                if (o1 != null) {
  @Override                                                                                                                  return (o2 != null) ? o1.firstName.compareTo(o2.firstName) : 1;
  public String getValue(User user) {                                                                                      }
               return user.firstName;                                                                                      return -1;
  }                                                                                                           }
};                                                                                                          });
                                                                                             columnSortHandler.setComparator(lasteNameColumn,
TextColumn<User> lastNameColumn = new TextColumn<User>() {                                                  new Comparator<Tester.User>() {
  @Override                                                                                                   public int compare(User o1, User o2) {
  public String getValue(User user) {                                                                                      if (o1 == o2) {
               return user.lastName;                                                                                         return 0;
  }                                                                                                                        }
};
                                                                                                                           if (o1 != null) {
TextColumn<User> ageColumn = new TextColumn<User>() {                                                                        return (o2 != null) ? o1.lasteName.compareTo(o2.lasteName) : 1;
  @Override                                                                                                                }
  public String getValue(User user) {                                                                                      return -1;
               return user.age;                                                                               }
  }                                                                                                         });
};                                                                                           columnSortHandler.setComparator(ageColumn,
                                                                                                            new Comparator<Tester.User>() {
idColumn.setSortable(true);                                                                                   public int compare(User o1, User o2) {
firstNameColumn.setSortable(true);                                                                                         if (o1 == o2) {
lastNameColumn.setSortable(true);                                                                                            return 0;
ageColumn.setSortable(true);                                                                                               }

table.addColumn(idColumn, "ID");                                                                                           if (o1 != null) {
table.addColumn(firstNameColumn, "First name");                                                                              return (o2 != null) ? o1.age.compareTo(o2.age) : 1;
table.addColumn(lastNameColumn, "Lats name");                                                                              }
table.addColumn(ageColumn, "Age");                                                                                         return -1;
                                                                                                              }
ListDataProvider<User> dataProvider = new ListDataProvider<User>();                                         });
dataProvider.addDataDisplay(table);                                                          table.addColumnSortHandler(columnSortHandler);
                                                                                             table.getColumnSortList().push(firstNameColumn);
List<User> list = dataProvider.getList();
for (User user : USERS) {
  list.add(user);
}

ListHandler<User> columnSortHandler = new ListHandler<Tester.User>(list);
columnSortHandler.setComparator(idColumn,
               new Comparator<Tester.User>() {
                 public int compare(User o1, User o2) {
                              if (o1 == o2) {
                                return 0;
                              }

                              if (o1 != null) {
                                return (o2 != null) ? o1.id.compareTo(o2.id) : 1;
                              }
                              return -1;




2013-02-13                                                                          Introduction à DART                                                                                        2
Pourquoi ce talk ?
CellTable<User> table = new CellTable<User>();                                                                }
                                                                                                            });
TextColumn<User> idColumn = new TextColumn<User>() {                                         columnSortHandler.setComparator(firstNameColumn,
  @Override                                                                                                 new Comparator<Tester.User>() {
  public String getValue(User user) {                                                                         public int compare(User o1, User o2) {
               return user.id;                                                                                             if (o1 == o2) {
  }                                                                                                                          return 0;
};                                                                                                                         }

TextColumn<User> firstNameColumn = new TextColumn<User>() {                                                                if (o1 != null) {
  @Override                                                                                                                  return (o2 != null) ? o1.firstName.compareTo(o2.firstName) : 1;
  public String getValue(User user) {                                                                                      }
               return user.firstName;                                                                                      return -1;
  }                                                                                                           }
};                                                                                                          });
                                                                                             columnSortHandler.setComparator(lasteNameColumn,
TextColumn<User> lastNameColumn = new TextColumn<User>() {                                                  new Comparator<Tester.User>() {
  @Override                                                                                                   public int compare(User o1, User o2) {
  public String getValue(User user) {                                                                                      if (o1 == o2) {
               return user.lastName;                                                                                         return 0;
  }                                                                                                                        }
};
                                                                                                                           if (o1 != null) {
TextColumn<User> ageColumn = new TextColumn<User>() {                                                                        return (o2 != null) ? o1.lasteName.compareTo(o2.lasteName) : 1;
  @Override                                                                                                                }
  public String getValue(User user) {                                                                                      return -1;
               return user.age;                                                                               }
  }                                                                                                         });
};                                                                                           columnSortHandler.setComparator(ageColumn,
                                                                                                            new Comparator<Tester.User>() {
idColumn.setSortable(true);                                                                                   public int compare(User o1, User o2) {
firstNameColumn.setSortable(true);                                                                                         if (o1 == o2) {
lastNameColumn.setSortable(true);                                                                                            return 0;
ageColumn.setSortable(true);                                                                                               }

table.addColumn(idColumn, "ID");                                                                                           if (o1 != null) {
table.addColumn(firstNameColumn, "First name");                                                                              return (o2 != null) ? o1.age.compareTo(o2.age) : 1;
table.addColumn(lastNameColumn, "Lats name");                                                                              }
table.addColumn(ageColumn, "Age");                                                                                         return -1;
                                                                                                              }
ListDataProvider<User> dataProvider = new ListDataProvider<User>();                                         });
dataProvider.addDataDisplay(table);                                                          table.addColumnSortHandler(columnSortHandler);
                                                                                             table.getColumnSortList().push(firstNameColumn);
List<User> list = dataProvider.getList();
for (User user : USERS) {
  list.add(user);
}

ListHandler<User> columnSortHandler = new ListHandler<Tester.User>(list);
columnSortHandler.setComparator(idColumn,
               new Comparator<Tester.User>() {
                 public int compare(User o1, User o2) {
                              if (o1 == o2) {
                                return 0;
                              }

                              if (o1 != null) {
                                return (o2 != null) ? o1.id.compareTo(o2.id) : 1;
                              }
                              return -1;




2013-02-13                                                                          Introduction à DART                                                                                        3
Pourquoi ce talk ?
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);




2013-02-13                     Introduction à DART                   4
Pourquoi ce talk ?
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);




                       6 lignes

2013-02-13                     Introduction à DART                   5
Le gagnant pour moi ?




2013-02-13              Introduction à DART   6
Il était une fois…




2013-02-13                Introduction à DART   7
Productivité du programmeur




2013-02-13              Introduction à DART   8
Application évolutive




2013-02-13               Introduction à DART   9
Rapidité d'exécution




2013-02-13               Introduction à DART   10
Performance au démarrage




2013-02-13              Introduction à DART   11
L'arrivée de DART

⦿ Open Source (BSD)
⦿ Structuré
⦿ Anti-Révolutionnaire
⦿ Dans la mouvance des frameworks JS
⦿ N’a pas pour objectif de casser le web




2013-02-13               Introduction à DART   12
Classes abstraites

abstract class Validatable {

}




2013-02-13              Introduction à DART   13
Classes abstraites

abstract class Validatable {
 List<Object> valuesToValidate();
}




2013-02-13              Introduction à DART   14
Classes abstraites

abstract class Validator<T extends Validatable> {

}




2013-02-13              Introduction à DART         15
Classes abstraites

abstract class Validator<T extends Validatable> {
  bool validate(T object) {

     }
}




2013-02-13              Introduction à DART         16
Classes abstraites

abstract class Validator<T extends Validatable> {
  bool validate(T object) {
    for (Object obj in object.valuesToValidate()) {

             }
     }
}




2013-02-13                  Introduction à DART       17
Classes abstraites

abstract class Validator<T extends Validatable> {
  bool validate(T object) {
    for (Object obj in object.valuesToValidate()) {
      if (StringUtils.isEmpty(obj.toString())) {

                 }
             }
     }
}




2013-02-13                      Introduction à DART   18
Classes abstraites

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;
     }
}



2013-02-13                  Introduction à DART       19
Classes concrètes

class User {

}




2013-02-13              Introduction à DART   20
Classes concrètes

class User implements Validatable {

}




2013-02-13              Introduction à DART   21
Classes concrètes

class User implements Validatable {
  String username;
  String password;

}




2013-02-13              Introduction à DART   22
Classes concrètes

class User implements Validatable {
  String username;
  String password;

     User(this.username, this.password);

}




2013-02-13                Introduction à DART   23
Classes concrètes

class User implements Validatable {
  String username;
  String password;

     User(this.username, this.password);

     List<Object> valuesToValidate() {
       return [username, password];
     }
}




2013-02-13                Introduction à DART   24
Mais ce n’est pas tout

⦿ Mixins
⦿ Optionnellement typé
⦿ Gouverné par des fonctions de haut niveau
⦿ Mono processus




2013-02-13               Introduction à DART   25
Librairies disponibles

⦿ Core                             ⦿ TU et Mocks
⦿ HTML                             ⦿ Math
⦿ Async                            ⦿ Logging
⦿ IO                               ⦿ URI
⦿ Crypto                           ⦿ I18N
⦿ JSON                             ⦿ etc.
⦿ Mirrors
⦿ UTF

2013-02-13                Introduction à DART      26
Futures / Callback Hell - JS
getWinningNumber( (int result1) {
  updateResult(1, result1);
  getWinningNumber( (int result2) {
    updateResult(2, result2);
    getWinningNumber( (int result3) {
      updateResult(3, result3);
      getWinningNumber( (int result4) {
        updateResult(4, result4);
        getWinningNumber( (int result5) {
          updateResult(5, result5);
          getWinningNumber( (int result6) {
            updateResult(6, result6);
              //snip getResultsString()
          });
        });
      });
    });
  });
});
2013-02-13                     Introduction à DART   27
Futures / Callback Hell - Dart
void main() {
  getFutureWinningNumber()
    .then(next(1))
    .then(next(2))
    .then(next(3))
    .then(next(4))
    .then(next(5))
    .then(next(6));
}

Function next(int position) {
  return (int result) {
     updateResult(position, result);
     return getFutureWinningNumber();
  };
}


2013-02-13                     Introduction à DART   28
Isolates




2013-02-13              Introduction à DART   29
Machines Virtuelles




2013-02-13               Introduction à DART   30
Dartium




2013-02-13             Introduction à DART   31
DartEditor




2013-02-13                Introduction à DART   32
Plugins




2013-02-13             Introduction à DART   33
dart2js




2013-02-13             Introduction à DART   34
dart2js




2013-02-13             Introduction à DART   35
dart2js

⦿ Cible HTML5
⦿ Tree Shaking
⦿ Agrégation/Minification
⦿ Optimisation




2013-02-13             Introduction à DART   36
pub




2013-02-13         Introduction à DART   37
pub

pubspec.yaml
name: pacifista_rocks
description: The best application in the whole world
version: 0.0.1
dependencies:
   great_lib: any




2013-02-13                Introduction à DART          38
dartdoc

/// This is a single-line documentation comment.

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

}




2013-02-13                Introduction à DART      39
dartdoc




2013-02-13             Introduction à DART   40
Utilisation

⦿ Création de sites Single-Page
⦿ Création d'application complètes
⦿ Jeux HTML




2013-02-13                 Introduction à DART   41
Roadmap


Aujourd'hui : M2 Mi-fevrier : M3                         Été : V1 !




 2013-02-13                        Introduction à DART                42
Aller plus loin
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


2013-02-13                                            Introduction à DART                                       43
Des questions ?

2013-02-13       Introduction à DART   44

Contenu connexe

Similaire à Introduction à dart

Introduction to dart par Yohan Beschi
Introduction to dart par Yohan BeschiIntroduction to dart par Yohan Beschi
Introduction to dart par Yohan BeschiSOAT
 
Introduction à Dart
Introduction à DartIntroduction à Dart
Introduction à DartSOAT
 
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
 
Spring and dependency injection
Spring and dependency injectionSpring and dependency injection
Spring and dependency injectionSteve Ng
 
20070329 Java Programing Tips
20070329 Java Programing Tips20070329 Java Programing Tips
20070329 Java Programing TipsShingo Furuyama
 

Similaire à Introduction à dart (7)

Introduction to dart par Yohan Beschi
Introduction to dart par Yohan BeschiIntroduction to dart par Yohan Beschi
Introduction to dart par Yohan Beschi
 
Introduction à Dart
Introduction à DartIntroduction à Dart
Introduction à Dart
 
Scala 2013 review
Scala 2013 reviewScala 2013 review
Scala 2013 review
 
JUnit PowerUp
JUnit PowerUpJUnit PowerUp
JUnit PowerUp
 
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
 
Spring and dependency injection
Spring and dependency injectionSpring and dependency injection
Spring and dependency injection
 
20070329 Java Programing Tips
20070329 Java Programing Tips20070329 Java Programing Tips
20070329 Java Programing Tips
 

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
 
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
 
Building Single-Page Web Appplications in dart - Devoxx France 2013
Building Single-Page Web Appplications in dart - Devoxx France 2013Building Single-Page Web Appplications in dart - Devoxx France 2013
Building Single-Page Web Appplications in dart - Devoxx France 2013yohanbeschi
 

Plus de yohanbeschi (6)

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
 
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
 
Building Single-Page Web Appplications in dart - Devoxx France 2013
Building Single-Page Web Appplications in dart - Devoxx France 2013Building Single-Page Web Appplications in dart - Devoxx France 2013
Building Single-Page Web Appplications in dart - Devoxx France 2013
 

Dernier

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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
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
 
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
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
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
 
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
 
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
 
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
 
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
 

Dernier (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
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...
 
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
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
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"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
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
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
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 ...
 
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
 
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...
 
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...
 
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
 

Introduction à dart

  • 1. DART Yohan BESCHI – Développeur Java @yohanbeschi +Yohan Beschi 2013-02-13 Introduction à DART 1
  • 2. Pourquoi ce talk ? CellTable<User> table = new CellTable<User>(); } }); TextColumn<User> idColumn = new TextColumn<User>() { columnSortHandler.setComparator(firstNameColumn, @Override new Comparator<Tester.User>() { public String getValue(User user) { public int compare(User o1, User o2) { return user.id; if (o1 == o2) { } return 0; }; } TextColumn<User> firstNameColumn = new TextColumn<User>() { if (o1 != null) { @Override return (o2 != null) ? o1.firstName.compareTo(o2.firstName) : 1; public String getValue(User user) { } return user.firstName; return -1; } } }; }); columnSortHandler.setComparator(lasteNameColumn, TextColumn<User> lastNameColumn = new TextColumn<User>() { new Comparator<Tester.User>() { @Override public int compare(User o1, User o2) { public String getValue(User user) { if (o1 == o2) { return user.lastName; return 0; } } }; if (o1 != null) { TextColumn<User> ageColumn = new TextColumn<User>() { return (o2 != null) ? o1.lasteName.compareTo(o2.lasteName) : 1; @Override } public String getValue(User user) { return -1; return user.age; } } }); }; columnSortHandler.setComparator(ageColumn, new Comparator<Tester.User>() { idColumn.setSortable(true); public int compare(User o1, User o2) { firstNameColumn.setSortable(true); if (o1 == o2) { lastNameColumn.setSortable(true); return 0; ageColumn.setSortable(true); } table.addColumn(idColumn, "ID"); if (o1 != null) { table.addColumn(firstNameColumn, "First name"); return (o2 != null) ? o1.age.compareTo(o2.age) : 1; table.addColumn(lastNameColumn, "Lats name"); } table.addColumn(ageColumn, "Age"); return -1; } ListDataProvider<User> dataProvider = new ListDataProvider<User>(); }); dataProvider.addDataDisplay(table); table.addColumnSortHandler(columnSortHandler); table.getColumnSortList().push(firstNameColumn); List<User> list = dataProvider.getList(); for (User user : USERS) { list.add(user); } ListHandler<User> columnSortHandler = new ListHandler<Tester.User>(list); columnSortHandler.setComparator(idColumn, new Comparator<Tester.User>() { public int compare(User o1, User o2) { if (o1 == o2) { return 0; } if (o1 != null) { return (o2 != null) ? o1.id.compareTo(o2.id) : 1; } return -1; 2013-02-13 Introduction à DART 2
  • 3. Pourquoi ce talk ? CellTable<User> table = new CellTable<User>(); } }); TextColumn<User> idColumn = new TextColumn<User>() { columnSortHandler.setComparator(firstNameColumn, @Override new Comparator<Tester.User>() { public String getValue(User user) { public int compare(User o1, User o2) { return user.id; if (o1 == o2) { } return 0; }; } TextColumn<User> firstNameColumn = new TextColumn<User>() { if (o1 != null) { @Override return (o2 != null) ? o1.firstName.compareTo(o2.firstName) : 1; public String getValue(User user) { } return user.firstName; return -1; } } }; }); columnSortHandler.setComparator(lasteNameColumn, TextColumn<User> lastNameColumn = new TextColumn<User>() { new Comparator<Tester.User>() { @Override public int compare(User o1, User o2) { public String getValue(User user) { if (o1 == o2) { return user.lastName; return 0; } } }; if (o1 != null) { TextColumn<User> ageColumn = new TextColumn<User>() { return (o2 != null) ? o1.lasteName.compareTo(o2.lasteName) : 1; @Override } public String getValue(User user) { return -1; return user.age; } } }); }; columnSortHandler.setComparator(ageColumn, new Comparator<Tester.User>() { idColumn.setSortable(true); public int compare(User o1, User o2) { firstNameColumn.setSortable(true); if (o1 == o2) { lastNameColumn.setSortable(true); return 0; ageColumn.setSortable(true); } table.addColumn(idColumn, "ID"); if (o1 != null) { table.addColumn(firstNameColumn, "First name"); return (o2 != null) ? o1.age.compareTo(o2.age) : 1; table.addColumn(lastNameColumn, "Lats name"); } table.addColumn(ageColumn, "Age"); return -1; } ListDataProvider<User> dataProvider = new ListDataProvider<User>(); }); dataProvider.addDataDisplay(table); table.addColumnSortHandler(columnSortHandler); table.getColumnSortList().push(firstNameColumn); List<User> list = dataProvider.getList(); for (User user : USERS) { list.add(user); } ListHandler<User> columnSortHandler = new ListHandler<Tester.User>(list); columnSortHandler.setComparator(idColumn, new Comparator<Tester.User>() { public int compare(User o1, User o2) { if (o1 == o2) { return 0; } if (o1 != null) { return (o2 != null) ? o1.id.compareTo(o2.id) : 1; } return -1; 2013-02-13 Introduction à DART 3
  • 4. Pourquoi ce talk ? 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); 2013-02-13 Introduction à DART 4
  • 5. Pourquoi ce talk ? 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); 6 lignes 2013-02-13 Introduction à DART 5
  • 6. Le gagnant pour moi ? 2013-02-13 Introduction à DART 6
  • 7. Il était une fois… 2013-02-13 Introduction à DART 7
  • 9. Application évolutive 2013-02-13 Introduction à DART 9
  • 10. Rapidité d'exécution 2013-02-13 Introduction à DART 10
  • 11. Performance au démarrage 2013-02-13 Introduction à DART 11
  • 12. L'arrivée de DART ⦿ Open Source (BSD) ⦿ Structuré ⦿ Anti-Révolutionnaire ⦿ Dans la mouvance des frameworks JS ⦿ N’a pas pour objectif de casser le web 2013-02-13 Introduction à DART 12
  • 13. Classes abstraites abstract class Validatable { } 2013-02-13 Introduction à DART 13
  • 14. Classes abstraites abstract class Validatable { List<Object> valuesToValidate(); } 2013-02-13 Introduction à DART 14
  • 15. Classes abstraites abstract class Validator<T extends Validatable> { } 2013-02-13 Introduction à DART 15
  • 16. Classes abstraites abstract class Validator<T extends Validatable> { bool validate(T object) { } } 2013-02-13 Introduction à DART 16
  • 17. Classes abstraites abstract class Validator<T extends Validatable> { bool validate(T object) { for (Object obj in object.valuesToValidate()) { } } } 2013-02-13 Introduction à DART 17
  • 18. Classes abstraites abstract class Validator<T extends Validatable> { bool validate(T object) { for (Object obj in object.valuesToValidate()) { if (StringUtils.isEmpty(obj.toString())) { } } } } 2013-02-13 Introduction à DART 18
  • 19. Classes abstraites 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; } } 2013-02-13 Introduction à DART 19
  • 20. Classes concrètes class User { } 2013-02-13 Introduction à DART 20
  • 21. Classes concrètes class User implements Validatable { } 2013-02-13 Introduction à DART 21
  • 22. Classes concrètes class User implements Validatable { String username; String password; } 2013-02-13 Introduction à DART 22
  • 23. Classes concrètes class User implements Validatable { String username; String password; User(this.username, this.password); } 2013-02-13 Introduction à DART 23
  • 24. Classes concrètes class User implements Validatable { String username; String password; User(this.username, this.password); List<Object> valuesToValidate() { return [username, password]; } } 2013-02-13 Introduction à DART 24
  • 25. Mais ce n’est pas tout ⦿ Mixins ⦿ Optionnellement typé ⦿ Gouverné par des fonctions de haut niveau ⦿ Mono processus 2013-02-13 Introduction à DART 25
  • 26. Librairies disponibles ⦿ Core ⦿ TU et Mocks ⦿ HTML ⦿ Math ⦿ Async ⦿ Logging ⦿ IO ⦿ URI ⦿ Crypto ⦿ I18N ⦿ JSON ⦿ etc. ⦿ Mirrors ⦿ UTF 2013-02-13 Introduction à DART 26
  • 27. Futures / Callback Hell - JS getWinningNumber( (int result1) { updateResult(1, result1); getWinningNumber( (int result2) { updateResult(2, result2); getWinningNumber( (int result3) { updateResult(3, result3); getWinningNumber( (int result4) { updateResult(4, result4); getWinningNumber( (int result5) { updateResult(5, result5); getWinningNumber( (int result6) { updateResult(6, result6); //snip getResultsString() }); }); }); }); }); }); 2013-02-13 Introduction à DART 27
  • 28. Futures / Callback Hell - Dart void main() { getFutureWinningNumber() .then(next(1)) .then(next(2)) .then(next(3)) .then(next(4)) .then(next(5)) .then(next(6)); } Function next(int position) { return (int result) { updateResult(position, result); return getFutureWinningNumber(); }; } 2013-02-13 Introduction à DART 28
  • 29. Isolates 2013-02-13 Introduction à DART 29
  • 30. Machines Virtuelles 2013-02-13 Introduction à DART 30
  • 31. Dartium 2013-02-13 Introduction à DART 31
  • 32. DartEditor 2013-02-13 Introduction à DART 32
  • 33. Plugins 2013-02-13 Introduction à DART 33
  • 34. dart2js 2013-02-13 Introduction à DART 34
  • 35. dart2js 2013-02-13 Introduction à DART 35
  • 36. dart2js ⦿ Cible HTML5 ⦿ Tree Shaking ⦿ Agrégation/Minification ⦿ Optimisation 2013-02-13 Introduction à DART 36
  • 37. pub 2013-02-13 Introduction à DART 37
  • 38. pub pubspec.yaml name: pacifista_rocks description: The best application in the whole world version: 0.0.1 dependencies: great_lib: any 2013-02-13 Introduction à DART 38
  • 39. dartdoc /// This is a single-line documentation comment. /** * This is a multi-line documentation comment. * To generate the documentation: * $ dartdoc <filename> */ void main() { } 2013-02-13 Introduction à DART 39
  • 40. dartdoc 2013-02-13 Introduction à DART 40
  • 41. Utilisation ⦿ Création de sites Single-Page ⦿ Création d'application complètes ⦿ Jeux HTML 2013-02-13 Introduction à DART 41
  • 42. Roadmap Aujourd'hui : M2 Mi-fevrier : M3 Été : V1 ! 2013-02-13 Introduction à DART 42
  • 43. Aller plus loin 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 2013-02-13 Introduction à DART 43
  • 44. Des questions ? 2013-02-13 Introduction à DART 44