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

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
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
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
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
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
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
 
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
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 

Dernier (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
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
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
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...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
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)
 
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
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field 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