Rants

1  2  3  4  5  6  7  8  9  10  11  +  >  >>  (Total Pages: 120/Total Results: 1191)

MIX 10 Wrapup

MIX10

MIX 10 is over and lots of blogs are listing all the interesting links and discussions that happened at MIX. I don't want to duplicate that, but instead thought i'd tell what I think are the big stories.

The Phone

While the Windows Phone 7 Series (hrmph, why must you name things like this Microsoft?) had it coming out party before MIX but this is where the developer story became real.

I believe that the Phone is a big deal because (unlike Android which I have and like), the phone is not a 'me too' release. The phone was designed with a different use case.  It gets away from the purely "App" idea (as in some apps will just integrated with the phone's collections like the NetFlix app). And of course the development story is the best in the mobile space. VS based development is likely to be the easiest to build code for a phone. 

But it all depends on how they deliver it. You'll see a lot more here about my experience with the phone coming soon.

Silverlight 4

With the release of the RC of Silverlight 4 (and the promise of RTM by next month), we're all now in Silverlight 4 land. The new Blend 4 Beta has some nifty tricks up its sleeve so take a look at that as well.

OData

I was glad to see that OData got its coming out party at MIX too. I was suprised by the reaction to it.  Some people loved the idea of a common format/query for data. But the demo that Doug Purdy did that got Twitter fluttering was that you could craft LINQ queries over OData sources.  This surprised me because I've been teaching people for three years now that LINQ over Data Services (e.g. OData) is cool.  Guess I haven't done my job well enough yet ;) 

My Talks

I did two talks and now they're available as videos: 

My Silverlight Security Talk:

 My Silverlight Debugging Talk:

AgiliTrain Announces Two New Windows Phone Courses

AgiliTrain

I am very proud to announce that AgiliTrain is announcing two new workshops for Silverlight developers to write applications for the upcoming Windows Phone 7 Series.

The two new workshops are focused on getting developers up to speed on developing applications with Silverlight for the phone.  The two courses are:

Silverlight for the Windows Phone

May 10-12, 2010

The Silverlight Tour for Windows Phone is a three-day, soup-to-nuts breakdown of application development for the phone. This includes learning the ins and outs of XAML, interacting with the phone's services, using the tools and using Silverlight on the server. The class utilizes the Silverlight as well as the latest toolset from Microsoft (including Visual Studio 2010 and Expression Blend 4).

Windows Phone QuickStart

May 13, 2010

The Windows Phone Quickstart is a one-day workshop to get existing Silverlight Developers ready to write applications for the new Windows Phone 7 Series phones. The workshop includes coverage of writing new applications, porting new ones and interacting with the phone.

 

 

AgiliTrain is Giving Away Three Seats to Silverlight Courses

AgiliTrain

During the three days of MIX 10, AgiliTrain will be giving away a seat per day of the event to people who follow them on Twitter (@AgiliTrain).

To qualify, you must be a follower of the AgiliTrain twitter account by the end of of each day at MIX (by 8pm PST). For each winner, they receive free entrance to any Silverlight Course of their choice that is given by AgiliTrain.

Follow @AgiliTrain now to qualify!

The Busy Developer's Guide to SQL Server Modeling

SQL Server Modeling

As my continued facination with all things SQL Server Modeling related, I was tasked with writing a short article on the introduction of the basics of SQL Server Modeling for the developer.  The result is the article "The Busy Developer's Guide to SQL Server Modeling" that was released on MSDN today. It is short so you can get the big details without investing a month learning the technology. Let me know what you think!

 

Where to See Me At MIX10

MIX10 Love Fest!

This weekend i am headed to Vegas for a week of designer/developer love. I plan to spend a lot of time in the phone sessions as well as in the Commons visiting with people.

This year's MIX has be really excited about both Silverlight 4's continued maturation as well as the XNA/Silverlight 4 story on the phone. I really want to connect with designers who have spent a year with Sketchflow and see how the tool is working in their 'day jobs'.

