Building Single-Page Web Appplications in dart - Devoxx France 2013

8,629 views
8,476 views

Published on

Published in: Education
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,629
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
15
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Building Single-Page Web Appplications in dart - Devoxx France 2013

  1. 1. Building a Single-Page Web Application in Dart 18h20 - 18h50 - Miles Davis B
  2. 2. Building a Single-Page Web Application in Dart Yohan Beschi So@t – Java Developer @yohanbeschi 27 au 29 mars 2013
  3. 3. Yohan Beschi • Started programming at 15 – 100% self-taught • Languages (Assembly, C/C++, Java, Python) • Blogger, Speaker, Instructor • Started Dart 6 months ago
  4. 4. Building Uis - Javascript ?
  5. 5. Building Uis - Java ?
  6. 6. Building Uis - But how ?
  7. 7. Programmatic Components with GWT
  8. 8. Java + GWT = Too verbose! lin es n 1 00 e t ha M or
  9. 9. The Dart Way Table<User> table = new Table (sorting:true) ..addColumn(ID, new TextCell((User o) => o.id)) ..addColumn(First name, new TextCell((User o) => o.firstName)) ..addColumn(Last name, new TextCell((User o) => o.lastName)) ..addColumn(Age, new TextCell((User o) => o.age)) ..setData(objs);
  10. 10. The Dart Way Table<User> table = new Table (sorting:true) ..addColumn(ID, new TextCell((User o) => o.id)) ..addColumn(First name, new TextCell((User o) => o.firstName)) ..addColumn(Last name, new TextCell((User o) => o.lastName)) ..addColumn(Age, new TextCell((User o) => o.age)) ..setData(objs); 6lignes
  11. 11. Dart is the winner
  12. 12. Once upon a time…
  13. 13. Programmer productivity
  14. 14. Application scalability
  15. 15. Raw execution speed
  16. 16. Startup performance
  17. 17. And here we are! • Open Source (BSD) • Structured • Anti-revolutionary • Same goals as new Javascript frameworks • The goal is to not break the web
  18. 18. Dart - The language
  19. 19. Abstract Class abstract class Validatable { }
  20. 20. Abstract Method abstract class Validatable { List<Object> valuesToValidate(); }
  21. 21. Generics abstract class Validator<T extends Validatable> { }
  22. 22. Implementing a method – 1/4 abstract class Validator<T extends Validatable> { bool validate(T object) { } }
  23. 23. Implementing a method - for in – 2/4 abstract class Validator<T extends Validatable> { bool validate(T object) { for (Object obj in object.valuesToValidate()) { } } }
  24. 24. Implementing a method – 3/4 abstract class Validator<T extends Validatable> { bool validate(T object) { for (Object obj in object.valuesToValidate()) { if (StringUtils.isEmpty(obj.toString())) { } } } }
  25. 25. Implementing a method – 4/4 abstract class Validator<T extends Validatable> { bool validate(T object) { for (Object obj in object.valuesToValidate()) { if (StringUtils.isEmpty(obj.toString())) { return false; } } return true; } }
  26. 26. Concrete class class User { }
  27. 27. Class as Interface class User implements Validatable { }
  28. 28. Class members class User implements Validatable { String username; String password; }
  29. 29. Private Class members class User implements Validatable { String _username; String _password; }
  30. 30. Accessors class User implements Validatable { String _username; String _password; String get username => this._username; String get password => this._password; set username(String username) => this._username = username; set password => this._password = password; }
  31. 31. Constructor – Sugar Syntax class User implements Validatable { String _username; String _password; User(String this._username, String this._password); }
  32. 32. Implementing an abstract method class User implements Validatable { String _username; String _password; User(String this._username, String this._password); List<Object> valuesToValidate() { return [_username, _password]; } }
  33. 33. Dart Reference API • Core • Unit Testing & Mocks • HTML • Math • Async • Logging • IO • URI • Crypto • I18N • etc. • JSON • Mirrors • UTF
  34. 34. But there is more… • Mixins • Optionally typed • Top level functions • Mono process
  35. 35. Isolates
  36. 36. Dart Ecosystem
  37. 37. Virtual Machines
  38. 38. Dartium
  39. 39. DartEditor
  40. 40. Plugins
  41. 41. dart2js
  42. 42. dart2js
  43. 43. dart2js • Target HTML5 • Tree Shaking • Aggregation/Minification • Optimization
  44. 44. Pub
  45. 45. Pub - pubspec.yaml name: pacifista_rocks description: The best application in the whole world version: 0.0.1 dependencies: great_lib: any
  46. 46. dartdoc /// This is a single-line documentation comment. /** * This is a multi-line documentation comment. * To generate the documentation: * $ dartdoc <filename> */ void main() { }
  47. 47. dartdoc
  48. 48. Uses • Single-page Web Apps • Client and server side applications • HTML Games
  49. 49. Démonstrationhttps://github.com/yohanbeschi/devoxxfr_20130327.dart https://github.com/yohanbeschi/pwt_proto.dart 27 au 29 mars 2013
  50. 50. RoadmapToday: M3 ??: M4 Summer 2013 : V1 !
  51. 51. Want to know more ? • DartLangFR • Mailing-list : dartlangfr (https://groups.google.com/forum/?fromgroups=&hl=en#!forum/dartlangfr) • Google+ : DartlangFR (https://plus.google.com/u/0/communities/104813951711720144450) • Twitter : @dartlang_fr • Blog : dartlangfr.net • DartLang • Site officiel : www.dartlang.org • Mailing-list : dartlang (https://groups.google.com/a/dartlang.org/forum/?fromgroups&hl=en#!forum/misc) • Google+ : Dart (https://plus.google.com/+dartlang) • Google+ : Dartisans (https://plus.google.com/communities/114566943291919232850) • Twitter : @dart_lang • Blog : blog.dartwatch.com • Newsletter : Dart weekly
  52. 52. Thanks Questions ?

×