Tomorrow I will do a power workshop about C# 4 at BASTA Spring 2011 in Darmstadt. Here is the abstract of the workshop as shown in the conference guide (German):
C# 4 steckt für viele Entwickler immer noch voller Geheimnisse und Überraschungen. Wussten Sie, dass sich fast alle foreach-Schleifen durch LINQ ersetzen lassen? Dass der Zugriff auf Office und generell COM-Bibliotheken mit C# 4 zum Kinderspiel wurde? Dass C# 4 voller Möglichkeiten steckt, Ihre Programme zu parallelisieren?
Wenn in Ihrer täglichen Arbeit die Vorteile der aktuellen C#-Version noch nicht in Fleisch und Blut übergegangen sind, sind Sie in diesem Workshop richtig. Ihr Trainer, Rainer Stropek, konzentriert sich auf praktische Beispiele, Tipps und Tricks, die Ihnen während des Workshops auch zum Mitmachen zur Verfügung stehen.
In the workshop I will cover the following topics:
What's new in the Microsoft Visual Studio 2010 C# IDE for developers?
What's new for COM and Office Interop in C# 4?
Parallel computing with TPL and PLINQ
The dynamic keyword and the Dynamic Language Runtime
What's new in the Microsoft Visual Studio 2010 C# IDE for developers?
A few weeks ago I did a half-day workshop for C# developers about the Visual Studio 2010 IDE in Munich. This workshop has been especially for people who are new with development in Visual Studio. As the power workshop at BASTA will be for experienced developers who want to get up to date with C# 4 I will just do parts of the workshop from Munich (only the new things that came with VS2010). During the workshop I will demo the following new features of VS2010:
Some small nice details like the new project dialog, async. reference dialog, etc.
Editor news like ad hoc code blocks, zooming, etc.
The second part of the workshop will be dedicated to features regarding to COM interop. They are especially useful if you want to write interop code for Microsoft Office. I will speak about and demo the following functions of the C# 4 compiler:
Embedded interop types
Named and optional parameters
During the workshop I will use the following example project: OfficeInterop
Parallel computing with TPL and PLINQ
One of the big new things in C# 4 is the enhanced support for parallel computing. In the workshop I will cover the following aspects of parallel programming in C# 4:
Task Parallel Library (TPL)
Task and Parallel class
Collections for parallel programming
Parallel LINQ (PLINQ)
Because of the importance of the topic I will not only speak about TPL and PLINQ in theory. I will show quite a few small live-coded samples. Additionally we will take a look at the new possibilities in a large practical hands-on sample. If you want to participate you will need the following things:
Get a server with >=4 cores (if you don't have a physical one use e.g. a trial account for Windows Azure to get your hands on one; I will do that during the workshop in Darmstadt).
Create a SQL Server database with the following script (if you don't have a powerful SQL Server on your laptop you could e.g. use also Windows Azure):
During the workshop I might use some of my simple parallel programming demos that you can find in the sample solution ParallelProgramming.Samples.
Note: It would not be possible to deploy many different versions of the sample (e.g. with TPL, with LINQ, with PLINQ) multiple times. In Azure this would take me 15 minutes for each deployment. Therefore I have written a generic Azure worker role that is able to load an assembly from blob store and execute it. With this I just have to deploy a single app; the different algorithms are started by uploading the corresponding assembly into blob store and starting it using a message in an Azure queue (e.g. with Azure Storage Explorer or Cerebrata Cloud Storage Studio). Just in case you are interested - here is the code of the two main classes that perform this "deployment magic":
The dynamic keyword and the Dynamic Language Runtime
The support of the DLR in general and the dynamic keyword in particular will be the next part of the workshop. dynamic is especially useful when working with dynamic type systems (e.g. COM, HTML DOM, Python, etc.). In the workshop I will firstly describe the basics of the DLR (e.g. expression trees, call sites, etc.). Step by step we will implement our own tiny little version of ExpandoObject. Last but not least I will show practical applications of the DLR together with IronPython in a WPF application.
Here is the source code of our own demo implementation of IDynamicMetaObjectProvider:
The DLR + IronPython sample that brings everything together demonstrates the following features:
Execute Python scripts from a C# application
Dynamic UI using WPF and Python
Adding custom business logic to an existing app using Python and data binding
Python-based WPF converter
Adding Excel export functions to a WPF application using Python
Interested in the source code. Everything is in the slides (see top of this article). You can also download the Visual Studio solution and try it.
Managed Extensibility Framework (MEF)
Depending on the time and the interest of the participants I will close the workshop with a (more or less deep) introduction of MEF. This part of the C# 4 workshop will be similar to what I showed in Munich. You can find the sample code and hands on labs in the corresponding blog article.
Yesterday, I did a session about Dockerizing .NET applications at TechDays Sweden. In this blog post, I share a recording of my talk and the slides that I used.
September is BASTA! time. It has become a beloved tradition for me to travel in Autumn to Mainz to speak at the BASTA! conference. This year, my workshop, session and keynote topics were .NET, microservices and web dev technology. In this blog post I share my session material and recordings.
Time Cockpit Newsletter
Thanks for your registration! You are almost finished. We need to confirm your email address. To complete the subscription process, please click the link in the email we just sent you.