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

Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Dernier (20)

Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

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