Not coincidently I am also speaking at MIX this year. My talks are:

Debugging Microsoft Silverlight Applications

Time: Tuesday at 1:30 PM

Location: Lagoon B

Building Silverlight apps is one thing, but what happens when you get stuck? That's where debugging comes into the picture. In this mini-talk, Shawn shows you how to do simple debugging of Silverlight code, debug data binding/validation problems, and how to debug Windows Communication Foundation (WCF) Services.

This is a twenty-five minute talk where I hope to help you figure out some of the debugging mysteries of Silverlight.

Securing Microsoft Silverlight Applications

Time: Tuesday at 3:00 PM

Location: Lagoon F

Come hear how to protect Silverlight applications from common threats including securing your application from intruders, eavesdroppers and users as well as protecting your code, your data and your servers from attacks. Also, hear about the key security vectors that must be considered when using Silverlight such as securing applications that often live outside firewalls.

The Rest of the Time

During the rest of the conference I will be around and at as many parties as possible...it is Vegas after all. If you want to find me, either follow my tweets, my FourSquare checkins or my Glympses (see my Twitter feed for Glympse notifications).

 

My "What's New in Silvelright 3" Video from 0reDev Last Fall

Last fall I visited 0redev in Sweden and gave a "What's New in Silverlight 3" talk. THey've just released the video if you interested in wathcing it:

Shawn Wildermuth - What's New in Silverlight 3 from Øredev on Vimeo.

Now that Silverlight 3 is available, learning all the new features can be a chore. In this talk I will walk through all the new features and show you the most compelling pieces from both Silverlight 3 and Blend 3.

This Week in Silverlight

Sparkling Client

Erik Mork, Brian Henderson and Kelly White are doing a weekly podcast on what is new in the Silverlight community each week. This week they discuss the upcoming rumors about MIX and the plethora of CodeCamps coming up.  Check it out (and subscribe):

http://www.sparklingclient.com/silverlight_augmented_reality_and_mix_rumors/

Portland Silverlight Users Group

Silverlight Logo

I just got back from the west coast and while there I had the opportunity to speak at the Portland Silverlight Users Group.  It was a Q&A session and I had a lot of fun answering those questions. Other than questions I couldn't share information about, the most common questions were about hwo to implement MVVM.  I decided to do my 45 minute walkthrough of MVVM and built a simple editor using MVVM.  For all of you at the meeting that wanted the source, you can find it here:

http://wildermuth.com/downloads/PortlandGameEditor.zip

I can't wait to be asked back!

WCF Data Services and jQuery

SilverlightI'd recently been asked by Chris Sells to help him with a simple WCF Data Services/jQuery example so I thought I'd share it via my blog as well. The basic idea is to use jQuery's AJAX functionality to retrieve JSON instead of the usual OData and consume it on a web page.

The example I decided on using is to expose the XBox database with paging. I am not doing any of the niceties like getting result counts to show a real navigation bar.  Instead this is quick and dirty to simply do "next" and "prev" and use WCF Data Service's URI API to retrieve data.

Like most of my XBox examples, I am using the Entity Framework to simply expose three entities types (Games, Genres and Ratings). Then I utilize a WCF Data Service to expose these types for consumption via REST.  My HTML is simple:

<h2>
  XBox Games</h2>
<div>
  <a href="#" id="PrevPage">Prev</a>
  <a href="#" id="NextPage">Next</a>
</div>
<div id="gameTable" />

The gameTable will simply be filled with a simple TABLE element for our data. So to the jQuery we go.  I am using plain jQuery 1.3.2 (though plugins could be used to simplify some of this code, I choose to just do it raw for simplicity).

First I set up a couple of variables to hold our paging information:

// globals for paging
var page = 0;
var pagesize = 25;

Next I handle the document's ready function to do some work when the initial page load is complete:

// Loads once the document has completed loading
$(document).ready(function () {
  
  // Set up paging buttons
  $('#PrevPage').click(function (evt) {
    // Stop the navigation from happening
    evt.preventDefault();
    if (page > 0) {
      page--;
      loadData();
    }
  });
  $('#NextPage').click(function (evt) {
    evt.preventDefault();
    page++;
    loadData();
  });
  
  // Load the initial data
  loadData();
});

When setting up the paging buttins, I use the '#PrevPage' and '#NextPage' CSS selectors to find items named PrevPage and NextPage and wire up the event to cause the page changes to happen.  The 'evt.preventDefault()' call stops the buttons from trying to navigate since we're using them as buttons.  FInally once we change the current page value, we call loadData (or in the initial case, call loadData with the default values).

function loadData() {
  var url = "/GameService.svc/Games?$orderby=Name" +
             "&$skip=" + (page * pagesize) + 
             "&$top=" + pagesize;
  $.ajax({
    type: "GET",
    url: url,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (msg) {
      loadTable(msg.d);
    }
  });
}

In the loadData function, I first create the URL by using the Data Service/OData URL API to retrieve games by Name while using the global values to retrieve a page of data at a time (see the $skip and $top parameters). Once the URL is defined, jQuery's ajax function executes the URL and returns in the success function in which we call loadTable to create the table for us. Since the returned JSON is contained in a 'd' element for security, we de-reference the 'd' element before we sent it into the loadTable function.

function loadTable(results) {
  var table = '<table><thead><tr><th>Name</th>' + 
              '<th>Publisher</th><th>Box</th></thead><tbody>';

  for (var post in results) {
    var row = '<tr>';

    row += '<td>' + results[post].Name + '</td>';
    row += '<td>' + results[post].Publisher + '</a></td>';
    row += '<td><img src="' + results[post].ImageUrl + 
           '" style="width: 100px; height=150px" /></td>';

    row += '</tr>';

    table += row;
  }

  table += '</tbody></table>';

  $('#gameTable').html(table);

}

Finally in loadTable some simple HTML construction goes on to create a table with our results.  The for loop returns a iterator for each row in the collection which we can use to retrieve the individual item (see results[post].Name as an example). Once the table is built, it replaces the contents of the element named gameTable with the new table.

Because WCF Data Services will return JSON as well, you can use it to do AJAX work just as effectively as Silverlight can consume it for rich client work.  You can get the code here:

http://wildermuth.com/downloads/DataServiceJQuery.zip

 

The State of Data Access in Silverlight

SilverlightI've said much about my opinion of Silverlight data access. Currently this is Web Services, WCF Data Services and WCF RIA Services. Let's talk about Data Services and RIA Services and how they are related:

WCF Data Services

Data Services are a good story in Silverlight, but only as of version 2.0 of the protocol. For those users of version 1.0, using Data Services was painful as automatic tracking did not exist yet. Data Services can create not only the data contract classes, but a context object that will do tracking and batching for you.  The basic story of how Data Services works is that it takes a context object from a LINQ provider and exposes all the IQueryable endpoints as REST resources that can be queried. This works well in creating a place to execute queries and post/put/delete changes. While Data Services' URI API is another skill that could be learned, the Silverlight (and .NET) client library allows you to just issue LINQ queries to the data service.  In addition, the ability to create client-designed graphs (e.g. embed relationships for eager loading) and navigate relationships to the server presents a good API for a data-centric application today.

The method for connecting to a data service is via a "Add Service Reference..." which means that it is easy to have data services projects that are outside a particular solution file. This is critical for when you are building very large projects.

One of my favorite things about Data Services today is the ability to create tracked projections from the Silverlight client:

var qry = from g in ctx.Games
          where g.ReleaseDate <= cutoffDate
          orderby g.ReleaseDate
          select new 
         {
           Name = g.Name,
           Id = g.Id,
           ReleaseDate = g.ReleaseDate
         };

This projection (which minimizes the data being sent over the wire from a Games entity), can be tracked like any other entity. This is a big boon for Silverlight clients where we want to reduce the surface area of the data being sent over the wire.

