<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="2.0">
  <channel>
    <lastBuildDate>Fri, 29 Apr 2011 03:38:03 GMT</lastBuildDate>
    <copyright>Copyright (c) 2009, Nikhil Kothari</copyright>
    <description>Contains all posts from my weblog.</description>
    <generator>Nikhil's Blog Engine v1.1 (http://www.nikhilk.net)</generator>
    <link>http://www.nikhilk.net</link>
    <managingEditor>nikhilk@winisp.net</managingEditor>
    <title>Nikhil Kothari's Weblog</title>
    <webMaster>nikhilk@winisp.net</webMaster>
    <item>
      <category>Script#</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=268#Comments</comments>
      <description>&lt;p&gt;At MIX11, I presented a session on &lt;a href="http://projects.nikhilk.net/ScriptSharp"&gt;Script#&lt;/a&gt; titled &amp;quot;&lt;a href="http://channel9.msdn.com/events/MIX/MIX11/HTM16" target="_blank"&gt;Script#: Compiling C# to JavaScript&lt;/a&gt;&amp;quot; ... and I did a follow up blog post highlighting the &lt;a href="ScriptSharp-MIX11.aspx"&gt;key points&lt;/a&gt; from the presentation.&lt;/p&gt;
&lt;p&gt;This blog post covers the Hello World demo, which will show how you can get started with script#, and deploy scripts authored using this approach. It doesn't go into more advanced topics, but hopefully it will also demonstrate a couple of key principles at play:
&lt;ol&gt;
&lt;li&gt;Script# doesn't introduce some new and odd abstractions. You're still very much authoring script against the DOM and standard APIs, and existing knowledge of web development carries forward.&lt;/li&gt;
&lt;li&gt;The generated script is similar to script you might have authored directly, and can be distributed or deployed into a web application like any other script library, without a dependency on the compiler at runtime.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;p&gt;Script# enables you to leverage Visual Studio, C# syntax and existing familiar and robust set of .NET tools to scripting. In my MIX talk, I demonstrated some of this.  In this post, you'll see some basic benefits such as intellisense and compile errors.&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/ScriptSharp-Getting-Started.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=268</guid>
      <link>http://www.nikhilk.net/ScriptSharp-Getting-Started.aspx</link>
      <pubDate>Fri, 29 Apr 2011 03:38:03 GMT</pubDate>
      <title>Getting Started with Script#</title>
    </item>
    <item>
      <category>Presentations</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=267#Comments</comments>
      <description>&lt;p&gt;At MIX11 last week, I presented the &lt;a href="http://channel9.msdn.com/events/MIX/MIX11/HTM16" target="_blank"&gt;Script#: Compiling C# to JavaScript using Visual Studio&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As full-fledged script-based development becomes widespread with the HTML5 wave, a couple set of interesting questions emerge - what are the development tools you and your team uses to productively author and manage a code base? Shouldn’t you write code in a model that is optimized for development and productivity and let a compiler do its magic and produce code that is optimized for deployment and runtime?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://projects.nikhilk.net/ScriptSharp"&gt;Script#&lt;/a&gt; allows you to write your code in C# and compile it down to deployable JavaScript, it also unlocks the power of C#, Visual Studio and existing .NET tools for scripting scenarios.&lt;/p&gt;
&lt;p style="text-align: center"&gt;&lt;img src="/Content/Presentations/MIX11/IDETools.png" alt="Development with Script#" /&gt;&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/ScriptSharp-MIX11.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=267</guid>
      <link>http://www.nikhilk.net/ScriptSharp-MIX11.aspx</link>
      <pubDate>Tue, 19 Apr 2011 13:11:30 GMT</pubDate>
      <title>Script# at MIX11</title>
    </item>
    <item>
      <category>Presentations</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=266#Comments</comments>
      <description>A brief note about my session on script# at MIX11 next week... (while also reviving the blog)&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/MIX11.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=266</guid>
      <link>http://www.nikhilk.net/MIX11.aspx</link>
      <pubDate>Sun, 10 Apr 2011 20:30:04 GMT</pubDate>
      <title>MIX '11 Plans</title>
    </item>
    <item>
      <category>ASP.NET</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=265#Comments</comments>
      <description>&lt;p&gt;&lt;img src="/Content/Posts/WebMatrix/WebMatrixStart.png" alt="WebMatrix Start Screen" style="float: right; margin-left: 10px; margin-bottom: 10px" /&gt;The WebMatrix announcement last week triggered a range of reactions on Twitter. It also brought back some personal memories.&lt;/p&gt;
