SlideShare a Scribd company logo
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 Data Types
JavaScript Data TypesJavaScript Data Types
JavaScript Data Types
Charles Russell
 
javascript objects
javascript objectsjavascript objects
javascript objects
Vijay Kalyan
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
Hazem Hagrass
 
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
SmartLogic
 
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft Training
Radoslav Georgiev
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
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
 
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
PawanMM
 
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 scala
Ruslan Shevchenko
 
JavsScript OOP
JavsScript OOPJavsScript OOP
JavsScript OOP
LearningTech
 
Java Advanced Features
Java Advanced FeaturesJava Advanced Features
Java Advanced Features
Michael Redlich
 

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 GDG Madrid - Dart Event - By Iván Zaera

Scala for Java Developers
Scala for Java DevelopersScala for Java Developers
Scala for Java Developers
Martin Ockajak
 
Mockist vs. Classicists TDD
Mockist vs. Classicists TDDMockist vs. Classicists TDD
Mockist vs. Classicists TDD
David Völkel
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almost
Quinton 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
 
C# - What's Next?
C# - What's Next?C# - What's Next?
C# - What's Next?
Christian Nagel
 
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
Empatika
 
Lightning talk: Kotlin
Lightning talk: KotlinLightning talk: Kotlin
Lightning talk: Kotlin
Evolve
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
Hithem Ahmed
 
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
Martijn Blankestijn
 
Testing in Scala by Adform research
Testing in Scala by Adform researchTesting in Scala by Adform research
Testing in Scala by Adform research
Vasil Remeniuk
 
Testing in Scala. Adform Research
Testing in Scala. Adform ResearchTesting in Scala. Adform Research
Testing in Scala. Adform Research
Vasil 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 Szakallas
Databricks
 
Module Ninja .JS
Module Ninja .JSModule 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
ThchTrngGia
 
"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 2018
Shady 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 GDG Madrid - Dart Event - By Iván Zaera (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 by Adform research
Testing in Scala by Adform researchTesting in Scala by Adform research
Testing in Scala by Adform research
 
Testing in Scala. Adform Research
Testing in Scala. Adform ResearchTesting in Scala. Adform Research
Testing in Scala. 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

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 

GDG Madrid - Dart Event - By Iván Zaera

  • 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