loving data with f#

26
Partners:

Upload: valdis-iljuconoks

Post on 03-Jul-2015

65 views

Category:

Technology


0 download

DESCRIPTION

Dive into F# type providers infrastructure

TRANSCRIPT

Page 1: Loving data with F#

Partners:

Page 2: Loving data with F#

Valdis Iļjučonoks

Technical Fellow, Software Architect

Visual Studio ALM evangelist

Microsoft MVP

http://www.tech-fellow.net | @tech_fellow

Geta AS, Tech Fellow Consulting, Latvian .Net UG

[email protected]

Page 3: Loving data with F#

Loving data with F#

Valdis Iļjučonoks

Page 4: Loving data with F#
Page 5: Loving data with F#

There are three kinds of lies: lies,damned lies, and statistics.

-- Benjamin Disraeli

Page 6: Loving data with F#

Information rich programming

Page 7: Loving data with F#

Bring data source closer to program

Page 8: Loving data with F#

Barrier to include data sources: Need to represent data as types, properties and methods

Generated code must be replaced every time service reference is adjusted

Page 9: Loving data with F#

Type Providers

Page 10: Loving data with F#

From 1k feet: Compile-time type provider

Erased or generated types approach

Data set schema as type info source

Page 11: Loving data with F#

Driven by F# team and community

Page 12: Loving data with F#

DbmlFileEdmxFile

ODataServiceSqlDataConnectionSqlEntityConnection

WsdlServiceAppSettings

ExcelGraph

MachineManagement

MathRegexXamlXrm

ApiaryCsv

FreebaseJson

WorldBankXml

DGMLWordCsv

DataStoreHadoop/Hive/Hdfs

HelloWorldManagement

MiniCvsXrm

FunScript…

Page 13: Loving data with F#

{Demo image}

Page 14: Loving data with F#

Json Provider

Page 15: Loving data with F#

WorldBank Provider

Page 16: Loving data with F#

Xml Provider

Page 17: Loving data with F#

OData Service Provider

Page 18: Loving data with F#

Is it worth to develop custom provider?

Page 19: Loving data with F#

Is schema available?

Will provider have enough usage it’s worthwhile to write?

Will schema change during coding?

Will it change during program execution?

Page 20: Loving data with F#

Authoring TypeProvider

Page 21: Loving data with F#

Uses F# Code Quotations

AddMember()

AddMemberDelayed()

Page 22: Loving data with F#

let staticProp = ProvidedProperty(propertyName = "StaticProperty",propertyType = typeof<string>,IsStatic = true,GetterCode = (fun args -> <@@ "Hello!" @@>))

staticProp.AddXmlDocDelayed(fun () -> "This is a static property")

t.AddMember staticProp

let t = ProvidedTypeDefinition(thisAssembly,namespaceName,"Type" + string n,baseType = Some typeof<obj>)

Page 23: Loving data with F#

Type Providers

Page 24: Loving data with F#

Bring data source closer to program

Page 25: Loving data with F#

Feedback

Page 26: Loving data with F#

Partners: