SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

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

Mehr von 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
 

Kürzlich hochgeladen

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
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
 
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
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
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
 
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
 
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
 
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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
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
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Kürzlich hochgeladen (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
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
 
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
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
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
 
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
 
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...
 
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...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
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...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
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
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).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