SlideShare a Scribd company logo
1 of 22
Dart

Iván Zaera Avellón
Co: izaera@gmail.com
Tw: @izaera
Table of contents
●

Language features

●

Testing

–

Data typing

–

Tests

–

Specific language constructions

–

Mocks

–

Modularity and visibility

–

Mixins

–

Arithmetic

●

More resources

Concurrency model
–

Async, Futures, Completers

–

Isolates

Development tools

–
●

–

Dart project's management

–

Libraries and APIs

–

Code example: cipher library
Introduction
Language features
Data typing
●

Optional typing

●

Dynamic keyword

●

Implicit interfaces

●

Implements and extends are interchangeable

●

Is and is! operator

●

Checked runtime mode
Specific language constructions
(1/2)
●

Cascade .. operator

●

Closures

●

One line functions (=>)

●

Optional arguments

●

Named arguments
Specific language constructions
(2/2)
●

Factory constructors

●

Named constructors

●

Initialization of fields with this. syntax

●

Getters, setters, and final

●

Const
Modularity and visibility
●

Libraries and parts

●

Visibility
–

Public

–

Library private

●

Concise private modifier: _

●

Cannot extend library private classes
Mixins
●

Orthogonal functionality

●

Used where OO is-a relation does not apply

●

Keyword: with

●

Only static mixins, not runtime (like Groovy's
metaClass, for instance)
Arithmetic
●

Base num type with double and int subtypes

●

All nums are signed

●

●
●

