Msdnmagazine 610 Issue.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
THE MICROSOFT JOURNAL FOR DEVELOPERS JUNE 2010 VOL 25 NO 6 SOA TIPS COLUMNS Address Scalability Bottlenecks with Distributed Caching CUTTING EDGE Iqbal Khan . 24 C# 4.0, the Dynamic Keyword and COM Dino Esposito page 6 THREAD PERFORMANCE CLR INSIDE OUT Resource Contention Concurrency Profi ling in Visual Studio 2010 F# Fundamentals Maxim Goldin . 38 Luke Hoban page 16 TEST RUN CLOUD DIAGNOSTICS Generating Graphs with WPF Take Control of Logging and Tracing in Windows Azure James McCaffrey page 92 Mike Kelly . 50 BASIC INSTINCTS Multi-Targeting Visual Basic Applications in Visual Studio 2010 EXPRESS YOURSELF Spotty Bowles page 98 Encoding Videos Using Microsoft Expression Encoder 3 SDK THE WORKING PROGRAMMER Adam Miller . 62 Going NoSQL with MongoDB, Part 2 Ted Neward page 104 INPUT VALIDATION UI FRONTIERS Enforcing Complex Business Data Rules with WPF The Ins and Outs of ItemsControl Brian Noyes . 74 Charles Petzold page 109 DON’T GET ME STARTED We’re All in This Together PRACTICAL ODATA David Platt page 112 Building Rich Internet Apps with the Open Data Protocol Shayne Burgess . 82 This month at msdn.microsoft.com/magazine: SILVERLIGHT ONLINE Silverlight in an Occasionally Connected World Mark Bloodworth and Dave Brown APPFABRIC CACHE Real-World Usage and Integration Andrea Colaci Untitled-5 2 3/5/10 10:16 AM Sure, Visual Studio 2010 has a lot of great functionality— we’re excited that it’s only making our User Interface components even better! We’re here to help you go beyond what Visual Studio 2010 gives you so you can create Killer Apps quickly, easily and without breaking a sweat! Go to infragistics.com/beyondthebox today to expand your toolbox with the fastest, best-performing and most powerful UI controls available. You’ll be surprised by your own strength! Infragistics Sales 800 231 8588 Infragistics Europe Sales +44 (0) 800 298 9055 Infragistics India +91-80-6785-1111 twitter.com/infragistics Copyright 1996-2010 Infragistics, Inc. All rights reserved. Infragistics and the Infragistics logo and NetAdvantage are registered trademarks of Infragistics, Inc. Untitled-5 3 3/5/10 10:16 AM JUNE 2010 VOLUME 25 NUMBER 6 magazine LUCINDA ROWLEY Director DIEGO DAGUM Editorial Director/[email protected] KERI GRASSL Site Manager KEITH WARD Editor in Chief/[email protected] TERRENCE DORSEY Technical Editor DAVID RAMEL Features Editor WENDY GONCHAR Managing Editor MARTI LONGWORTH Associate Managing Editor SCOTT SHULTZ Creative Director JOSHUA GOULD Art Director ALAN TAO Senior Graphic Designer CONTRIBUTING EDITORS K. Scott Allen, Dino Esposito, Julie Lerman, Juval Lowy, Dr. James McCaffrey, Ted Neward, Charles Petzold, David S. Platt Henry Allain President, Redmond Media Group Matt Morollo Vice President, Publishing Doug Barney Vice President, Editorial Director Michele Imgrund Director, Marketing Tracy Cook Online Marketing Director ADVERTISING SALES: 508-532-1418/[email protected] Matt Morollo VP, Publishing Chris Kourtoglou Regional Sales Manager William Smith National Accounts Director Danna Vedder Microsoft Account Manager Jenny Hernandez-Asandas Director Print Production Serena Barnes Production Coordinator/[email protected] Neal Vitale President & Chief Executive Offi cer Richard Vitale Senior Vice President & Chief Financial Offi cer Michael J. Valenti Executive Vice President Abraham M. Langer Senior Vice President, Audience Development & Digital Media Christopher M. Coates Vice President, Finance & Administration Erik A. Lindgren Vice President, Information Technology & Application Development Carmel McDonagh Vice President, Attendee Marketing David F. Myers Vice President, Event Operations Jeffrey S. Klein Chairman of the Board MSDN Magazine (ISSN 1528-4859) is published monthly by 1105 Media, Inc., 9201 Oakdale Avenue, Ste. 101, Chatsworth, CA 91311. Periodicals postage paid at Chatsworth, CA 91311-9998, and at additional mailing offi ces. Annual subscription rates payable in U.S. funds: U.S. $35; Canada $45; International $60. Single copies/back issues: U.S. $10, all others $12. Send orders with payment to: MSDN Magazine, P.O. Box 3167, Carol Stream, IL 60132, e-mail [email protected] or call 847-763-9560. POSTMASTER: Send address changes to MSDN Magazine, P.O. Box 2166, Skokie, IL 60076. Canada Publications Mail Agreement No: 40612608. Return Undeliverable Canadian Addresses to Circulation Dept. or IMS/NJ. Attn: Returns, 310 Paterson Plank Road, Carlstadt, NJ 07072. Printed in the U.S.A. Reproductions in whole or part prohibited except by written permission. Mail requests to “Permissions Editor,” c/o MSDN Magazine, 16261 Laguna Canyon Road, Ste. 130, Irvine, CA 92618. Legal Disclaimer: The information in this magazine has not undergone any formal testing by 1105 Media, Inc. and is distributed without any warranty expressed or implied. Implementation or use of any information contained herein is the reader’s sole responsibility. While the information has been reviewed for accuracy, there is no guarantee that the same or similar results may be achieved in all environments. Technical inaccuracies may result from printing errors and/or new developments in the industry. Corporate Address: 1105 Media, Inc., 9201 Oakdale Ave., Ste 101, Chatsworth, CA 91311, www.1105media.com Media Kits: Direct your Media Kit requests to Matt Morollo, VP Publishing, 508-532-1418 (phone), 508-875-6622 (fax), [email protected] Reprints: For single article reprints (in minimum quantities of 250-500), e-prints, plaques and posters contact: PARS International, Phone: 212-221-9595, E-mail: [email protected], www.magreprints.com/ QuickQuote.asp List Rental: This publication’s subscriber list, as well as other lists from 1105 Media, Inc., is available for rental. For more information, please contact our list manager, Merit Direct. Phone: 914-368-1000; E-mail: [email protected]; Web: www.meritdirect.com/1105 All customer service inquiries should be sent to [email protected] or call 847-763-9560. Printed in the USA ,7·6(9(5<:+(5( &RGH,W·VXVHGWRFUHDWHWKHWKLQJVWKDWDUHDOODURXQGXV $OPRVWHYHU\ZKHUH\RXORRNLW·VWKHUH-XVWOLNHWKHSRVVLELOLWLHV \RXVHHDVDGHYHORSHU:LWK9LVXDO6WXGLR\RXFDQUHDOL]H \RXUYLVLRQZLWKQHZWRROVWKDWZLOOGUDPDWLFDOO\LPSDFWWKHZD\ \RXZRUNIURPGHVLJQWRGHYHORSPHQWWRGHSOR\PHQW /,)(581621&2'( :+$7:,//<28'2:,7+9,68$/678',2" *HWVWDUWHGDW9LVXDO6WXGLRFRP S N A P I T >6QDSWKLVWDJWRJHWWKHODWHVWQHZVRQ9LVXDO6WXGLRRU7H[W96WR @ *HWWKHIUHHDSSIRU\RXUSKRQHDWKWWSJHWWDJPREL 6WDQGDUGPHVVDJLQJDQGGDWDFKDUJHVDSSO\ Untitled-1 1 3/25/10 10:38 AM EDITOR’S NOTE KEITH WARD We’re All Ears One of the most important parts of my job as editor in chief is oft en from the minority, making that group seem larger than it listening to you. As in, You the Readers. Th is magazine’s value is is. Th e other possibility, of course, is that the response properly in presenting the kind of information that helps you better do refl ects our readers, and we do need more articles dealing with lower- your primary job; for most, that means sharpening your soft ware level topics. Again, this is something we cover in the magazine; the development skills. question is how oft en we should dip into that well. Over the past half-year or so, I’ve been talking to readers, and, especially, reading your e-mail comments about ways to improve Existing products/technologies vs. new/future products the magazine (keep those comments coming to mmeditor@ and technologies. Do you prefer more coverage of products microsoft .com). I’ve gathered enough information from various and technologies you’re using day-to-day, or more looking-ahead sources now to get an idea of what many of you are looking for. coverage so you can get an idea of what else is out there that you’d Th e next step is to ask you which of these things you’d most like to like to try out? see in the magazine. More coverage of non-C# languages. Our core coverage, at We won’t be totally upending least for the foreseeable future, will feature C#. Of course, we do have articles that use other languages like F#, where those languages are the ship if we change a the most appropriate to use for a given task. And we have regular coverage of Visual Basic through our Basic Instincts column. little rigging. A number of readers, however, have stated their desire to have more regular coverage of C# alternatives, particularly C++. Also, remember that we won’t be totally upending the ship if we What do you think: Would you like to see a regular column cover- change a little rigging. What I mean is that any changes we make ing C++ programming, or are you fi ne with the occasional C++, like in our coverage will be gradual and incremental. If we add some the one we ran in April on new C++ features in Visual Studio 2010 more C++ articles, we won’t be doing drastically fewer C# stories, (msdn.microsoft.com/magazine/ee336130)? Or do you feel we have the for example. Th is is a fi ne-tuning process, to make sure this is your right mix? must-read magazine each month. I encourage you to take a little time when you can and let us know your feelings on these topics. Articles targeted toward beginning or inexperienced To paraphrase the inimitable Frasier Crane: We’re listening. developers. Numerous readers have expressed their frustration One final note: I’ll be at Tech·Ed this June, and would love to that too much of our content is over their heads, and they’d like chat with you in person. Look for me in the 1105 Media booth, to see more coverage of basic development or coding practices. and other places. If you see me, please grab me (gently) so we Th is is a tricky problem. Th e reason is that people who are can talk a bit. I hope I get a chance to speak with many of you dissatisfi ed with something are much more likely to speak up there. If you’re unable to make it, be sure to drop me a line at than those who aren’t.