&lt;p&gt;A decade ago (wow), I started a little tool to simplify using and developing asp.net server controls as a side project, and it grew bigger and was eventually released using the name &amp;quot;WebMatrix&amp;quot;. It was a fun project, and my first "serious" side project so to speak. There were a few interesting things we did there, both technical and non-technical. It is great seeing similar things happening in this generation of &lt;i&gt;WebMatrix branded tooling&lt;/i&gt;. :-)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Vertical and Scenario-Focused Tooling&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I personally think having a variety of tools is good, especially if they can focus on different verticals, and are optimized for different scenarios/tasks. There is a saying - use the right tool for the job. And the reality is there is a wide spectrum of developers and correspondingly a breadth of requirements and expectations. Lots of professional/enterprise developers will find Visual Studio and its rich set of features + ecosystem a must-have for their work. At the same time, there is a huge number of Web developers, designers and scripters that primarily use Notepad, Textmate or a simple text editor to quickly build and manage their web sites and applications. For those folks, the simplicity that comes from the minimal set of options is a feature in itself. WebMatrix caters to that huge audience. This is true today, and was true back then.&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/WebMatrix-Thoughts.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=265</guid>
      <link>http://www.nikhilk.net/WebMatrix-Thoughts.aspx</link>
      <pubDate>Mon, 12 Jul 2010 04:13:32 GMT</pubDate>
      <title>Thoughts on WebMatrix</title>
    </item>
    <item>
      <category>ASP.NET</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=264#Comments</comments>
      <description>&lt;p&gt;&lt;img src="/Content/Posts/Samples/HTTPPipeline.png" alt="HTTP Request Processing Pipeline" style="float: right; margin-left: 10px; margin-bottom: 10px" /&gt;The ASP.NET pipeline allows HTTP modules to plug in into the request processing lifecycle and do work at various stages. For example, output caching, authentication, authorization etc. are all implemented as HTTP modules.&lt;/p&gt;
