SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Reactive Extensions for .NET, Rx One of the most powerful extensions for .NET Framework IevgenOlieniev .Net Senior Developer Soft Serve
The first appearance in the world: July 2009 Unit Tests
Current situation: Includes libraries: ,[object Object]
System.Interactive.dll
System.Observable.dll
System.Reactive.dll
System.Reactive.Testing.dll,[object Object]
Pulling data from a source int[] numbers=newint[] { 20, 31, 5, 16, 22}; IEnumerable<int>numbersSmallerThan20=numbers.Where(number=>number<20); 5, 16, break IEnumerable<int>NaturalNumbers() { intnumber=0; 	while(true) 	{ 		yieldreturnnumber; 		number++; 	} } 0,1,2,3,4,5,6…
Reactive programming button.MouseMove+= (s, args) => Debug.WriteLine("You moved the mouse to {0}",  args.GetPosition(button)); “You moved the mouse to 20,3” “You moved the mouse to 33,12” “You moved the mouse to 44,18” DownloadFile("http://www.jeffwilcox.com", (byteArray) => Debug.WriteLine("This file is {0} bytes long.", byteArray.Length); “This file is 12323 bytes long.”
Events and Callbacks are Sequences of Data! newMouseEventArgs(newPoint(20,3)), 	newMouseEventArgs(newPoint(33,12)), 		newMouseEventArgs(newPoint(44,18))… newbyte[]{23,211,33,23…}, break
A new look atthe observer pattern
Unit testing slui with rx Rating rating = new Rating(); IObservable<Unit> test = ObservableExtensions      .DoAsync(() => TestPanel.Children.Add(rating)) // add a control to a panel      .WaitFor(TestPanel.GetLayoutUpdated()) // listen to LayoutUpdated event      .DoAsync(() => rating.Value = 1.0) // set a property      .WaitFor(          rating.GetActualValueChanged() // listen to ActualValueChanged event            .SkipWhile(actualValueChangedEvent =>               actualValueChangedEvent.EventArgs.NewValue != rating.Value))       .Assert(() => rating.GetRatingItems().Last().ActualValue == 1.0); // Assert// run the test and clean up at the endtest.Subscribe(() => TestPanel.Children.Remove(rating));

Weitere ähnliche Inhalte

Was ist angesagt?

Get Reactive: Microservices, Programming, and Systems
Get Reactive: Microservices, Programming, and SystemsGet Reactive: Microservices, Programming, and Systems
Get Reactive: Microservices, Programming, and SystemsJeremy Davis
 
Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapseindiappsdevelopment
 
C# Advanced L04-Threading
C# Advanced L04-ThreadingC# Advanced L04-Threading
C# Advanced L04-ThreadingMohammad Shaker
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manualnikshaikh786
 
WAP to find out whether the number is prime or not in java
WAP to find out whether the number is prime or not in javaWAP to find out whether the number is prime or not in java
WAP to find out whether the number is prime or not in javaOne97 Communications Limited
 
Aspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETAspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETYuriy Guts
 
The Singleton Pattern In Java
The Singleton Pattern In JavaThe Singleton Pattern In Java
The Singleton Pattern In JavaKohei Nozaki
 
Java program-to-add-two-matrices
Java program-to-add-two-matricesJava program-to-add-two-matrices
Java program-to-add-two-matricesUniversity of Essex
 
Oops practical file
Oops practical fileOops practical file
Oops practical fileAnkit Dixit
 
Asynchronous programming
Asynchronous programmingAsynchronous programming
Asynchronous programmingFilip Ekberg
 
merged_document_3
merged_document_3merged_document_3
merged_document_3tori hoff
 
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NETNo More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NETFilip Ekberg
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginnersishan0019
 
Clojure testing with Midje
Clojure testing with MidjeClojure testing with Midje
Clojure testing with Midjeinovex GmbH
 
Testing with Midje
Testing with MidjeTesting with Midje
Testing with MidjeTobias Bayer
 

Was ist angesagt? (20)

Get Reactive: Microservices, Programming, and Systems
Get Reactive: Microservices, Programming, and SystemsGet Reactive: Microservices, Programming, and Systems
Get Reactive: Microservices, Programming, and Systems
 
Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3Synapse india dotnet development overloading operater part 3
Synapse india dotnet development overloading operater part 3
 
C# Advanced L04-Threading
C# Advanced L04-ThreadingC# Advanced L04-Threading
C# Advanced L04-Threading
 
Java -lec-5
Java -lec-5Java -lec-5
Java -lec-5
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manual
 
WAP to find out whether the number is prime or not in java
WAP to find out whether the number is prime or not in javaWAP to find out whether the number is prime or not in java
WAP to find out whether the number is prime or not in java
 
Managing Mocks
Managing MocksManaging Mocks
Managing Mocks
 
Aspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETAspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NET
 
Lab 1
Lab 1Lab 1
Lab 1
 
The Singleton Pattern In Java
The Singleton Pattern In JavaThe Singleton Pattern In Java
The Singleton Pattern In Java
 
Java program-to-add-two-matrices
Java program-to-add-two-matricesJava program-to-add-two-matrices
Java program-to-add-two-matrices
 
Twisted is easy
Twisted is easyTwisted is easy
Twisted is easy
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
 
Asynchronous programming
Asynchronous programmingAsynchronous programming
Asynchronous programming
 
merged_document_3
merged_document_3merged_document_3
merged_document_3
 
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NETNo More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginners
 
kii
kiikii
kii
 
Clojure testing with Midje
Clojure testing with MidjeClojure testing with Midje
Clojure testing with Midje
 
Testing with Midje
Testing with MidjeTesting with Midje
Testing with Midje
 

Andere mochten auch (7)

Winmobile
WinmobileWinmobile
Winmobile
 
Erp microsoft dynamics
Erp microsoft dynamicsErp microsoft dynamics
Erp microsoft dynamics
 
Ef code first
Ef code firstEf code first
Ef code first
 
Análise e Estudo do ERP - Microsoft Dynamics
Análise e Estudo do ERP - Microsoft DynamicsAnálise e Estudo do ERP - Microsoft Dynamics
Análise e Estudo do ERP - Microsoft Dynamics
 
Sonar quality
Sonar qualitySonar quality
Sonar quality
 
Mercurial presentation
Mercurial presentationMercurial presentation
Mercurial presentation
 
Introdução Ao Microsoft Dynamics Ax
Introdução Ao Microsoft Dynamics AxIntrodução Ao Microsoft Dynamics Ax
Introdução Ao Microsoft Dynamics Ax
 

Ähnlich wie Rx for .net

Java™ (OOP) - Chapter 5: "Methods"
Java™ (OOP) - Chapter 5: "Methods"Java™ (OOP) - Chapter 5: "Methods"
Java™ (OOP) - Chapter 5: "Methods"Gouda Mando
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Juan Pablo
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstractionIntro C# Book
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4Abed Bukhari
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...MaruMengesha
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...MaruMengesha
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple ProgramsUpender Upr
 
Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*Intel® Software
 
Java programming lab manual
Java programming lab manualJava programming lab manual
Java programming lab manualsameer farooq
 
Operating system labs
Operating system labsOperating system labs
Operating system labsbhaktisagar4
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesWe Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesUnity Technologies
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source codePVS-Studio
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source codeAndrey Karpov
 
New Functional Features of Java 8
New Functional Features of Java 8New Functional Features of Java 8
New Functional Features of Java 8franciscoortin
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answersQuratulain Naqvi
 

Ähnlich wie Rx for .net (20)

.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
 
Java™ (OOP) - Chapter 5: "Methods"
Java™ (OOP) - Chapter 5: "Methods"Java™ (OOP) - Chapter 5: "Methods"
Java™ (OOP) - Chapter 5: "Methods"
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstraction
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
 
RxJava on Android
RxJava on AndroidRxJava on Android
RxJava on Android
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_15-Feb-2021_L6-...
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_17-Feb-2021_L8-...
 
Rx workshop
Rx workshopRx workshop
Rx workshop
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*
 
Lecture 12 os
Lecture 12 osLecture 12 os
Lecture 12 os
 
Java programming lab manual
Java programming lab manualJava programming lab manual
Java programming lab manual
 
Operating system labs
Operating system labsOperating system labs
Operating system labs
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesWe Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
New Functional Features of Java 8
New Functional Features of Java 8New Functional Features of Java 8
New Functional Features of Java 8
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answers
 
TechTalk - Dotnet
TechTalk - DotnetTechTalk - Dotnet
TechTalk - Dotnet
 

Mehr von dotNETUserGroupDnipro (6)

Soft serve prism
Soft serve prismSoft serve prism
Soft serve prism
 
Html5
Html5Html5
Html5
 
Css 3 overview
Css 3 overviewCss 3 overview
Css 3 overview
 
Mvc3
Mvc3Mvc3
Mvc3
 
Balsamiq
BalsamiqBalsamiq
Balsamiq
 
Azure for ug
Azure for ugAzure for ug
Azure for ug
 

Rx for .net

  • 1. Reactive Extensions for .NET, Rx One of the most powerful extensions for .NET Framework IevgenOlieniev .Net Senior Developer Soft Serve
  • 2. The first appearance in the world: July 2009 Unit Tests
  • 3.
  • 7.
  • 8. Pulling data from a source int[] numbers=newint[] { 20, 31, 5, 16, 22}; IEnumerable<int>numbersSmallerThan20=numbers.Where(number=>number<20); 5, 16, break IEnumerable<int>NaturalNumbers() { intnumber=0; while(true) { yieldreturnnumber; number++; } } 0,1,2,3,4,5,6…
  • 9. Reactive programming button.MouseMove+= (s, args) => Debug.WriteLine("You moved the mouse to {0}", args.GetPosition(button)); “You moved the mouse to 20,3” “You moved the mouse to 33,12” “You moved the mouse to 44,18” DownloadFile("http://www.jeffwilcox.com", (byteArray) => Debug.WriteLine("This file is {0} bytes long.", byteArray.Length); “This file is 12323 bytes long.”
  • 10. Events and Callbacks are Sequences of Data! newMouseEventArgs(newPoint(20,3)), newMouseEventArgs(newPoint(33,12)), newMouseEventArgs(newPoint(44,18))… newbyte[]{23,211,33,23…}, break
  • 11. A new look atthe observer pattern
  • 12. Unit testing slui with rx Rating rating = new Rating(); IObservable<Unit> test = ObservableExtensions      .DoAsync(() => TestPanel.Children.Add(rating)) // add a control to a panel      .WaitFor(TestPanel.GetLayoutUpdated()) // listen to LayoutUpdated event      .DoAsync(() => rating.Value = 1.0) // set a property      .WaitFor(          rating.GetActualValueChanged() // listen to ActualValueChanged event            .SkipWhile(actualValueChangedEvent =>               actualValueChangedEvent.EventArgs.NewValue != rating.Value))       .Assert(() => rating.GetRatingItems().Last().ActualValue == 1.0); // Assert// run the test and clean up at the endtest.Subscribe(() => TestPanel.Children.Remove(rating));
  • 13.
  • 14. A Brief Introduction to the Reactive Extensions for .NET, Rx - http://blogs.msdn.com/b/wesdyer/archive/2009/11/18/a-brief-introduction-to-the-reactive-extensions-for-net-rx.aspx
  • 15. First encounters with Reactive Extensions -http://msmvps.com/blogs/jon_skeet/archive/2010/01/16/first-encounters-with-reactive-extensions.aspx
  • 16. LINQ to Rx: second impressions - http://msmvps.com/blogs/jon_skeet/archive/2010/01/19/linq-to-rx-second-impressions.aspx
  • 17.
  • 18. Rx for .NET Framework 4.0 - http://go.microsoft.com/fwlink/?LinkId=182997
  • 19. Rx for JavaScript -http://msdn.microsoft.com/devlabs/ff628422
  • 20.

Hinweis der Redaktion

  1. Some notes
  2. Some notes
  3. Some notes
  4. Some notes
  5. After this slide should be an example of working code using VS 2010
  6. Some notes