locked
Target of Astoria RRS feed

  • Question

  •  

    Hi

    I have a doubt about the target of Astoria in the Microsoft puzzle. If WFC allows developer exposes .NET methods as services with REST style interface. Why Astoria?

    Huge thanks

    Javier

     

    Monday, December 3, 2007 2:50 PM

Answers

  • Hi Javier,

     

    Good question.  One way to look at Astoria is as a technology build on top of the core REST infrastructure provided by WCF.  A few of the benefits one gets from Astoria in this scenario are: 

     

    1) Uniform interface: By selecting a single data model (entities and associations in Astoria's case) one can define a fixed mapping between the data model and the URI space + HTTP actions used by REST services.  This mapping creates a "uniform interface" such that how you interact with each service (regardless of the data being exposed or who created the service) is the same, thus enabling the consumer to focus on integrating the service into their application.  This point is helped by the fact that once the interface is well known code reuse is now possible in that one can write a client library, reusable UI widget, etc that is applicable to any Astoria-based data service.  For example, one client experience we will be providing is LINQ-to-Astoria.  Basically you can write a LINQ query on the client side that gets translated to URIs + HTTP actions internally by the library allowing the developer a strongly typed query experience. This type of client experience is only widely applicable when a uniform interface exists on the service side. 

     

    All that said, it is important to note that Astoria doesn't invent anything to come up with such an interface.  Instead we aim to make the interface as simple as possible such that any HTTP client can consume it by applying typical URI semantics and leveraging standard HTTP constructs.

     

    2) Model-based service contract: In typical service approaches the service contract is defined by the developer by writing a number of methods.  For rich data models with many entities and relationships, defining such a model in code which exposes the wide range of ways the model needs to be accessed as well as additional operations such as server side sorting & paging can become quite a large task which may involve significant maintenance.  Astoria increases developer efficiency for data oriented services by allowing the developer to declaratively define the contract for the service via a data model/schema.  That is, given a data model Astoria builds the service endpoints (supporting paging, ordering, association traversal, etc) for you based on that model.

     

     

    Monday, December 3, 2007 5:03 PM