WCF Data Services' standard wire protocol is OData (which is a variant of ATOM). This means that tools like PivotTable, code-name Dallas and others can co-mingle data with other systems that are supporting OData like SharePoint, WebSphere, OpenGovernment project and SQL Azure table storage.

Some of the problems with Data Services include the fact that Service Operations are not part of the Silverlight proxy (and are not completely supported by the client library); any validation attributes of model information (like string length) are left on the client; and having to wrap your collections as DataServiceCollections to support tracking.

While I think Data Services still represents a major case for Silverlight usage, it still has a way to go before I am completely satisfied.

WCF RIA Services

WCF RIA Services takes a different approach to data access the resembles a mix of Data Services and Web Services. In RIA Services a server project is set up to expose data across the wire, but instead of Data Services' approach of exposing queryable end-points, it creates methods on the server which can be executed to retrieve, update, insert and delete data. These methods can be crafted to take specific parameters which takes some of the responsibility for what to query out of the hands of the developer (which may be fine in some cases). RIA Services does take model constraints and validation attributes and generate them in the client, which is a big win.  Also, RIA Services is like Data Services in that you can still do basic sorting, filtering and paging via the service.

The way that RIA Services is wired up to a project (via a Shared Code folder that is generated as the server-side project changes) is sexy, but for large projects the need to keep the RIA Services' project in the same solution (or use a project file hack to get it working) becomes an issue.

RIA Services is really built for the RIA Services' DomainContext to be the center of the application (which you can see when you look at demos utilizing their Data Source object that automatically wires up data as XAML elements). While you can write a loosely coupled application, it takes planning and is not the natural design of the API.

Other issue I have is with the design of the Load API where the attempt is made to hide the asynchronicity of the call.  The problem is that when errors happen on the load operation, it is hard to capture the error (other than letting it be cause as a top-level exception) so that most users will need to provide a callback which is just like having a full asynchronous operation. No better than before but the principle of least surprise isn't followed.

Finally, in comparison with Data Services, RIA Services has a lot of the same features but is missing the ability to do projections, client-defined eager loading and loading properties (e.g. relationships).

What does all this mean?

 So here we sit as Silverlight developers and we are being asked by Microsoft to choose of the three major options for data access. The problem is that none of them are perfect by any stretch of the imagination. I would think that Data Services and RIA Services are both great solutions but they are both missing features the others have.  In some ways the generation of these two projects has caused a lot of confusion as to which is the prescribed method for doing data access in Silverlight. It reminds me of the Entity Framework vs. LINQ to SQL debacle.

But where do we go from here?  I'd like to implore Microsoft to fast-track the work needed to provide parity in these products. That means build the underpinnings of both projects from the same underlying platform. That way the features of each platform could be included in the other. The features do not become the discrimator but instead it is the style of data access.  We want and need the missing features on both platforms:

  • "Add Service Reference..." Linkage to support large development projects.
  • Exposure and code-generation of any EDMX constraints and Validation attributes.
  • Projection and tracked minimizing projection support.
  • Full eager loading and navigation support.
  • Operations and Endpoints have the same level of support in the generated code.
  • Obvious and simple communication APIs to prevent the library from surprising us with error propagation.

...One More Thing

I also have the request that for the next development cycle that we provide secondary methods for communicating validation information than just validation attributes.  Validation attributes cause our server-side POCO classes to be not really POCO (since they have to have a reference to the validation assembly).  As well as most cases require us to use the painful and hacky MetadataClass method of creating a class to *only* hold these attributes. You don't have to get rid of the attributes, just let us feed them to the model in other ways (open the hooks, we'll decide how to communicate it; whether it be a DSL, XML file, database, etc.).

Your Job

As a reader of this blog, I'd like to ask you a favor.  Respond to this blog entry. I want to make sure my frustration with the two data access stacks is not just my annoyance but is causing confusion and pain to you my readers. If you agree, just comment (it can be just saying "I agree") so I can make sure the Data team at Microsoft understands how it impacts Silverlight (and others) development efforts.  Thanks!