What makes DbDataProvider not RESTful?

I have heard some people comment that the default controller / provider for Entity Framework data in the new ASP.NET WebAPI (DbDataController) is not strictly a REST-based service, but more like RPC-style service delivery. I understand that the WebAPI framework allows you to create any kind of HTTP, REST or otherwise services, but can someone explain to me specifically what it is about a service exposed by DbDataController that makes it not a true REST service?

+3


source to share


1 answer


The REST architectural style describes the following six constraints that apply to the architecture, while leaving the implementation of separate components that can be developed:

client-server

A single interface separates clients from servers. This separation means that, for example, clients are not tied to the data store, which remains internal to each server, so the portability of the client code is improved. Servers are not associated with user interface or user state so that servers can be simpler and more scalable. Servers and clients can also be replaced and developed independently if the interface between them does not change.

Stateless

Communication between client and server is further constrained by no client context that is stored on the server between requests. Each request from any client contains all the information necessary to service the request, and any session state is stored in the client. The server can be discreet; this limitation simply requires the server state to be url-referenced as a resource. This not only makes the servers more visible for monitoring, but also makes them more reliable in handling partial network failures, as well as further strengthening their scalability.

Cacheable

As with the World Wide Web, clients can cache responses. Responses should therefore, implicitly or explicitly, identify themselves as cacheable or not, to prevent clients from reusing stale or inappropriate data in response to further requests. Well-managed caching eliminates some or all of some client-server interactions, further improving scalability and performance.

Multilevel system



The client usually cannot determine if it is connected directly to the destination server or an intermediary along the way. Mediation servers can improve system scalability by enabling load balancing and by providing shared caches. They can also enforce security policies.

Code on demand (optional)

Servers can temporarily extend or customize client functionality by passing in executable code. Examples of this would include compiled components such as Java applets and client-side scripts such as JavaScript.

Uniform interface

A single interface between clients and servers, discussed below, simplifies and decouples an architecture that allows each part to evolve on its own. The four guiding principles of this interface are detailed below.

http://en.wikipedia.org/wiki/Representational_state_transfer#Constraints

"The only optional restriction of the REST architecture is code on demand. If a service violates any other restriction, it cannot be strictly considered RESTful. The DbDataController class exposes Entity Framework models as HTTP services. These services have a lot of overlap with WCF. Data services such as like CRUD support, metadata and request batching. They even partially mimic the OData query string format. But these services are RPC-style, they are not RESTful, and they do not use OData. " Qoute from this site:

WCF Data Services and ASP.NET Web API

+4


source







All Articles