Archive for the '.NET' Category

25
Jun

Netflix OData Service Updates

The Netflix OData Service (http://odata.netflix.com/Catalog) was updated this evening with some changes that might affect those of you that have written applications against it. All of the changes were additive (i.e. no properties were renamed or removed from the model), so it should be pretty simple to update your consumer code (famous last words).

There were three main changes made:

  1.  The server-side paging for each of the collections has been increased to 500. The previous limit of 20 was put in place back in the prototype stage of the service and somehow it survived. We typically recommend 500 as a good number for balancing the needs of consumers while maintaining the performance/load of the server.
    1. The only reason this might be an issue for consumers is if you were requesting a large collection (e.g. Titles), relying on the server-driven paging size of 20, and you’re now being handed 500 titles at once all of a sudden. If that much data is more than you need (or want) at once, then you can just do client-side paging (via $top and $skip) to control the amount of data you get back per request.
  2. The Title type has a new property called ShortSynopsis. As you can imagine, this property is a shortened version of the existing Synopsis property. The other useful thing about ShortSynopsis is that it doesn’t include any HTML (unlike Synopsis) in its contents, so if you’re developing a client UI that doesn’t want to parse HTML content (or can’t, as is the case with SL in-browser), ShortSynopsis is your new solution.
  3. Each delivery format of a Title (Instant, DVD, Blu-Ray) now has its own distinct Rating and Runtime properties (e.g. Dvd/Rating, Instant/Runtime, etc.). This allows each format to differ in their MPAA rating and their overall runtime, which will happen in practice, and so that extra flexibility was needed in the data.
    1. In order to maintain backwards compatibility, and keep the ease-of-use of the data, we wanted to keep the Rating and Runtime properties directly off a Title. Since a title can have multiple formats, and each of those formats can have different ratings and runtimes, we obviously had to decide on which of the three take preference in representing the “canonical” format. Basically, the Title’s “root” Rating and Runtime values will come from the first format that is available, in the following order: Blu-Ray, DVD, Instant. Therefore, if a Title is available in Blu-Ray, it’s Rating property will always be equal to its BluRay/Rating property (the same goes for the runtime). If a Title isn’t available in Blu-Ray but it is in DVD, the DVD values will be used, and so on. If you don’t like this behavior, you can use the individual specific rating and runtime values.

Those of you that are consuming the service from a dynamic language (e.g. JavaScript, Ruby), you should have nothing to worry about here. But, if you’re consuming the service from a static language (e.g. C#, Java), you will most likely need to regenerate your proxy classes. I say “most likely” because every client differs in how it treats missing properties. The .NET client for instance, by default, will throw an exception if the server returns a property that doesn’t exist on the client-side proxy type. You can get around this by setting the DataServiceContext.IgnoreMissingProperties property to true, or just re-generate the proxy.

If you run into any issues, please feel free to reach out. Also, make sure to let us know if you’re doign anything cool with the service as well.

10
Feb

Impact The Planning For EF/Astoria vNext

Now that the VS2010/NETFX4 train is about to grind to a half, the vNext discussions are ramping up for each of the encompassed technologies. Why is this interesting to you? Because it’s the perfect time to start voicing your personal opinions. If you’ve been moaning about a feature that you need, or a behavior that should be improved, you absolutely need to tell us about it. Despite what some believe, Microsoft listens very extensively to customer feedback, the trick though is knowing where to give that feedback.

I get e-mails all the time, and I read tweets every day talking about some change request that a developer would like to see made. Unfortunately, those mediums aren’t the best way for us to be able to rally behind. Don’t get me wrong, we want that communication to happen, and we take those comments into account when doing product planning, but in order to justify new features, it’s very key to have as much support behind it as possible, and this typically can’t come from a bunch of disparate e-mails, tweets, etc.

You don’t need to be BFFs with ScottGu (that certainly won’t hurt) or attend every SDR to have a voice in Microsoft. This was loudly confirmed by ASP.NET MVC, which anyone can tell you was heavily driven by customer comments. The same can be true for the Entity Framework and WCF Data Services in their vNext releases. We just recently published Connect sites for both products and are asking for all the feedback you’ve got. This can come in the form of bugs or suggestions. Both are much appreciated and will be directly taken into account. One of the main reasons using Connect is great is that it allows other people to upvote/downvote your suggestions. This makes it much easier for us to justify working on a specific feature (or not too if you’re the only person in the world that wants something added).

Entity Framework vNext Connect

WCF Data Services vNext Connect

Long story short: go make your suggestions on the Connect sites, otherwise I don’t want to hear you complain a year from now about something we didn’t add :)

17
Nov

Tailspin Travel

logo.pngThis morning, Cameron Skinner presented a demo in Bob Muglia’s keynote at the PDC. The demo focused on some of the most exciting new features coming in Visual Studio 2010, .NET Framework 4, SQL Server 2008 R2, and the new Windows Server AppFabric. We felt that the demo did a great job of highlighting the value of the next wave of Microsoft developer tools and as such we wanted to make sure that it was readily available to everyone.You can now download the Tailspin Travel application from Codeplex (download here). In addition to the feature use cases that were presented in the demo, the released version of Tailspin contains many additional scenarios to help developers see a broader view of possibilities with the respective technologies.

Technologies Covered

The Tailspin Travel application covers a pretty substantial set of functionality, but ultimately seeks to provide a holistic perspective of how Visual Studio 2010, .NET Framework 4, and the server platform can be used together. The following is a list of the exact features that are shown in the application:

Visual Studio 2010
  1. Assembly Dependency Graph
  2. Multi-monitor
  3. Navigate To dialogue
  4. IntelliTrace
  5. New WF designer
  6. MSDeploy
  7. Coded-UI tests
.NET Framework 4
  1. ASP.NET MVC 2
  2. Windows Identity Foundation
  3. Windows Workflow Foundation
  4. Windows Communication Foundation
  5. Entity Framework
Server Platform
  1. Windows Server AppFabric
    1. Service Container
    2. Workflow Container
    3. Monitoring
    4. Cache
  2. SQL Server 2008 R2
    1. DAC

System Requirements

Tailspin was built using Visual Studio 2010 Ultimate, and there are a few features in use in the demo that require that version (e.g. coded-UI tests). If you’re using a different SKU, you’ll still be able to run the solution, but there will be some features you won’t be able to take advantage of.Because we consider the new Windows Server AppFabric a key part to the Tailspin Travel application, we also require that you have it installed. This is what enables the memory-caching, as well as the service/workflow containers, and monitoring support.SQL Server 2008 R2 isn’t a hard requirement, but if you don’t have it installed you won’t be able to deploy the Data-Tier Application (DAC).

Next Steps

We plan on doing at least a couple more iterations on Tailspin Travel. There are a few tweaks we’d like to make, plus I’m confident we’ll get some great feedback from you guys that will help make it even better.

01
Apr

String Input Handling + Quantum Mechanics!

One of my biggest complaints with the .NET Framework is its horrible support (or lack thereof) for handling string input. If you have an application that allows a user to enter arbitrary content, there is no single way to “project” that content into its appropriate data type, without having to write a ton of boilerplate code.

At first glance, you might think this is an easy problem to solve, and in some instances you’d be right, but the devil is most certainly in the details (as in figuring out quantum physics!). If you’re looking to be able to handle an infinite number of different data types, and generically interpret any possible form of input, then you’ve got quite a serious problem on your hands.

Thankfully this problem ends today. In addition to developing the recently released ASP.NET MVC framework, Phil Haack and Eilon Lipton have also been hard at work addressing the global issue of string input handling and quantum entanglement. This afternoon, the first public CTP of the new “String Input Handling Framework” (name pending) has been released. As much as I’d love to go on about how to use it, and how integral it will become in all future .NET development, Eilon has already put together a great blog post on this subject.

All I can say is: with innovative solutions like this under Microsoft’s belt, there is no question just how superior the .NET Framework is to everything else on the market. Move over Ruby, PHP, Python, Java, and everyone else (you know who you are), the .NET train is coming through, and we’ll be accepting any input you’ve got to throw at us!

08
Jul

The Forgotten Delegate…

Last week I was doing some pair programming with Jason Olson and we were looking over a project I’m working on in connection with ASP.NET MVC and custom ControllerActionInvokers (more on this to come). As he was critiquing my code, he pointed out my usage of a Func<T, bool>, asking why I wasn’t using a Predicate<T>, which achieves the exact same thing, without having to redundantly specify the boolean return type (not to mention the semantic value it adds). My response: “Umm, because I forgot about that”.

Apparently when .NET 3.5 was released I fell in such deep love with the Func delegate that I completely gave up on ever using Predicate again, which seems pretty ridiculous. Obviously Func has many more forms than Predicate, and merits lots of usage, but blindly using it for everything would begin to demean its value. Luckily I didn’t forget about my beloved Comparison delegate, so you wouldn’t ever catch me using a Func<T1, T2, int> (where T1 and T2 where the same type) as opposed to a Comparison<T>.

After feeling a little pathetic, low-and-behold I began seeing instances all over the place of people doing the exact same thing I was doing. I’ve since stumbled upon three different open-source projects that have code using Func<T, bool> delegates instead of Predicate<T>. In addition, I remembered that ADO.NET Data Services implement their query interceptors as methods whose return type is Expression<Func<T, bool>>. Apparently I’m not the only person who has fallen victim to the forgotten delegate…

I’m by no means stating that using a Func<T, bool> as opposed to a Predicate<T> is bad or anything, I just found it somewhat interesting that Funcs have permeated code that would have otherwise used another delegate.




September 2010
S M T W T F S
« Jun    
 1234
567891011
12131415161718
19202122232425
2627282930  

Categories