&lt;p&gt;However one of the problems is that HTTP modules must be registered in configuration. This is a little painful for writing framework components where an HTTP module is essentially an implementation detail.  You don't want every app developer using your framework to have to add in some configuration entries. What you want is the ability to programmatically add HTTP modules to the pipeline. This isn't available out-of-the-box today.&lt;/p&gt;
&lt;p&gt;I faced this problem in my previous post around &lt;a href="RIAServices-Authentication-Roles.aspx"&gt;RIA Services, Authentication and Roles&lt;/a&gt;, as I needed to handle the PostAuthenticateRequest event. This seems to have come up before (for example &lt;a href="http://stackoverflow.com/questions/239802/programmatically-register-httpmodules-at-runtime" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://stackoverflow.com/questions/2521318/dynamic-adding-httpmodules-and-httphandlers" target="_blank"&gt;here&lt;/a&gt; on stack overflow).&lt;/p&gt;
&lt;p&gt;So in the interim, we can use the new, and somewhat obscure, ASP.NET 4.0 feature, the &lt;a href="http://haacked.com/archive/2010/05/16/three-hidden-extensibility-gems-in-asp-net-4.aspx" target="_blank"&gt;PreApplicationStartMethodAttribute&lt;/a&gt;, that lets you declare some code you want to run &lt;i&gt;early&lt;/i&gt; in the initialization phase of your web application, even before any dynamic compilation happens and before any application startup code runs. Combine that capability with an HttpApplication that supports registering HTTP modules programmatically, as we're in business. I wrote DynamicHttpApplication that provides this API (link to code below):&lt;/p&gt;
&lt;p&gt;&lt;pre&gt;
&lt;span style="color: #0000ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;abstract&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;class&lt;/span&gt; DynamicHttpApplication : HttpApplication {
    &lt;span style="color: #0000ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; RegisterModule(Func&amp;lt;HttpApplication, IHttpModule&amp;gt; moduleFactory);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/Config-Free-HttpModule-Registration.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=264</guid>
      <link>http://www.nikhilk.net/Config-Free-HttpModule-Registration.aspx</link>
      <pubDate>Thu, 01 Jul 2010 14:29:57 GMT</pubDate>
      <title>Config-free IHttpModule Registration</title>
    </item>
    <item>
      <category>Silverlight</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=263#Comments</comments>
      <description>&lt;p&gt;When I posted my &lt;a href="RIAServices-Authentication.aspx"&gt;RIA Services and Authentication&lt;/a&gt; post earlier in the week (which I highly recommend checking out first if you haven't), the first comments/tweets I saw indicated people also want to see roles working in the application. So I decided to add this bit of functionality, both in the Book Club application and the supporting functionality in the RIAEssentials framework, so you can use it easily in your own applications as well.&lt;/p&gt;
&lt;p&gt;From a scenario perspective, what I am going to do is require an Admin role to browse and add book club members.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Adding and Using Roles&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The first step is to update the AuthenticationService implementation I showed earlier to add roles into the authentication process. It only requires quite literally a couple of minor tweaks, th. The added lines are shown in bold:&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/RIAServices-Authentication-Roles.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=263</guid>
      <link>http://www.nikhilk.net/RIAServices-Authentication-Roles.aspx</link>
      <pubDate>Wed, 30 Jun 2010 20:12:20 GMT</pubDate>
      <title>RIA Services and Authentication - Part 2 (Using Roles)</title>
    </item>
    <item>
      <category>Silverlight</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=262#Comments</comments>
      <description>&lt;p&gt;Authentication is the third in a series of posts covering the key concepts of RIA Services using the Book Club application to digger deeper and go beyond the basics. Links to the first two posts on validation and authorization as well as an overview of the application/source code are at the end of this post.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Authentication Overview&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Like authorization, RIA Services provides a higher level programming model, and out-of-the-box, but extensible solution. Authentication answers the question:
&lt;blockquote&gt;&amp;quot;Do these credentials represent a valid user?&amp;quot;&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;Credentials might be user name and password, or any other piece of data that can be used to verify that the user is who he/she says they are. Generally, a side-effect of authentication is to produce a representation of the user, usually represented as an IPrincipal, as well as establishing an authenticated session for the client to use in making subsequent requests.&lt;/p&gt;
&lt;p&gt;RIA Service defines an authentication service as a domain service that implements IAuthetication&amp;lt;TUser&amp;gt; where TUser is application's notion of a user that brings  together identity, roles and settings that span across client and server.&lt;/p&gt;
&lt;p&gt;RIA Services also provides an out-of-box implementation based on the standard asp.net membership, roles and profile infrastructure services. If you use the business application template, this is all setup for you by default. However RIA Services also lets you implement your own authentication service when you want to use your own custom credential store, or a different authentication mechanism such as OpenID.&lt;/p&gt;
&lt;p&gt;This post covers using authentication and the User object on client and server, as well as building a custom forms authentication service that works against the application's data model.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Using Authentication on the Client&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Content/Presentations/MIX10/AuthenticationClient.png" alt="Login Control" style="float: right; margin-left: 10px;" /&gt;
I created an inplace-LoginControl with a number of visual states (Unauthenticated, CredentialInput, Authenticating and Authenticated) as shown here.&lt;/p&gt;
&lt;p&gt;Authentication functionality is accessed through a class called WebContext on the client. WebContext represents the functionality provided by the home web server to the client application. This is how WebContext is initialized in the application:&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/RIAServices-Authentication.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=262</guid>
      <link>http://www.nikhilk.net/RIAServices-Authentication.aspx</link>
      <pubDate>Sun, 27 Jun 2010 22:51:26 GMT</pubDate>
      <title>RIA Services and Authentication</title>
    </item>
    <item>
      <category>Silverlight</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=261#Comments</comments>
      <description>&lt;p&gt;This post digs deeper into the Book Club application from the perspective of the authorization feature of RIA Services. You can check out more information about the application via its &lt;a href="RIAServices-BookClub-TOC.aspx"&gt;associated table of contents&lt;/a&gt; post.&lt;/p&gt;
&lt;p&gt;The post covers how the out-of-box authorization rules can be applied, how custom rules that can be implemented, how custom rules can use additional bits of information in their implementation, and how client-side UI can be customized to account for authorization.&lt;/p&gt;
&lt;p&gt;The sample application has been updated, so you might want to download the latest release of the code from the &lt;a href="http://riaservices.codeplex.com" target="_blank"&gt;RIA Services Essentials&lt;/a&gt; project on CodePlex or browse the &lt;a href="http://riaservices.codeplex.com/SourceControl/changeset/changes/69012" target="_blank"&gt;checkin history&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Authorization and validation share a lot of common concepts and patterns, so the deep dive into &lt;a href="RIA-Services-Validation.aspx"&gt;validation with RIA Services&lt;/a&gt; might be particularly interesting.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Authorization Overview&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Authorization allows you to secure operations and data in your application based on the authenticated user. It essentially answers the question:&lt;/p&gt;
&lt;blockquote&gt;&amp;quot;Can X do Y [with Z]?&amp;quot;&lt;/blockquote&gt;
&lt;p&gt;where X is the user (the &lt;i&gt;subject&lt;/i&gt;), Y is the operation (the &lt;i&gt;verb&lt;/i&gt;), and optionally, Z is the entity being operated upon (the &lt;i&gt;object&lt;/i&gt;). In RIA Services, each authorization rule encapsulates a specific  question that you can associate your services and its operations with. These rules help create a more complete picture of the domain or application semantics that are being encapsulated within a domain service. Rules are associated with operations as metadata attributes that derive from AuthorizationAttribute.&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/RIAServices-Authorization.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=261</guid>
      <link>http://www.nikhilk.net/RIAServices-Authorization.aspx</link>
      <pubDate>Wed, 16 Jun 2010 07:38:54 GMT</pubDate>
      <title>RIA Services and Authorization</title>
    </item>
    <item>
      <category>Silverlight</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=260#Comments</comments>
      <description>&lt;p&gt;Earlier this week, I published the &lt;a href="http://riaservices.codeplex.com/" target="_blank"&gt;RIA Services Essentials&lt;/a&gt; project on CodePlex to share some sample code. The first sample included is an updated version of the Book Club application.&lt;/p&gt;
&lt;p&gt;This application has become sort of a reference application. It was written to demonstrate some aspects of writing a semi-real-worldish application (note that it is still very much a demo app), but more importantly, demonstrating how you can use RIA Services effectively by going beyond the basics. As such, it isn't meant to be a HelloWorld app, which I agree would be useful. This post is a sort of guide for what is in the sample.&lt;/p&gt;
&lt;p&gt;Here is a list of what the application demonstrates:
&lt;ul style="padding-right: 400px"&gt;
&lt;li&gt;Entity framework data model with one-to-many and many-to-many relationships as well as use of stored procedures&lt;/li&gt;
&lt;li&gt;Local data model augmented/mixed with a web service-based data model (in this case Amazon).&lt;/li&gt;
&lt;li&gt;CRUD and more (queries, insert, update, delete, as well as named update methods, and invoke methods)&lt;/li&gt;
&lt;li&gt;Use of convention and configuration for identifying CRUD operations&lt;/li&gt;
&lt;li&gt;Validation (field level, entity level, operation level, change-set scoped, server-only validation, async validation)&lt;/li&gt;
&lt;li&gt;Custom authentication (i.e. using your DAL/user table, rather than asp.net membership)&lt;/li&gt;
&lt;li&gt;Authorization (including custom authorization rules)&lt;/li&gt;
&lt;li&gt;Using authentication service and your User object in server code&lt;/li&gt;
&lt;li&gt;Usage of DomainServiceFactory&lt;/li&gt;
&lt;li&gt;Exposing reference data&lt;/li&gt;
&lt;li&gt;Presentation model for defining custom (non-DAL) types for use between client and server&lt;/li&gt;
&lt;li&gt;Shared code between client and server for validation rules&lt;/li&gt;
&lt;li&gt;Query limits, and caching&lt;/li&gt;
&lt;li&gt;Using RIA Services with MVVM on the client&lt;/li&gt;
&lt;li&gt;Adding computed properties on Entities on the client along with propagation of change notifications&lt;/li&gt;
&lt;li&gt;&amp;quot;More&amp;quot; style paging (as seen for example on twitter.com)&lt;/li&gt;
&lt;li&gt;Display of pending changes, validation errors&lt;/li&gt;
&lt;li&gt;Reference data used to fill lookup dropdown lists.&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/RIAServices-BookClub-TOC.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=260</guid>
      <link>http://www.nikhilk.net/RIAServices-BookClub-TOC.aspx</link>
      <pubDate>Wed, 09 Jun 2010 19:32:26 GMT</pubDate>
      <title>ToC for the Book Club RIA Services Application</title>
    </item>
    <item>
      <category>Silverlight</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=259#Comments</comments>
      <description>Announcing a CodePlex project with RIA Services sample apps and extensions...&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/RIAServices-CodePlex.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=259</guid>
      <link>http://www.nikhilk.net/RIAServices-CodePlex.aspx</link>
      <pubDate>Mon, 07 Jun 2010 15:38:12 GMT</pubDate>
      <title>RIA Services Samples Project on CodePlex</title>
    </item>
    <item>
      <category>Silverlight</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=258#Comments</comments>
      <description>&lt;p&gt;&amp;quot;Those Who Ship, Win!&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Content/Posts/Images/RIAServicesLogo.png" style="float: right; margin-left: 10px; margin-bottom: 10px" alt="RIA Services" /&gt;This used to be written on a giant poster in the hallways of building 42 (original home of the .net framework) ... should have taken a picture of it while it used to be around. (missed classic photo opportunity - anyone have a shot of it?)&lt;/p&gt;
&lt;p&gt;Today, we delivered one of the most important features, shipping a v1. &lt;b&gt;Yes, WCF RIA Services v1 is done, and shipped!&lt;/b&gt; You can get the final build along with the final build of Silverlight 4 tools, right here on the &lt;a href="http://silverlight.net/riaservices" target="_new"&gt;RIA Services&lt;/a&gt; landing page, that also has links to blogs, tweets, docs, forums and all things RIA Services.&lt;/p&gt;
&lt;p&gt;It has been an exciting ride building this technology from the ground-up, seeing people use it live even with early preview builds, and providing tons of feedback (thanks), and bringing credibility to Silverlight as a line of business application platform. It has also been an interesting learning experience for me personally in many dimensions.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The diagram below captures the essense - what can a framework do by redfining a Rich Internet Application as a single logical application that spans across client and server, and consumes as well as provides data and services. My original &lt;a href="NET-RIA-Services-Vision-Architecture.aspx"&gt;Vision to Architecture&lt;/a&gt; blog post still holds up a year or so later. I'll be doing a follow-up to that post, as well as updating my &lt;a href="RIA-Services-MIX10-Slides-Code.aspx"&gt;Book Club reference app&lt;/a&gt; with a couple of new features, so stay tuned.&lt;/p&gt;
&lt;p style="text-align: center"&gt;&lt;img src="/Content/Posts/RIAServices/RIA.png" alt="A RIA Services Application" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/RIA-Services-V1.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=258</guid>
      <link>http://www.nikhilk.net/RIA-Services-V1.aspx</link>
      <pubDate>Mon, 17 May 2010 17:01:27 GMT</pubDate>
      <title>RIA Services - v1 Shipped!</title>
    </item>
    <item>
      <category>Script#</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=257#Comments</comments>
      <description>A quick heads up on a Script# presentation for the Linked.NET user group on LinkedIn, and some words (ummm... teasers) on the upcoming script# release...&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/ScriptSharp-Upcoming-Release-May-2010.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=257</guid>
      <link>http://www.nikhilk.net/ScriptSharp-Upcoming-Release-May-2010.aspx</link>
      <pubDate>Tue, 04 May 2010 18:32:44 GMT</pubDate>
      <title>Upcoming Script# Release and LIDNUG presentation</title>
    </item>
    <item>
      <category>Silverlight</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=256#Comments</comments>
      <description>&lt;p&gt;&lt;img src="/Content/Presentations/MIX10/Validation.BookClub.png" alt="BookClub Application Screenshot" style="float: right; margin-left: 10px; margin-bottom: 10px" /&gt;Earlier today, my &lt;a href="http://channel9.msdn.com/shows/SilverlightTV/Silverlight-TV-18-WCF-RIA-Services-Validation/" target="_blank"&gt;SilverlightTV recording on RIA Services and Validation&lt;/a&gt; went online. I used validation as a feature area to focus on this first recording on RIA Services, because I think it illustrates both the RIA Services value proposition and key elements of the vision around the project in a very direct manner. Specifically:&lt;/p&gt;
&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Focus on end-to-end solutions for data scenarios&lt;/b&gt;. It is not sufficient to just address querying data or submitting some changes, but about providing the infrastructure for managing data, editing with validation, tracking errors raised on client and/or server, rolling back changes, and more.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The server project and client project are logical halves of the same application&lt;/b&gt;. It would be great to preserve and propagate developer intent, and semantics from the database to the middle tier to the client, and share code across tiers where possible. In other words leverage intent and rules as close to the end-user, while enforcing them at each tier. Automatically.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Provide out-of-box solutions to common scenarios&lt;/b&gt;. The Entity class on the client provides a pretty complete implementation of working with data on the client. It provides identity management, change tracking, change notification, transacted editing and rollback capabilities, as well as tracking and surfacing validation and concurrency conflict errors. In particular, in the context of this post, Entity provides an implementation of infrastructure interfaces such as INotifyDataErrorInfo introduced in Silverlight 4, so you don't have to roll your own.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;In my demo for SilverlightTV, I used a product catalog and product editing scenario (my favorite scenario if you ask folks on the team). However for MIX10, I used a Book Club scenario, which I think is quite a bit more interesting (with the potential to become my new favorite scenario).&lt;/p&gt;
&lt;p&gt;Check out the &lt;a href="http://channel9.msdn.com/shows/SilverlightTV/Silverlight-TV-18-WCF-RIA-Services-Validation/" target="_blank"&gt;video&lt;/a&gt;. And then come back to read further. My &lt;a href="RIA-Services-MIX10-Slides-Code.aspx"&gt;MIX10 summary post&lt;/a&gt; lists everything else going on in the Book Club sample (along with a link to all of &lt;a href="/Content/Presentations/MIX10/BookClub.zip"&gt;the sample code&lt;/a&gt;), but the rest of the post focuses on the validation aspects.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update 3/26/10&lt;/b&gt;: For those looking for a copy of the app demo'd on the SilverlightTV show, you can download the &lt;a href="/Content/Presentations/SLTV.Store.zip"&gt;Store sample&lt;/a&gt;.&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/RIA-Services-Validation.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=256</guid>
      <link>http://www.nikhilk.net/RIA-Services-Validation.aspx</link>
      <pubDate>Thu, 25 Mar 2010 16:39:02 GMT</pubDate>
      <title>RIA Services and Validation</title>
    </item>
    <item>
      <category>Silverlight</category>
      <comments>http://www.nikhilk.net/Entry.aspx?id=255#Comments</comments>
      <description>&lt;p&gt;It looks like I have a set of posts on ViewModel, aka MVVM, that have organically emerged into a series or story of sorts.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Recently, I blogged about &lt;a href="Why-ViewModel.aspx"&gt;The Case for ViewModel&lt;/a&gt;, and another on &lt;a href="View-ViewModel-Hookup-Convention-Configuration.aspx"&gt;View/ViewModel Association using Convention and Configuration&lt;/a&gt;, and a long while back now, I posted an &lt;a href="Silverlight-ViewModel-Pattern.aspx"&gt;Introduction to the ViewModel Pattern&lt;/a&gt; as I was myself picking up this pattern, which has since become the natural way for me to program client applications. This installment adds to this on-going series. I've alluded to this topic in the past, but it is now time to focus and dedicate a post on the interactions between a view and its view model, i.e. the arrows in the diagram below:&lt;/p&gt;
&lt;p style="text-align: center"&gt;&lt;img src="/Content/Posts/SilverlightViewModel/MVVM.png" alt="The ViewModel Pattern" /&gt;&lt;/p&gt;
&lt;p&gt;I like to present ViewModel as something that is not brand-new, but a simple refactoring of [most of the] code-behind into a separate class so that the logic is decoupled from the user interface. This class simply employs the basic OOP constructs that you might have encountered in CS101 - it encapsulates state and behavior, exposed via properties, methods and events.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;As simple as properties, methods and events...&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;All view models will encapsulate some interesting application state or data, exposed as properties, usually, in an observable form, i.e. properties that raise change notifications. Almost all view models will also expose some operations, ideally exposed as vanilla methods. And finally, some view models will also raise application-specific notifications as events.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Declarative glue...&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;A view is then responsible for consuming and working against the object model exposed by its view model as it presents information, and collect and react to user input, gestures etc. The data-binding engine in Silverlight makes it natural to bind to the properties in one-way or two-way fashion. Commands (in the UI, not in the view model - will address this below) allow invoking operations, usually in response to some user input or external inputs (eg. a timer or GPS input). Finally triggers allow the view to listen to events and translate view model notifications into user interface actions. All of these serve as glue expressed in XAML via declarative markup.&lt;/p&gt;
&lt;p&gt;This is captured in the diagram above. Bindings are fairly straightforward and you've more than likely used them if you've done any Silverlight programming. So I am mostly going to focus on commands and triggers, but first, lets see this pattern in action.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;An example application...&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/Content/Posts/SilverlightViewModel/Translate.png" alt="Translation Application Screenshot" style="height: 400px; float: right; margin-left: 10px; margin-bottom: 10px" /&gt;As always, an example helps make things concrete. I converted &lt;a href="http://timheuer.com/blog/archive/2010/03/22/silverlight-translator-text-to-speech-api.aspx" target="_blank"&gt;Tim Heuer's translation/text-to-speech application&lt;/a&gt; to follow the view model. In doing so I used the latest release of &lt;a href="http://projects.nikhilk.net/SilverlightFX"&gt;Silverlight.FX&lt;/a&gt; - while the ViewModel is an abstract presentation, it is useful to pick up a framework that allows you to quickly get started with your application, rather than build the plumbing from scratch.&lt;/p&gt;
&lt;p&gt;On the right is a screen shot of the application. It is also now included as part of a series of sample applications packaged with Silverlight.FX. You can dowload the latest version (v3.5) by visiting the project page. I'll have a Silverlight 4 version that takes advantage of new capabilities, but in the mean time the Silverlight 3 version should continue to work. The sample application here uses v2 of &lt;a href="http://www.microsofttranslator.com/mix2010/" target="_blank"&gt;Microsoft Translator API&lt;/a&gt;, which now has support for not just translating text, but also converting text to speech for a specific set of languages. You'll need to get an &lt;a href="http://msdn.microsoft.com/en-us/library/ff512386.aspx" target="_blank"&gt;API key&lt;/a&gt; and update the web.config in the sample on your end to run the application.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Content/Posts/SilverlightViewModel/TranslateVM.png" style="float: left; margin-right: 10px; margin-bottom: 10px" alt="TranslateWindowModel Object Model" /&gt;&lt;/p&gt;
&lt;p style="clear: right"&gt;The class diagram of the view model highlights the interesting things going on in the view model:&lt;/p&gt;
&lt;p&gt;In terms of application state, it exposes the text to be translated, the resulting translated text, the list of languages, and whether the speak operation can be performed. In terms of operations, it provides the ability to perform translation, or to speak (as in produce the audio stream) the translated text. Finally in terms of notifications, it lets its associated view know when that audio stream has been loaded and is available for playing.&lt;/p&gt;
&lt;br /&gt;[&lt;a href="http://www.nikhilk.net/View-ViewModel-Interaction.aspx"&gt;Full post continued here...&lt;/a&gt;]</description>
      <guid isPermaLink="true">http://www.nikhilk.net/Entry.aspx?id=255</guid>
      <link>http://www.nikhilk.net/View-ViewModel-Interaction.aspx</link>
      <pubDate>Wed, 24 Mar 2010 07:12:42 GMT</pubDate>
      <title>View/ViewModel Interaction - Bindings, Commands and Triggers</title>
    </item>
  </channel>
</rss>
