MSDN Magazine - February 2009 - (Page 65) metadata. For example, “Oslo” would be a good platform for a repository of machine configuration information that would allow operations staff to query and understand machine configurations easily, or similarly, a repository of operational procedures and scripts. For developers, because the repository provides a unified and queriable store for metadata, it would be possible to answer questions such as “Which applications and classes implement a certain method?” and “Will changing this method impact performance?” Another potential area for employing “Oslo” could be for understanding distributed applications. Combining profiling, code coverage, load testing, and architectural data within the repository will allow developers to, for example, quickly resolve performance issues by browsing to the related distributed component, examining the settings of various configuration parameters, and viewing relevant implementation details. In addition, it will allow for the development of static analysis tools that automatically report design defects. One area that particularly tickles my fancy is deployment and installation. By defining setup packages in a domain-specific language and loading them into the repository, a developer gets the language services of any modern language along with query tools for policy compliance. For example, you could query whether setups are protected with appropriate license agreements. Here’s an example: the Microsoft download center Web site provides for highly scalable downloads for customers. For files to be hosted on that site, they must be packaged in a Microsoft Installer (MSI) file and tagged with an end-user license agreement (EULA). After doing this about half a dozen times using the GUI in Visual Studio, I went looking for an automated solution and found one in Windows Installer XML (WiX), which let me use XML to define the setup and compile it into an MSI. Figure 1 shows an example of the WiX XML. To the untrained eye, this might not seem like an improvement over running a graphical UI, but once you’ve done the same 27 mouse gestures a few times, the programmer in you will take over. Figure 1 WiX XML to Create an MSI File of data: an anonymous integer, an anonymous collection of three integers, and a record named “pt1” with two fields, X and Y, both integers: 42 { 1, 2, 3 } pt1 { X = 10, Y = 20 } MSchema is a language for defining constraints over data. In MSchema, a set of constraints is tied together into a type. Here MGraph and MSchema Even though I can automate creation of the WiX XML to some extent, I don’t really want to write my setups in a sea of angle brackets. “Oslo” lets me write them in “M”, a family of languages including MSchema, MGrammar, and MGraph. (The MSchema and MGrammar specifications can be found at msdn.microsoft.com/library/ dd285282 and msdn.microsoft.com/library/dd129869, respectively.) Let me give you a quick intro to MGraph and MSchema (I’ll explore MGrammar in a future article). If you’d like to play along at home, I highly recommend the Mr. Epl tool that comes with the “Oslo” SDK. (“Mr. Epl” is how we pronounce MREPL.EXE, which stands for M Read-Evaluate-Print-Loop.) You can use it from within the text editor called Intellipad that ships in the “Oslo” SDK by choosing Intellipad (Samples Enabled) from the Start menu, pressing Ctrl+/ to bring up the mini-buffer, and typing “SetMode(‘MScriptMode’)” (no quotes, but case matters), followed by clicking Enter. MGraph is a language for defining instances of structured data (better known as values). In this example, I’ve defined three pieces msdnmagazine.com MGraph is a language for defining instances of structured data (better known as values). I’ve defined two named types, a SmallInteger type that constrains the built in Integer32 type to only those values less than 256, and a Point entity type (the name for record types in M) with two fields, X and Y: type SmallInteger : Integer32 where value < 256; type Point { X : Integer32; Y : Integer32; }; Both X and Y are constrained to hold integer values between -2,147,483,648 and 2,147,483,647. Anyone reading this article is already familiar with the CLR. The CLR uses something called “nominal typing,” that is, naming the single type to which a value belongs. “M,” on the other hand, is based on structural typing, much like XML. In a structurally typed world, a value can belong to any number of types so long as the data February 2009 65 http://msdn.microsoft.com/library/dd285282 http://msdn.microsoft.com/library/dd129869 http://msdn.microsoft.com/library/dd285282 http://www.msdnmagazine.com
Table of Contents Feed for the Digital Edition of MSDN Magazine - February 2009 MSDN Magazine - February 2009 Contents Toolbox CLR Inside Out Data Points Cutting Edge Patterns In Practice Best Practices .Net Interop "Oslo" Basics Patterns Silverlight Under The Table Foundations Windows With C++ .NET Matters Going Places { End Bracket } MSDN Magazine - February 2009 MSDN Magazine - February 2009 - (Page Splash1) MSDN Magazine - February 2009 - Contents (Page Cover1) MSDN Magazine - February 2009 - Contents (Page Cover2) MSDN Magazine - February 2009 - Contents (Page 1) MSDN Magazine - February 2009 - Contents (Page 2) MSDN Magazine - February 2009 - Contents (Page 3) MSDN Magazine - February 2009 - Contents (Page 4) MSDN Magazine - February 2009 - Contents (Page 5) MSDN Magazine - February 2009 - Contents (Page 6) MSDN Magazine - February 2009 - Contents (Page 7) MSDN Magazine - February 2009 - Contents (Page 8) MSDN Magazine - February 2009 - Contents (Page 9) MSDN Magazine - February 2009 - Contents (Page 10) MSDN Magazine - February 2009 - Toolbox (Page 11) MSDN Magazine - February 2009 - Toolbox (Page 12) MSDN Magazine - February 2009 - Toolbox (Page 13) MSDN Magazine - February 2009 - Toolbox (Page 14) MSDN Magazine - February 2009 - CLR Inside Out (Page 15) MSDN Magazine - February 2009 - CLR Inside Out (Page 16) MSDN Magazine - February 2009 - CLR Inside Out (Page 17) MSDN Magazine - February 2009 - CLR Inside Out (Page 18) MSDN Magazine - February 2009 - CLR Inside Out (Page 19) MSDN Magazine - February 2009 - CLR Inside Out (Page 20) MSDN Magazine - February 2009 - CLR Inside Out (Page 21) MSDN Magazine - February 2009 - CLR Inside Out (Page 22) MSDN Magazine - February 2009 - Data Points (Page 23) MSDN Magazine - February 2009 - Data Points (Page 24) MSDN Magazine - February 2009 - Data Points (Page 25) MSDN Magazine - February 2009 - Data Points (Page 26) MSDN Magazine - February 2009 - Data Points (Page 27) MSDN Magazine - February 2009 - Data Points (Page 28) MSDN Magazine - February 2009 - Data Points (Page 29) MSDN Magazine - February 2009 - Data Points (Page 30) MSDN Magazine - February 2009 - Cutting Edge (Page 31) MSDN Magazine - February 2009 - Cutting Edge (Page 32) MSDN Magazine - February 2009 - Cutting Edge (Page 33) MSDN Magazine - February 2009 - Cutting Edge (Page 34) MSDN Magazine - February 2009 - Cutting Edge (Page 35) MSDN Magazine - February 2009 - Cutting Edge (Page 36) MSDN Magazine - February 2009 - Cutting Edge (Page 37) MSDN Magazine - February 2009 - Cutting Edge (Page 38) MSDN Magazine - February 2009 - Patterns In Practice (Page 39) MSDN Magazine - February 2009 - Patterns In Practice (Page 40) MSDN Magazine - February 2009 - Patterns In Practice (Page 41) MSDN Magazine - February 2009 - Patterns In Practice (Page 42) MSDN Magazine - February 2009 - Patterns In Practice (Page 43) MSDN Magazine - February 2009 - Patterns In Practice (Page 44) MSDN Magazine - February 2009 - Patterns In Practice (Page 45) MSDN Magazine - February 2009 - Best Practices (Page 46) MSDN Magazine - February 2009 - Best Practices (Page 47) MSDN Magazine - February 2009 - Best Practices (Page 48) MSDN Magazine - February 2009 - Best Practices (Page 49) MSDN Magazine - February 2009 - Best Practices (Page 50) MSDN Magazine - February 2009 - Best Practices (Page 51) MSDN Magazine - February 2009 - Best Practices (Page 52) MSDN Magazine - February 2009 - Best Practices (Page 53) MSDN Magazine - February 2009 - Best Practices (Page 54) MSDN Magazine - February 2009 - Best Practices (Page 55) MSDN Magazine - February 2009 - Best Practices (Page 56) MSDN Magazine - February 2009 - .Net Interop (Page 57) MSDN Magazine - February 2009 - .Net Interop (Page 58) MSDN Magazine - February 2009 - .Net Interop (Page 59) MSDN Magazine - February 2009 - .Net Interop (Page 60) MSDN Magazine - February 2009 - .Net Interop (Page 61) MSDN Magazine - February 2009 - .Net Interop (Page 62) MSDN Magazine - February 2009 - "Oslo" Basics (Page 63) MSDN Magazine - February 2009 - "Oslo" Basics (Page 64) MSDN Magazine - February 2009 - "Oslo" Basics (Page 65) MSDN Magazine - February 2009 - "Oslo" Basics (Page 66) MSDN Magazine - February 2009 - "Oslo" Basics (Page 67) MSDN Magazine - February 2009 - "Oslo" Basics (Page 68) MSDN Magazine - February 2009 - "Oslo" Basics (Page 69) MSDN Magazine - February 2009 - "Oslo" Basics (Page 70) MSDN Magazine - February 2009 - "Oslo" Basics (Page 71) MSDN Magazine - February 2009 - Patterns (Page 72) MSDN Magazine - February 2009 - Patterns (Page 73) MSDN Magazine - February 2009 - Patterns (Page 74) MSDN Magazine - February 2009 - Patterns (Page 75) MSDN Magazine - February 2009 - Patterns (Page 76) MSDN Magazine - February 2009 - Patterns (Page 77) MSDN Magazine - February 2009 - Patterns (Page 78) MSDN Magazine - February 2009 - Patterns (Page 79) MSDN Magazine - February 2009 - Patterns (Page 80) MSDN Magazine - February 2009 - Patterns (Page 81) MSDN Magazine - February 2009 - Patterns (Page 82) MSDN Magazine - February 2009 - Patterns (Page 83) MSDN Magazine - February 2009 - Silverlight (Page 84) MSDN Magazine - February 2009 - Silverlight (Page 85) MSDN Magazine - February 2009 - Silverlight (Page 86) MSDN Magazine - February 2009 - Silverlight (Page 87) MSDN Magazine - February 2009 - Silverlight (Page 88) MSDN Magazine - February 2009 - Silverlight (Page 89) MSDN Magazine - February 2009 - Silverlight (Page 90) MSDN Magazine - February 2009 - Silverlight (Page 91) MSDN Magazine - February 2009 - Silverlight (Page 92) MSDN Magazine - February 2009 - Silverlight (Page 93) MSDN Magazine - February 2009 - Silverlight (Page 94) MSDN Magazine - February 2009 - Under The Table (Page 95) MSDN Magazine - February 2009 - Under The Table (Page 96) MSDN Magazine - February 2009 - Under The Table (Page 97) MSDN Magazine - February 2009 - Under The Table (Page 98) MSDN Magazine - February 2009 - Under The Table (Page 99) MSDN Magazine - February 2009 - Under The Table (Page 100) MSDN Magazine - February 2009 - Foundations (Page 101) MSDN Magazine - February 2009 - Foundations (Page 102) MSDN Magazine - February 2009 - Foundations (Page 103) MSDN Magazine - February 2009 - Foundations (Page 104) MSDN Magazine - February 2009 - Foundations (Page 105) MSDN Magazine - February 2009 - Foundations (Page 106) MSDN Magazine - February 2009 - Windows With C++ (Page 107) MSDN Magazine - February 2009 - Windows With C++ (Page 108) MSDN Magazine - February 2009 - Windows With C++ (Page 109) MSDN Magazine - February 2009 - Windows With C++ (Page 110) MSDN Magazine - February 2009 - .NET Matters (Page 111) MSDN Magazine - February 2009 - .NET Matters (Page 112) MSDN Magazine - February 2009 - .NET Matters (Page 113) MSDN Magazine - February 2009 - .NET Matters (Page 114) MSDN Magazine - February 2009 - Going Places (Page 115) MSDN Magazine - February 2009 - Going Places (Page 116) MSDN Magazine - February 2009 - Going Places (Page 117) MSDN Magazine - February 2009 - Going Places (Page 118) MSDN Magazine - February 2009 - Going Places (Page 119) MSDN Magazine - February 2009 - { End Bracket } (Page 120) MSDN Magazine - February 2009 - { End Bracket } (Page Cover3) MSDN Magazine - February 2009 - { End Bracket } (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.