<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Pablo Castro's blog : Web</title><link>http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx</link><description>Tags: Web</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Adding support for JSONP and URL-controlled format to ADO.NET Data Services</title><link>http://blogs.msdn.com/pablo/archive/2009/02/25/adding-support-for-jsonp-and-url-controlled-format-to-ado-net-data-services.aspx</link><pubDate>Thu, 26 Feb 2009 06:29:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9445482</guid><dc:creator>pabloc</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/pablo/comments/9445482.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=9445482</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/" target="_blank"&gt;JSONP&lt;/a&gt; is a common way of making data accessible in client-side mashups even when the requests need to be cross-domain.&lt;/p&gt;  &lt;p&gt;While the current version of the ADO.NET Data Services framework does not support this, it’s possible to build it on top. There are a couple of ways of doing this. Here is what’s probably the simplest way. There is some downsides to this approach, but overall is the most straightforward path to get there.&lt;/p&gt;  &lt;p&gt;The default transport layer for Data Services is WCF, which has a many extensibility points across the stack. For the case of JSONP support, IDispatchMessageInspector comes in handy.&lt;/p&gt;  &lt;p&gt;There are two things needed to support JSONP properly:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The ability to control the response format. Data Services uses standard HTTP content type negotiation to select what representation of a given resource should be sent to the client (e.g. JSON, Atom). That requires that the caller can set the Accept request header, which is not possible when doing the JSONP trick (which basically just uses &amp;lt;script&amp;gt; tags). We need to add the ability to use the query string in the URL to select format. (e.g. /People(1)/Friends?$orderby=Name&amp;amp;&lt;strong&gt;$format=json&lt;/strong&gt;). &lt;/li&gt;    &lt;li&gt;A new option to wrap the response in a callback if such callback was provided in the request (also in the query string). For example /People(1)/Friends?$orderby=Name&amp;amp;$format=json&amp;amp;&lt;strong&gt;$callback=loaded&lt;/strong&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;What we’ll do is register a message inspector and adjust the request/response when we see these new options coming in.&lt;/p&gt;  &lt;p&gt;In order to support the $format=json option we can intercept the message before it gets dispatched to the Astoria runtime, at the IDispatchMessageInspector.AfterReceivedRequest method. If we see the query string option then we’ll a) strip it out from the URL so Data Services does not generate an error and b) change the “Accept” header to “application/json”, so the rest of the system just thinks that the client asked for a JSON response in the first place.&lt;/p&gt;  &lt;p&gt;For the second part, where we need to wrap the response into a Javascript call if the $callback option was used, we have the IDispatchMessageInspector.BeforeSendReply method which gives us the perfect spot to rewrite the response. One unfortunate side-effect of this is that the response will get buffered and re-encoded; that said, in many cases this won’t make any noticeable difference.&lt;/p&gt;  &lt;p&gt;Finally, we need to register the interceptor with WCF’s dispatchers. For that we create an attribute that implements IServiceBehavior, so we get called during service initialization. When we get called we can register our message interceptor.&lt;/p&gt;  &lt;p&gt;The net effect is that if you include this code in your project, you just need to add a single attribute to your Data Service to make it support JSONP:&lt;/p&gt;  &lt;p&gt;[JSONPSupportBehavior]    &lt;br /&gt;public class SampleService : DataService&amp;lt;ContactsData&amp;gt;     &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; // your service code here...     &lt;br /&gt;} &lt;/p&gt;  &lt;p&gt;Once that's in place you can use JSONP by adding $format and $callback to URLs, for example: &lt;/p&gt;  &lt;p&gt;http://&amp;lt;host&amp;gt;/SampleService.svc/People?$format=json&amp;amp;$callback=cb&lt;/p&gt;  &lt;p&gt;Of course, you can still use all the other Data Services URL options in addition to these.&lt;/p&gt;  &lt;p&gt;The implementation and a small sample service are available at MSDN code gallery, here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://code.msdn.microsoft.com/DataServicesJSONP" href="http://code.msdn.microsoft.com/DataServicesJSONP"&gt;http://code.msdn.microsoft.com/DataServicesJSONP&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;-pablo&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9445482" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/ADO.NET+Data+Services/default.aspx">ADO.NET Data Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/REST/default.aspx">REST</category></item><item><title>Now you know...it's Windows Azure</title><link>http://blogs.msdn.com/pablo/archive/2008/10/28/now-you-know-it-s-windows-azure.aspx</link><pubDate>Wed, 29 Oct 2008 04:02:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9021320</guid><dc:creator>pabloc</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/pablo/comments/9021320.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=9021320</wfw:commentRss><description>&lt;p&gt;Since we shipped ADO.NET Data Services v1 in .NET 3.5 SP1 (and actually before that as well) I've been working on a few things that I could share (such as offline/sync support for data services) and some that I couldn't discuss publicly until all the big plans where announced.&lt;/p&gt;  &lt;p&gt;This week at PDC Microsoft announced &lt;a href="http://www.azure.com" target="_blank"&gt;Windows Azure&lt;/a&gt;. A lot has been written about it, so I won't go into the details.&lt;/p&gt;  &lt;p&gt;On our side, in the data services team, we made our small contribution to the big picture. &lt;/p&gt;  &lt;p&gt;The Windows Azure table service is a structured storage facility that's part of the core part of Azure. Access to the table service is done through a data-services compatible RESTful interface that uses the Astoria conventions over an HTTP binding. That means that you use either any client with an HTTP stack to talk to it, or you can use the ADO.NET Data Services client, which does a nice job exposing data as .NET objects, letting you write simple queries using LINQ instead of URLs, etc.&lt;/p&gt;  &lt;p&gt;Another cool thing about the table service (and the blobs and queuing service for that matter) is that they are accessible both from the virtual compute environment and from anywhere in the Internet. In both cases, if you're using .NET, you can use the data services client to interact with it. In the case of code running in the Windows Azure hosting environment, the client is already present (the environment includes .NET 3.5 SP1) so you can use it without worrying about taking new dependencies.&lt;/p&gt;  &lt;p&gt;You find out more about the table service you can watch &lt;a href="http://channel9.msdn.com/pdc2008/ES04/" target="_blank"&gt;Brad's PDC session&lt;/a&gt; for a discussion of the service itself, and this other &lt;a href="http://channel9.msdn.com/pdc2008/ES07/" target="_blank"&gt;session than Niranjan and I did together&lt;/a&gt; (or &amp;quot;will do&amp;quot; if you're reading this before Wed in the PDC week) for a drill down on how to program the Windows Azure table service. If you're not at PDC no worries, these talks are accessible to online.&lt;/p&gt;  &lt;p&gt;On the next layer up from the core, the Windows Azure service layer, SQL Data Services also is making big announcements in this PDC. We're introducing more relational capabilities into the system, and also experimenting with a data services-compatible interface. &lt;a href="http://channel9.msdn.com/pdc2008/BB14/" target="_blank"&gt;This PDC talk from Patrick&lt;/a&gt; will discuss and demo the new interface, and you can follow how this effort goes &lt;a href="http://sqlserviceslabs.net/SDSAstoria.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;-pablo&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9021320" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Conferences/default.aspx">Conferences</category><category domain="http://blogs.msdn.com/pablo/archive/tags/ADO.NET+Data+Services/default.aspx">ADO.NET Data Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/PDC2008/default.aspx">PDC2008</category></item><item><title>"Data Friction", spot-on</title><link>http://blogs.msdn.com/pablo/archive/2008/02/20/data-friction-spot-on.aspx</link><pubDate>Thu, 21 Feb 2008 03:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7826128</guid><dc:creator>pabloc</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/pablo/comments/7826128.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=7826128</wfw:commentRss><description>&lt;P&gt;Jon Udell wrote &lt;A class="" href="http://blog.jonudell.net/2008/02/20/overcoming-data-friction/" mce_href="http://blog.jonudell.net/2008/02/20/overcoming-data-friction/"&gt;a brief piece on how data is locked on servers&lt;/A&gt; behind UIs that were not designed for data sharing. He views this as "data friction"...it's just the perfect way to describe the problem.&lt;/P&gt;
&lt;P&gt;I couldn't agree more with Jon's take. I would even take it further: an operation-centric approach to interfaces is good for closed systems or systems where semantics are completely centered around behavior; however, the data behind those operations is still somewhat locked-in. Data-centric APIs that expose a uniform interface for clients to consume is how the class of scenarios that Jon talks about will come to life. We can't tell upfront how all those applications&amp;nbsp;out there will use our data, it's just too hard to predict, so a "function centric" interface just won't do. Instead, those systems need put out the data plus a way to interact with it that enforces proper semantics while not getting in the way of how a consumer wants to explore that data.&lt;/P&gt;
&lt;P&gt;We're hoping to help at least a bit in that space with Project Astoria...we'll see how it goes :)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-pablo&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7826128" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/ADO.NET+Data+Services/default.aspx">ADO.NET Data Services</category></item><item><title>We'll host an experimental Astoria data service for you</title><link>http://blogs.msdn.com/pablo/archive/2007/08/03/we-ll-host-an-experimental-astoria-data-service-for-you.aspx</link><pubDate>Sat, 04 Aug 2007 01:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4213536</guid><dc:creator>pabloc</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/pablo/comments/4213536.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=4213536</wfw:commentRss><description>&lt;P&gt;When we announced Project Astoria at Mix 2007 last May we made the toolkit available along with a few samples as an online service. The missing piece there was the ability to create your own service online in the experimental setting we had setup. Now &lt;A class="" href="http://blogs.msdn.com/mflasko/" mce_href="http://blogs.msdn.com/mflasko/"&gt;Mike&lt;/A&gt; has just &lt;A class="" href="http://blogs.msdn.com/astoriateam/archive/2007/08/03/create-your-own-hosted-astoria-data-service.aspx" mce_href="http://blogs.msdn.com/astoriateam/archive/2007/08/03/create-your-own-hosted-astoria-data-service.aspx"&gt;announced&lt;/A&gt; the availability of the new version of the experimental online service that allows you to describe the schema of the data you'd like for your data service, and we'll create and host it for you.&lt;/P&gt;
&lt;P&gt;So go ahead, create your data service and let us know how it works for you. To access the online service you can use HTTP directly or the client library that was included in the May 2007 CTP.&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4213536" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Services/default.aspx">Services</category></item><item><title>Astoria Client for Silverlight Alpha 1.1</title><link>http://blogs.msdn.com/pablo/archive/2007/07/11/astoria-client-for-silverlight-alpha-1-1.aspx</link><pubDate>Thu, 12 Jul 2007 07:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3824866</guid><dc:creator>pabloc</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/pablo/comments/3824866.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=3824866</wfw:commentRss><description>&lt;P&gt;Last May when we shipped &lt;A class="" href="http://astoria.mslivelabs.com/" mce_href="http://astoria.mslivelabs.com"&gt;the first CTP of Microsoft Codename “Astoria”&lt;/A&gt; we included a client library in addition to the components for the server. The original client library can be used from .NET applications in cases where you do not want to develop directly against the HTTP interface, and rather you want to use a higher-level API that works in terms of .NET objects.&lt;/P&gt;
&lt;P&gt;Back then, we were just releasing &lt;A class="" href="http://silverlight.net/" mce_href="http://silverlight.net"&gt;Microsoft Silverlight&lt;/A&gt; Alpha 1.1, which includes support for using the .NET Framework inside Silverlight applications. Unfortunately, timing just didn’t work out well enough for us to include a version of the Astoria client library that could run inside the Silverlight Alpha 1.1 environment, so the only way to access Astoria services from code running in Silverlight was to use HTTP directly.&lt;/P&gt;
&lt;P&gt;Now we have fixed that :)&lt;/P&gt;
&lt;P&gt;Today we made available an add-on for the Astoria May 2007 CTP that consists of a new client library for use in Silverlight applications. You can simply add a reference to Microsoft.Astoria.SilverlightClient.dll to your Silverlight application and use the API just like you would in a regular .NET application. The add-on is available for download here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6d85055e-3549-48fc-8a2b-f678e6786e3a&amp;amp;displayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=6d85055e-3549-48fc-8a2b-f678e6786e3a&amp;amp;displayLang=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In addition to the existing API, we added one small extension. Since most Silverlight applications will run on the web where network latency tends to be high, we included asynchronous query execution support, so that you don’t block the UI thread when waiting for an Astoria server to respond.&lt;/P&gt;
&lt;P&gt;Porting to Silverlight was painless for the most part. Mainly just another build script. We only needed a few additional #ifdef’s for one or two specific things that either weren’t present or behaved slightly different in the Silverlight libraries. It took a little longer than planned to release,&amp;nbsp; since at the same time we have been heads down building Astoria to ship as soon as possible, not really because porting it to Silverlight was difficult. :)&lt;/P&gt;
&lt;P&gt;If you are interested in Silverlight + Astoria go ahead, download the CTP add-on and give it a shot. If you build something cool with it, please let us know!&lt;/P&gt;
&lt;P&gt;-pablo&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3824866" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Podcast interview with Jon Udell</title><link>http://blogs.msdn.com/pablo/archive/2007/07/03/podcast-interview-with-jon-udell.aspx</link><pubDate>Tue, 03 Jul 2007 21:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3674138</guid><dc:creator>pabloc</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/pablo/comments/3674138.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=3674138</wfw:commentRss><description>&lt;P&gt;Last week I had a great conversation with &lt;A class="" href="http://blog.jonudell.net/" target=_blank mce_href="http://blog.jonudell.net"&gt;Jon Udell&lt;/A&gt; about &lt;A class="" href="http://astoria.mslivelabs.com/" target=_blank mce_href="http://astoria.mslivelabs.com"&gt;Astoria&lt;/A&gt;. Jon is a great interviewer and he knows how to explore a topic in his own style, so you get to hear about Astoria from a different perspective, without having to listen to my "standard pitch" again :)&lt;/P&gt;
&lt;P&gt;The interview is posted in &lt;A class="" href="http://blog.jonudell.net/2007/07/03/a-conversation-with-pablo-castro-about-astorias-restful-data-services/" mce_href="http://blog.jonudell.net/2007/07/03/a-conversation-with-pablo-castro-about-astorias-restful-data-services/"&gt;Jon's blog&lt;/A&gt; and in &lt;A class="" href="http://channel9.msdn.com/showpost.aspx?postid=321735" mce_href="http://channel9.msdn.com/showpost.aspx?postid=321735"&gt;Channel 9&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If there was anything that came up on the interview that you'd like to know more about, please go ahead and post them here and I'll be happy to comment.&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3674138" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category></item><item><title>Security in data services</title><link>http://blogs.msdn.com/pablo/archive/2007/05/21/security-in-data-services.aspx</link><pubDate>Tue, 22 May 2007 05:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2780337</guid><dc:creator>pabloc</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/pablo/comments/2780337.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=2780337</wfw:commentRss><description>&lt;P&gt;We still have more questions than answers on what is the appropriate security story for data services. The May CTP of Astoria had some ideas built into it, but it was clearly not enough to build real-world applications. There is quite a bit that needs to be explored in this space.&lt;/P&gt;
&lt;P&gt;I wanted to take a few paragraphs to make a few problem statements and describe the way we see the problem. I’d be curious to hear what application scenarios you have and how they may affect the security-related requirements for a data service.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Authentication&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;When running as part of an ASP.NET application, Astoria data services just pick up whatever authentication scheme the application is using. All that matters from the Astoria perspective is that once the client-agent has been authenticated the current principal is properly set; Astoria will just use that principal later on during authorization.&lt;/P&gt;
&lt;P&gt;For the online service version things are trickier. There are at least two different players here: the creator/owner of the application or web site, and the user that logs in, the viewer/owner of the data. One trivial approach would be to hand out a set of credentials to the creator of the application, and they could use that to log into the data service. However, there are two big issues with that:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;That works well if the access to the data service happens from the server side, but what if you want to access the service from the client? You'd have to send the credentials to the client so that the code sitting on the client can log-in, probably not a good idea.&lt;/LI&gt;
&lt;LI&gt;Even if you could protect the credentials, is that the right thing to do? The end-user is probably the owner of the data in the end, so it may not make sense to use the application creator’s credentials for accessing it.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Another approach that addresses these issues would be to say that the end-user has to authenticate against the data service separately from the application or web site. This way, the user owns the data and can secure it. This seems more natural, but has the issue of requiring the user to authenticate twice (with the application and with the data service).&lt;/P&gt;
&lt;P&gt;You could take this further and have some sort of secure token service that all parties trust; then users could authenticate once and the client code could present the tokens as needed for both the application and the data service.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Authorization&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The key question from the authorization perspective when it comes to data services is, in my opinion, what is the right granularity.&lt;/P&gt;
&lt;P&gt;We are thinking of doing the usual principal/role-based authorization, but the thing is what is authorized.&lt;/P&gt;
&lt;P&gt;In the May CTP of Astoria the story is super simple, and it wasn't really so you could build real applications, but more to get developers thinking whether that was the pattern that we should grow into a full-blown one or we needed to start from scratch. In that release the unit of authorization was a whole entity-set (e.g. "Customers"); you could say whether you could act on the entity-set if you are anonymous and if you are authenticated. "Act" means whether you can even see it, and separately whether you can write to it.&lt;/P&gt;
&lt;P&gt;Moving forward we could extend that so that it is not just whether the client is authenticated, but you can also say which principals/roles are allowed. However, that may still not be flexible enough. Beyond that, I could imagine a couple of options:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Predicate-based authorization, where each principal/role can be bound to a given filter predicate for each entity-set, and you get to see/modify only those entities that match the criteria given by the predicate.&lt;/LI&gt;
&lt;LI&gt;Instance-based (row-level) security. This is nice to have, but very tricky to implement if you want the system to scale arbitrarily (say "internet scale"). &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Maybe there are other strategies for authorization, in particular to describe the units of authorization so that they are useful for building actual applications.&lt;/P&gt;
&lt;P&gt;As I said above, more questions than answers in this space for now. I'll keep posting as we make progress on the design in this area.&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2780337" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category></item><item><title>Astoria in Channel9</title><link>http://blogs.msdn.com/pablo/archive/2007/05/07/astoria-discussion-in-channel9.aspx</link><pubDate>Tue, 08 May 2007 06:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2473698</guid><dc:creator>pabloc</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/pablo/comments/2473698.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=2473698</wfw:commentRss><description>&lt;P&gt;Charles from &lt;A class="" href="http://channel9.msdn.com/" target=_blank mce_href="http://channel9.msdn.com"&gt;Channel9&lt;/A&gt; came by my office a week or two ago and recorded this video where we discussed the motivations, target scenarios and some of the interface details of Astoria.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://channel9.msdn.com/showpost.aspx?postid=305985"&gt;http://channel9.msdn.com/showpost.aspx?postid=305985&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2473698" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category></item><item><title>Application models for Astoria</title><link>http://blogs.msdn.com/pablo/archive/2007/05/04/application-models-for-astoria.aspx</link><pubDate>Sat, 05 May 2007 02:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2416996</guid><dc:creator>pabloc</dc:creator><slash:comments>19</slash:comments><comments>http://blogs.msdn.com/pablo/comments/2416996.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=2416996</wfw:commentRss><description>&lt;P&gt;When you combine technologies such as Silverlight or AJAX-style applications with Astoria there is an opportunity for building great interactive data-driven applications. However, this combination also results in a new ways of organizing the various pieces that make up the application, so the question on what is the right application architecture comes up.&lt;/P&gt;
&lt;P&gt;I’ll tackle the question from the middle-tier/data service perspective, and how the interaction with the presentation tier works. I won’t touch on aspects related to building and managing the user-interface elements of the presentation tier.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;One extreme: the "pure data" model&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;There is a class of applications that are just about data, with relatively or no semantics on top of it; or more likely, where semantics is deeply embedded into the data and doesn’t need a layer of behavior on top to surface or enforce it. &lt;/P&gt;
&lt;P&gt;For those applications you can imagine pointing the Astoria service to the database, prepare a nice EDM schema that models types and associations appropriately, and leave the URI space open so client agents can freely use any part of it. This is great when the high-order bit is to share data with people or systems. The data in the store is readily available and with easy access; many tools can deal with HTTP and URIs; Astoria-aware tools and widgets can even make it trivial to display and manipulate data. &lt;/P&gt;
&lt;P&gt;You would still setup policies for authorization and such, of course, but I see that as somewhat orthogonal to the semantics/behaviors that may go with the data. From the authorization perspective you would say who can read, who can write, when do you need to be authenticated to even see something and so on. It does happen often that some security aspects are derived from semantics (e.g. "my customers" implies that some components knows how to find customers that are assigned to me, and that is typically captured as data as well), in which case the "pure data" approach won't work in that particular scenario. &lt;/P&gt;
&lt;P&gt;I’m not sure if there is a lot of applications that fall in this category, but I'm pretty sure its &amp;gt; 0.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The other extreme: the "pure RPC" model&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Elaborate applications, such as those designed to support the operations of businesses out there, need more than "just data" pretty much always, at least for large portions of the data they operate on.&lt;/P&gt;
&lt;P&gt;A way of approaching an application with these requirements is to build the core business logic on top of the data, and then provide an interface or façade that clients and other applications can consume. This is nothing new, and has evolved in what is currently called Service Oriented Architecture or SOA.&lt;/P&gt;
&lt;P&gt;One of the key aspects of SOA is that contracts are clearly defined, and they are described in terms of operations; of course that the data used by those operations needs to be described as well, but the focus is on operations.&lt;/P&gt;
&lt;P&gt;I think that there is a space where this is the right way of creating apps. It does introduce a bit of complexity, but you get in return the ability to build composite applications based on the metadata that describes individual components.&lt;/P&gt;
&lt;P&gt;We (Microsoft) have a solid offering in this space through the Microsoft Windows Communication Foundation (WCF) stack. WCF handles the runtime and design-time aspects of this, supports various services and related technologies, and it even plays well with both the SOAP and the HTTP-only (should I say REST?) ways of doing things.&lt;/P&gt;
&lt;P&gt;The main drawback of this approach, though, is that it's very hard to build generic frameworks/UI components on top. For example, if you had a "grid" widget, how would the widget be able to do paging and sorting (when the user clicks on a column heading) independently of the service operation being called? I am assuming, of course, that bringing all the data to the client and perform the operation there is not an option (as is the case in any reasonable sized data-set). I think there is an opportunity there.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A hybrid approach&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Now that we went through the extremes, let me describe a hybrid approach that looks really promising in my opinion.&lt;/P&gt;
&lt;P&gt;Typically in business applications you can find a mix when it comes to the data they consume and its requirements for business logic and enforcement of semantics on top of the raw data. I think that often in these applications you can find a part of the data that is still "plain", that doesn't need added business rules, it is just what it is; you also find the other part that does need business logic on top to make sense, or to say consistent, or both. &lt;/P&gt;
&lt;P&gt;The relative sizes of the "pure data" and "data + behavior" parts depends on the nature of the application. I would expect, for example, that a public web site that is designed to share information will lean towards the "pure data" side, where as an internal business application would go the other way.&lt;/P&gt;
&lt;P&gt;As I discussed in the &lt;A class="" href="http://astoria.mslivelabs.com/Overview.doc" target=_blank mce_href="http://astoria.mslivelabs.com/Overview.doc"&gt;Astoria Overview document&lt;/A&gt;, one of the key elements of the Astoria services is the use of a uniform URI format regardless of the particular data service you're hitting. This enables tools and frameworks to be built so that they leverage that. &lt;/P&gt;
&lt;P&gt;These applications could be built by using two Astoria elements: flat access and "data aware" service operations. &lt;/P&gt;
&lt;P&gt;For the parts of the data that are "just data", you could enable direct access to the data through regular Astoria URIs. This helps with development productivity, allows developers to use common widgets and libraries and reduces how much redundant code you write and maintain.&lt;/P&gt;
&lt;P&gt;For the parts of the data that need business logic, you create the special form of WCF service operation that Astoria introduces support for, where you don't just return the final data that you want. Instead, you return "query objects" that represent the data you'd like to return. Since what is returned is a non-executed-yet query, the Astoria runtime can still compose query operations on top, such as sorting and paging, and then executing it in order to obtain the data to be sent to the client.&lt;/P&gt;
&lt;P&gt;Let me use a brief example to illustrate this point. If you have a service operation that returns Customer entities for a given city, you would use a URI like this one to invoke it:&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;http://host/vdir/northwind.svc/CustomersByCity?city=London&lt;/P&gt;
&lt;P&gt;Now, if this is a data aware service operation, the URI options that UI controls and such use to do their work would still work, so when the user clicks on the “CompanyName” column to sort it, the UI control could simply say:&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;http://host/vdir/northwind.svc/CustomersByCity?city=London&amp;amp;$orderby=CompanyName&lt;/P&gt;
&lt;P&gt;in similar ways, using control arguments such as $skip and $top, the grid widget could support paging over any arbitrary data aware operation.&lt;/P&gt;
&lt;P&gt;This offers a great middle-ground between plain open access to the store through URIs and fixed RPCs that do not support query composition. The service operation is still written as code in the middle tier that is controlled by the developer; that code can perform validations on arguments, adjust arguments based on the user or the context, inject predicates to queries based on various conditions and so on. In other words, they are the spot where you can invoke your business logic.&lt;/P&gt;
&lt;P&gt;I focused on data retrieval so far. The hybrid approach can be used for updates as well. In those cases where it makes sense to allow direct updates to the data you can let the standard HTTP POST/PUT/DELETE operations do its work; for the other cases, where you do not want just an update but a more complex operation that may result in one or more updates, you can use a service operation.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A complementary tool: interceptors&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;A broad subset of the cases where you want custom business logic during updates, the requirement is to be able to perform validation that goes beyond the declarative validation that can be enforced by constraints in the EDM model or in the underlying database schema.&lt;/P&gt;
&lt;P&gt;For those cases you can still use regular HTTP-style updates with POST/PUT/DELETE verbs, and register code to run in the server whenever an entity is being created, updated or deleted. In Astoria you can define an "interceptor" and bind it to a given entity-set and a direction (reading or writing); the interceptor is a regular .NET method defined in the service class that runs in the middle-tier (where the Astoria service runs). This method can do pretty much anything it wants (Astoria won't limit what it can do, although the runtime environment may). Astoria will even provide an already-established session to the database wrapped in an ADO.NET typed object context to provide easy access to the database in case you need to perform lookups in order to validate the operation.&lt;/P&gt;
&lt;P&gt;BTW - if anybody can think of a better name than "interceptors", it'll be happy to take it :)&lt;/P&gt;
&lt;P&gt;For more details and an example of this you can take a look at the "Intercepting Entities on Retrieval and Update" section of the &lt;A class="" href="http://astoria.mslivelabs.com/UsingMicrosoftCodenameAstoria.doc" target=_blank mce_href="http://astoria.mslivelabs.com/UsingMicrosoftCodenameAstoria.doc"&gt;Using Astoria document&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Summary&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;So, summing it up, I think that there is a good middle-ground between flat open access to data and pure RPC. I think that this middle-ground can enable frameworks and tools to help more and make it easier to build applications.&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2416996" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category></item><item><title>Astoria FAQ from MIX</title><link>http://blogs.msdn.com/pablo/archive/2007/05/03/astoria-faq-from-mix.aspx</link><pubDate>Thu, 03 May 2007 22:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2398781</guid><dc:creator>pabloc</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/pablo/comments/2398781.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=2398781</wfw:commentRss><description>&lt;P&gt;We announced Microsoft Codename Astoria at Mix this week, and we did two sessions on the technology during the event. This was great because we got a chance to talk 1:1 with a lot of folks that were interested in the topic. We also got a ton of feedback online through blogs and emails.&lt;/P&gt;
&lt;P&gt;Here are some of the most common questions we got since we announced Astoria. Again, this is a very early release, so not all is nice and baked and fully designed yet. Also, there are some topics that need some in-depth discussions, and I’ll tackle those separately in future posts in the next few days. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Can Astoria expose data from data sources other than databases?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Astoria is built on top of the Entity Framework. Currently the EFx only works on top of databases (or things that have ADO.NET providers and look at lot like databases), so Astoria has this restriction as well for its default data services. Astoria also has ability to expose service operations (which are just WCF service operations); those can gather data from anywhere (we won't look at the code inside the operation implementation) but you don't get the nice automatic URI mapping for entities and relationships, and you don't get automatic create/modify/delete support.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How tightly integrated is Astoria to SQL Server?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It is not. I do have an emotional attachment with SQL Server as I worked (still do) in the product for several years :), but Astoria hasn't really anything specific to SQL Server. As I mentioned in the previous answer, Astoria builds on top of the ADO.NET Entity Framework, so if you have an up-to-date ADO.NET provider for your database you should be able to use Astoria with it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This looks really similar to SQLXML. What is the relationship between the two technologies?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;They way I see it, these are very similar technologies that are designed to tackle quite different scenarios. The goal of SQLXML was to provide an XML view on top of a SQL Server database, preserving many (all?) aspects of the XML data model. The goal of Astoria is to provide a service for data that can be web facing and AJAX/RIA applications can use as their back-end.&lt;/P&gt;
&lt;P&gt;This difference in goals surfaces in many forms. For example, SQLXML used XPath for queries, where in Astoria we’ve specifically stayed away from it. SQLXML was, well…about XML, where as Astoria is about data services and formats come second (Astoria currently does XML, RDF+XML and JSON, and I was given some great ideas for new formats at Mix). As a last example, Astoria has several mechanisms built-in for introducing business logic in the data service, so it results in a web-facing entry point that client agents can interact with without compromising the integrity of the application.&lt;/P&gt;
&lt;P&gt;On a more practical note, I work in what would be the current form of the team that created SQLXML among other things. I regularly talk with the folks that built it, such as Andy Conrad and Michael Rys. We'll "reuse" as many good ideas as we can, and we’ll avoid things that didn’t turn out that well.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The documents say "semantics" all over the place, but not "semantic web", is there any relationship between Astoria and the semantic web?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The "semantic web" is a broad space of specifications, technologies and concepts. The goals of the semantic web are far-reaching. &lt;/P&gt;
&lt;P&gt;Astoria does heavily rely on understanding more semantics on the data it handles than a flat "blob store". In Astoria we get semantics off of the Entity Data Model schema that a given data service uses. However, Astoria doesn’t not currently tackle all of the elements that would be required to say that it’s a tool to directly support semantic web constructs.&lt;/P&gt;
&lt;P&gt;It does have some pieces though. The fact that everything is pointed at by a URI and looks like a resource is an important building block. The fact that it supports RDF+XML, with entities modeled as sets of triplets and associations modeled as resources, is also another step there.&lt;/P&gt;
&lt;P&gt;Now, there are things such as not supporting RDF Schema or OWL ontologies that will quickly come up when you look at this with a semantic web perspective. You could imagine generating ontologies based on the EDM schema information (we have information about types, inheritance, associations, etc.). Astoria also does not support SPARQL or any other RDF query language. &lt;/P&gt;
&lt;P&gt;Bottom line: I do think Astoria brings a small little contribution to the goal of adding semantics to the web, but it’s not a full on semantic web tool. Whether it will evolve into something closer to it or not it’s something that time will tell, and user feedback will influence.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What is the security model for Astoria?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I’m putting this here for completeness, but let me defer the answer to a future post. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;No business logic? Data directly exposed? How do you architect applications on top of Astoria?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Same as above. I’ll do a write up soon.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;If you have more questions feel free to send them, I'll do another round of FAQs once I get a few more together.&lt;/P&gt;
&lt;P mce_keep="true"&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2398781" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/MIX07/default.aspx">MIX07</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category></item><item><title>Codename "Astoria": Data Services for the Web</title><link>http://blogs.msdn.com/pablo/archive/2007/04/30/codename-astoria-data-services-for-the-web.aspx</link><pubDate>Mon, 30 Apr 2007 20:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2341873</guid><dc:creator>pabloc</dc:creator><slash:comments>37</slash:comments><comments>http://blogs.msdn.com/pablo/comments/2341873.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=2341873</wfw:commentRss><description>&lt;P&gt;The "data programmability" team at Microsoft is responsible for the various technologies developers use in applications to access and manipulate data. One of the topics we have been looking at lately is how "new" internet applications use data in the web environment. Project codename "Astoria" reflects our current thinking on the topic. Instead of telling "what we are going to build", we decided to make the bits and infrastructure public for the development community to look at and give us feedback.&lt;/P&gt;
&lt;P&gt;Today we are making a very early experimental release of Project Codename "Astoria". This Community Tech Preview (CTP) release has a dual nature; we are shipping both CTP bits you can download, install and run on your own systems; we are also making available an experimental online service that we hope will help better understand the requirements and use cases of data interfaces in the web.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;So, what does it do?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Astoria exposes "data services" that enable applications to access and manipulate data over regular HTTP connections, using URIs to identify pieces of information within the data service, and simple payload formats such as XML and JSON to represent the data exchanged between the client and the server.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What is it useful for?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;There are a number of scenarios that we think are interesting for this technology. Most of the scenarios are related to the way new web applications are built.&lt;/P&gt;
&lt;P&gt;If you look at AJAX-based web applications, one interesting aspect of the way they are delivered to the client is that typically the presentation and client-side behavior is delivered on the initial hit to a given web page, and then the code in that page (typically Javascript) turns back and fetches data as the user interacts with the user interface. This brings a strong separation between presentation and data. What is more, this means that now we require a server-side piece that the javascript code can "talk to". Of course, you can always roll you own server-side entry points for data access; however, not only that is expensive but also it greatly reduces the chances to build tooling and user-interface controls that can work generically on any data access entry point into the server.&lt;/P&gt;
&lt;P&gt;This separation is even stronger in rich internet applications built on technologies such as Silverlight and Flash. The code that is delivered to the client when a user hits the web application is pre-compiled and it contains no data at all other than any hardcoded information. Again, these applications talk back to their servers to retrieve data, manipulate it and push changes back into the service for storage.&lt;/P&gt;
&lt;P&gt;Astoria data services are designed to address this space. They present data in a uniform way that can be consumed by any client that can connect over HTTP and parse XML or JSON. The uniform URI and payload format patterns mean that user-interface widgets can be built so they work against any particular shape of data (“schema” if you will) that is exposed through the service.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Where is it?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The main site is here: &lt;A href="http://astoria.mslivelabs.com/"&gt;http://astoria.mslivelabs.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://astoria.mslivelabs.com/Overview.doc" target=_blank mce_href="http://astoria.mslivelabs.com/Overview.doc"&gt;This document&lt;/A&gt; introduces the concepts and motivations for Astoria.&lt;/P&gt;
&lt;P&gt;You can also see and interact with several sample data-sets that are already available on the experimental online service. Click on the "Online Service" link in the link bar.&lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking forward to hearing your feedback.&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2341873" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/MIX07/default.aspx">MIX07</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category></item></channel></rss>