Integers have infinite precision (VM handles
two internal subtypes for efficiency)
Doubles are stored in IEEE format
Integers are implemented as doubles when
compiled to Javascript :-(
Concurrency model
Async, Futures, Completers
●

Async execution due to event loop (like JS)

●

Futures
–

–
●

Promise to provide a result of some computation some
time in the future
Difficult and cumbersome error handling

Completers
–

Low level construction to signal Future finalization

–

Should be used with care because makes error handling
more difficult than Futures
Isolates
●

Alternative to threads

●

Message passing paradigm
–

Shared memory not allowed

–

Use SendPort for sending messages

●

Less error prone

●

But less efficient
Testing
Tests
●

DSL: group(), test(), expect()

●

Matchers similar to Hamcrest Java library
void main() {
group( “converters:”, () {
test( "toUint32()", () {
expect( toUint32( 0x100000000 ), 0x00000000 );
expect( toUint32( -1 ), 0xFFFFFFFF );
});
});
}
Mocks
●

Mock by extending Mock class

class MockObjectory extends Mock implements Objectory {}
test( "getById() llama a Objectory.findOne() con la query correcta", () {
final id = "test_object_id";
final db = new MockObjectory();
final mockEntity = new MockEntity();
db.when( callsTo("findOne",anything) ).alwaysReturn( new Future.value(mockEntity) );
final dao = new TestObjectoryDao( "collection", db );
return dao.getById(id).then( (entity) {
var query = db.getLogs( callsTo("findOne", anything ) ).first.args[0].toString();
expect( query, equals("ObjectoryQueryBuilder(collection {_id: ObjectId(${id})})") );
});
});
More resources
Development tools
●

Dart editor
–
–

Static analyzer

–
●

Lightweight
Refactor tools

Dart Javascript compiler
–
–

●

Tree shaking
Minifying

Pub for dependency handling
Dart project's management
●

Two mailing lists:
–
–

●

misc@dartlang.org : for common questions
web@dartlang.org : for client side framework (Polymer) questions

Bugtracking
–

●

http://dartbug.com : redirects to Google Code

Version control system
–
–

●

http://github.com/...
Latest commits: https://code.google.com/p/dart/source/list

Standardization
–

ECMA is working on Dart's standard

–

http://www.ecma-international.org/memento/TC52.htm
Libraries and APIs (1/2)
●

dart:async

●

dart:chrome (client)

●

dart:collection

●

dart:core

●

dart:html (client)

●

dart:indexed_db (client)

●

dart:io (server)

●

dart:isolate

●

dart:json

●

dart:math

●

dart:mirrors

●

dart:svg (server)

●

dart:typed_data

●

dart:utf

●

dart:web_audio (client)

●

dart:web_gl (client)

●

dart:web_sql (client)
Libraries and APIs (2/2)
●

args: a library to handle command line arguments

●

crypto: a library with hash algorithms

●

fixnum: fixed size ints (32 and 64 bits)

●

intl: I18N support

●

logging: standard logging

●

meta: meta annotations library (for example: @deprecated y @override).

●

serialization: object serialization support

●

unittest: unit testing library

●

mock: mocking library for unit testing (similar to mockito)

●

matchers: matchers library for unit testing (similar to Hamcrest)
Code example: cipher library
●

Cryptography library

●

Code based on Bouncy Castle java library

●

https://github.com/izaera/cipher

More Related Content

What's hot

An Overview of the Java Programming Language
An Overview of the Java Programming LanguageAn Overview of the Java Programming Language
An Overview of the Java Programming LanguageSalaam Kehinde
 
C# Starter L02-Classes and Objects
C# Starter L02-Classes and ObjectsC# Starter L02-Classes and Objects
C# Starter L02-Classes and ObjectsMohammad Shaker
 
javascript objects
javascript objectsjavascript objects
javascript objectsVijay Kalyan
 
Introduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicIntroduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicSmartLogic
 
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingRadoslav Georgiev
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - ObjectsWebStackAcademy
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharphmanjarawala
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharpRaga Vahini
 
Objective-C Survives
Objective-C SurvivesObjective-C Survives
Objective-C SurvivesS Akai
 
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...GeeksLab Odessa
 
Session 08 - OOP with Java - continued
Session 08 - OOP with Java - continuedSession 08 - OOP with Java - continued
Session 08 - OOP with Java - continuedPawanMM
 
DIDUCE: ICSE-2002 presentation
DIDUCE: ICSE-2002 presentationDIDUCE: ICSE-2002 presentation
DIDUCE: ICSE-2002 presentationhangal
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scalaRuslan Shevchenko
 

What's hot (19)

An Overview of the Java Programming Language
An Overview of the Java Programming LanguageAn Overview of the Java Programming Language
An Overview of the Java Programming Language
 
C# Starter L02-Classes and Objects
C# Starter L02-Classes and ObjectsC# Starter L02-Classes and Objects
C# Starter L02-Classes and Objects
 
Java Day-5
Java Day-5Java Day-5
Java Day-5
 
JavaScript Data Types
JavaScript Data TypesJavaScript Data Types
JavaScript Data Types
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
 
Introduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicIntroduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogic
 
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft Training
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
 
Objective-C Survives
Objective-C SurvivesObjective-C Survives
Objective-C Survives
 
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
Java/Scala Lab 2016. Григорий Кравцов: Реализация и тестирование DAO слоя с н...
 
Java
Java Java
Java
 
Session 08 - OOP with Java - continued
Session 08 - OOP with Java - continuedSession 08 - OOP with Java - continued
Session 08 - OOP with Java - continued
 
DIDUCE: ICSE-2002 presentation
DIDUCE: ICSE-2002 presentationDIDUCE: ICSE-2002 presentation
DIDUCE: ICSE-2002 presentation
 
Few simple-type-tricks in scala
Few simple-type-tricks in scalaFew simple-type-tricks in scala
Few simple-type-tricks in scala
 
JavsScript OOP
JavsScript OOPJavsScript OOP
JavsScript OOP
 
Java Advanced Features
Java Advanced FeaturesJava Advanced Features
Java Advanced Features
 

Similar to Dart language guide for developers

Scala for Java Developers
Scala for Java DevelopersScala for Java Developers
Scala for Java DevelopersMartin Ockajak
 
Mockist vs. Classicists TDD
Mockist vs. Classicists TDDMockist vs. Classicists TDD
Mockist vs. Classicists TDDDavid Völkel
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almostQuinton Sheppard
 
JSLounge - TypeScript 소개
JSLounge - TypeScript 소개JSLounge - TypeScript 소개
JSLounge - TypeScript 소개Reagan Hwang
 
みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」techtalkdwango
 
第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScriptTakuya Fujimura
 
Android Development Course in HSE lecture #2
Android Development Course in HSE lecture #2Android Development Course in HSE lecture #2
Android Development Course in HSE lecture #2Empatika
 
Lightning talk: Kotlin
Lightning talk: KotlinLightning talk: Kotlin
Lightning talk: KotlinEvolve
 
NLJUG University Sessie: Java Reborn, Powered by Ordina
NLJUG University Sessie: Java Reborn, Powered by OrdinaNLJUG University Sessie: Java Reborn, Powered by Ordina
NLJUG University Sessie: Java Reborn, Powered by OrdinaMartijn Blankestijn
 
Testing in Scala. Adform Research
Testing in Scala. Adform ResearchTesting in Scala. Adform Research
Testing in Scala. Adform ResearchVasil Remeniuk
 
Testing in Scala by Adform research
Testing in Scala by Adform researchTesting in Scala by Adform research
Testing in Scala by Adform researchVasil Remeniuk
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David SzakallasDatabricks
 
Core2 Document - Java SCORE Overview.pptx.pdf
Core2 Document - Java SCORE Overview.pptx.pdfCore2 Document - Java SCORE Overview.pptx.pdf
Core2 Document - Java SCORE Overview.pptx.pdfThchTrngGia
 
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,..."Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...Vladimir Ivanov
 
Intro to kotlin 2018
Intro to kotlin 2018Intro to kotlin 2018
Intro to kotlin 2018Shady Selim
 
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...Michael Rys
 

Similar to Dart language guide for developers (20)

Scala for Java Developers
Scala for Java DevelopersScala for Java Developers
Scala for Java Developers
 
Mockist vs. Classicists TDD
Mockist vs. Classicists TDDMockist vs. Classicists TDD
Mockist vs. Classicists TDD
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almost
 
JSLounge - TypeScript 소개
JSLounge - TypeScript 소개JSLounge - TypeScript 소개
JSLounge - TypeScript 소개
 
みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」
 
第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript
 
C# - What's Next?
C# - What's Next?C# - What's Next?
C# - What's Next?
 
Android Development Course in HSE lecture #2
Android Development Course in HSE lecture #2Android Development Course in HSE lecture #2
Android Development Course in HSE lecture #2
 
Lightning talk: Kotlin
Lightning talk: KotlinLightning talk: Kotlin
Lightning talk: Kotlin
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
NLJUG University Sessie: Java Reborn, Powered by Ordina
NLJUG University Sessie: Java Reborn, Powered by OrdinaNLJUG University Sessie: Java Reborn, Powered by Ordina
NLJUG University Sessie: Java Reborn, Powered by Ordina
 
Testing in Scala. Adform Research
Testing in Scala. Adform ResearchTesting in Scala. Adform Research
Testing in Scala. Adform Research
 
Testing in Scala by Adform research
Testing in Scala by Adform researchTesting in Scala by Adform research
Testing in Scala by Adform research
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David Szakallas
 
Module Ninja .JS
Module Ninja .JSModule Ninja .JS
Module Ninja .JS
 
Core2 Document - Java SCORE Overview.pptx.pdf
Core2 Document - Java SCORE Overview.pptx.pdfCore2 Document - Java SCORE Overview.pptx.pdf
Core2 Document - Java SCORE Overview.pptx.pdf
 
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,..."Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
"Formal Verification in Java" by Shura Iline, Vladimir Ivanov @ JEEConf 2013,...
 
Intro to kotlin 2018
Intro to kotlin 2018Intro to kotlin 2018
Intro to kotlin 2018
 
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
 
Clojure intro
Clojure introClojure intro
Clojure intro
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Dart language guide for developers

  • 1. Dart Iván Zaera Avellón Co: izaera@gmail.com Tw: @izaera
  • 2. Table of contents ● Language features ● Testing – Data typing – Tests – Specific language constructions – Mocks – Modularity and visibility – Mixins – Arithmetic ● More resources Concurrency model – Async, Futures, Completers – Isolates Development tools – ● – Dart project's management – Libraries and APIs – Code example: cipher library
  • 5. Data typing ● Optional typing ● Dynamic keyword ● Implicit interfaces ● Implements and extends are interchangeable ● Is and is! operator ● Checked runtime mode
  • 6. Specific language constructions (1/2) ● Cascade .. operator ● Closures ● One line functions (=>) ● Optional arguments ● Named arguments
  • 7. Specific language constructions (2/2) ● Factory constructors ● Named constructors ● Initialization of fields with this. syntax ● Getters, setters, and final ● Const
  • 8. Modularity and visibility ● Libraries and parts ● Visibility – Public – Library private ● Concise private modifier: _ ● Cannot extend library private classes
  • 9. Mixins ● Orthogonal functionality ● Used where OO is-a relation does not apply ● Keyword: with ● Only static mixins, not runtime (like Groovy's metaClass, for instance)
  • 10. Arithmetic ● Base num type with double and int subtypes ● All nums are signed ● ● ● Integers have infinite precision (VM handles two internal subtypes for efficiency) Doubles are stored in IEEE format Integers are implemented as doubles when compiled to Javascript :-(
  • 12. Async, Futures, Completers ● Async execution due to event loop (like JS) ● Futures – – ● Promise to provide a result of some computation some time in the future Difficult and cumbersome error handling Completers – Low level construction to signal Future finalization – Should be used with care because makes error handling more difficult than Futures
  • 13. Isolates ● Alternative to threads ● Message passing paradigm – Shared memory not allowed – Use SendPort for sending messages ● Less error prone ● But less efficient
  • 15. Tests ● DSL: group(), test(), expect() ● Matchers similar to Hamcrest Java library void main() { group( “converters:”, () { test( "toUint32()", () { expect( toUint32( 0x100000000 ), 0x00000000 ); expect( toUint32( -1 ), 0xFFFFFFFF ); }); }); }
  • 16. Mocks ● Mock by extending Mock class class MockObjectory extends Mock implements Objectory {} test( "getById() llama a Objectory.findOne() con la query correcta", () { final id = "test_object_id"; final db = new MockObjectory(); final mockEntity = new MockEntity(); db.when( callsTo("findOne",anything) ).alwaysReturn( new Future.value(mockEntity) ); final dao = new TestObjectoryDao( "collection", db ); return dao.getById(id).then( (entity) { var query = db.getLogs( callsTo("findOne", anything ) ).first.args[0].toString(); expect( query, equals("ObjectoryQueryBuilder(collection {_id: ObjectId(${id})})") ); }); });
  • 18. Development tools ● Dart editor – – Static analyzer – ● Lightweight Refactor tools Dart Javascript compiler – – ● Tree shaking Minifying Pub for dependency handling
  • 19. Dart project's management ● Two mailing lists: – – ● misc@dartlang.org : for common questions web@dartlang.org : for client side framework (Polymer) questions Bugtracking – ● http://dartbug.com : redirects to Google Code Version control system – – ● http://github.com/... Latest commits: https://code.google.com/p/dart/source/list Standardization – ECMA is working on Dart's standard – http://www.ecma-international.org/memento/TC52.htm
  • 20. Libraries and APIs (1/2) ● dart:async ● dart:chrome (client) ● dart:collection ● dart:core ● dart:html (client) ● dart:indexed_db (client) ● dart:io (server) ● dart:isolate ● dart:json ● dart:math ● dart:mirrors ● dart:svg (server) ● dart:typed_data ● dart:utf ● dart:web_audio (client) ● dart:web_gl (client) ● dart:web_sql (client)
  • 21. Libraries and APIs (2/2) ● args: a library to handle command line arguments ● crypto: a library with hash algorithms ● fixnum: fixed size ints (32 and 64 bits) ● intl: I18N support ● logging: standard logging ● meta: meta annotations library (for example: @deprecated y @override). ● serialization: object serialization support ● unittest: unit testing library ● mock: mocking library for unit testing (similar to mockito) ● matchers: matchers library for unit testing (similar to Hamcrest)
  • 22. Code example: cipher library ● Cryptography library ● Code based on Bouncy Castle java library ● https://github.com/izaera/cipher