On April 20, I attended the Microsoft Event “Visual Studio 2010 – At the movies”. One of the best events I’ve attended lately (content-wise), which speaks very well of the organizing partner Object Sharp. I took a few notes and wanted to share them with all of you. Here it goes:
Visual Studio 2010 & .Net Framework 4.0 – General
Threading and/or parallel processing has been made simpler to the developers. A few concepts were discusses such as:
- Barrier/Cancellation: Basically you can introduce a barrier or “staging point”, which is a point that all processes running would have to reach before continuing. You can assign cancellation tokens to processes to cancel the threads all-together.
- Work Queue/”Work Stealing”: Meaning that each thread has a work queue to process, but when a parallel process is free, it can “steal” work from another stack different from it’s own.
The syntax to make this work is also very simple to use, as simple “Parallel.Invoke (… )” does the trick for some of the cases.
Now, a word of caution, even though this has been made simpler, parallel programming should be designed correctly and carefully… I found the following MS white paper very informative: Patterns For Parallel Programming.
Contracts for Functions
This feature I really liked. Usually at the beggining of my functions I have a series of validators that usually go like this:
if (id < 0) throw new [Exception] ("Id can not be less 0");
Well, the concepts of contracts for functions have been introduced. The contracts get enforced both at compilation and run time. Using the contracts, the above statement becomes (In my opinion, it looks cleaner, and more intuitive):
Contract.Requires(id < 0, "Id can not be less 0");
In addition to “Requires”, you get functions like “Invariant” and “Ensures”, which covers most of the needs.
For more information on contracts, go here: http://msdn.microsoft.com/en-us/magazine/ee236408.aspx
Visual Studio now comes with a great tool for Architects; either to keep track of your solution dependencies and architecture, or to reverse engineer an existing solution.
The dependency graph is created dynamically from your code, and a dgml file (Directed Graph Map Language) is generated. You can navigate through the graph, search, etc. The document generated is pretty much a Visio Diagram, and it can be printed, exported, etc.
On Visual studio, you would go to the new “Architecture” option and select to “Generate Graph”.
UML / Modeling
One of the coolest things I saw here was the ability to generate a sequence diagram from the code. Simple right-click on your function and say “Generate Sequence Diagram”… A configure a few options, like the depth you want to get. That’s it! Is going to be great for technical documentation!
SQL Server 2008 Export to Azure
It seems that one of the thing MS wanted to highlight on this event, in addition to VS2010, was Azure. They showed us how SQL Server 2008 has an option to export to MS SQL Azure by “Generating Scripts”. In theory you would simply select Azure as your “Scripts for Server Version”. However I found that I do not have this option, I am not sure if I need to install anything extra (anyone?).
So I looked around and found this article: http://msdn.microsoft.com/en-us/library/ee730904.aspx. Shows you how to migrate to azure, but not with the option they showed at the event.
I didn’t know much about Silverlight, so most of the presentation was new to me. But here are the things I gathered:
- Silverlight now has an out-of-browser mode; allows you to run silverlight apps as an win apps. The application generated is cross-platform so it would work on MAC and PC.
- Better integration between Visual Studio 2010 and Expression Blend.
Wow, this getting pretty long… I’ll have to split this post in two.
Part 2 will include comments on :
- VS2010 Test Manager
- VS2010 integration with Share Point
- ASP.Net improvements