Archive for October, 2012

Async in C# 5.0

October 30, 2012

Async in C# 5.0

Amazon:

If you’re writing one of several applications that call for asynchronous programming, this concise hands-on guide shows you how the async feature in C# 5.0 can make the process much simpler. Along with a clear introduction to asynchronous programming, you get an in-depth look at how the async feature works and why you might want to use it in your application.

Written for experienced C# programmers—yet approachable for beginners—this book is packed with code examples that you can extend for your own projects.

  • Write your own asynchronous code, and learn how async saves you from this messy chore
  • Discover new performance possibilities in ASP.NET web server code
  • Explore how async and WinRT work together in Windows 8 applications
  • Learn the importance of the await keyword in async methods
  • Understand which .NET thread is running your code—and at what points in the program
  • Use the Task-based Asynchronous Pattern (TAP) to write asynchronous APIs in .NET
  • Take advantage of parallel computing in modern machines
  • Measure async code performance by comparing it with alternatives

New on C# 5? New on Async/Await? This book is very good for beginners, it also offer a very good example on disassembling code generated. 😉

source: Async in C# 5.0

Technorati tags: C#,ASync

Async in C# 5.0: Returning Progress During Operation

October 29, 2012

Async in C# 5.0

[…] you pass asynchronous methods as interface, IProgress<T>, which they (the methods) can call to give an indication of how they’re doing.
[…] The clever feature of Progress<T> is that it will capture the SynchronizationContext on construction, and use it to call your progress update code in the right thread.
[…] Be careful because objects are consumed on different thread […] Use an immutable type to avoid problems.

source: Async in C# 5.0

Technorati tags: C#,ASync

Async in C# 5.0: Waiting for a collection of Taks

October 28, 2012

Async in C# 5.0

it’s important the we await each and every Task that we start, otherwise exceptions can get lost.
[…]
Tke key difference between using WhennAll and just awaiting multiple tasks yourself is that WhenAll gets the behaviour right when exceptions are thrown. You should always use WhenAll for this reason.

source: Async in C# 5.0

Technorati tags: C#,ASync

Async in C# 5.0: Async methods and return value

October 26, 2012

Async in C# 5.0

Async methods that return task allow the caller to wait for the operation to finish, and propagate any exception that happended during the asynchronous operation. When no result value is needed, an async Task method is better than as async void method because it allows the caller to also use await for it, making ordering and exception handling easier.

source: Async in C# 5.0

Technorati tags: C#,ASync

Advanced MVVM

October 21, 2012

Advanced MVVM by Josh Smith

Amazon:

This e-book is for WPF and Silverlight developers looking to take their Model-View-ViewModel skills to the next level. It reviews how the MVVM design pattern was used to create a fun and addictive game that provides an elegant user experience. Read this e-book to gain insights from Josh Smith, an industry recognized expert in WPF, Silverlight, and MVVM, on how to properly design complex View and ViewModel architectures. Learn how to support unlimited undo, coordinate animated transitions, control modal dialog boxes from a ViewModel, and much more.

Me: I read this book a long ago, when I started writing WPF+MVVM apps. It was helpfull that time, and for WPF/SL+MVVM beginners it’s still husefull.
In your early steps in MVVM, better read it.
It’s less da 60 pages and it’s a very good example about developing a MVVM application.
😉

source: Advanced MVVM

Technorati tags: WPF,Silverlight,MVVM