Microsoft Experts note that CRUD-Style APIs for Web-Services are a bad thing - read why and what to do instead

Microsoft Experts discuss several design decisions regarding Web-Services APIs in a free online Webcast. You can find it at:

MSDN Architecture Webcast: 5/12/2005
Patterns for Service-Oriented Architecture (Level 200)

The most notable point is that Microsoft Experts state that CRUD-Style APIs are a bad thing - which is absolutely true for Web-Services. An API is known to be CRUD-Style, if it offers Create, Read, Update and Delete Actions for all Objects under control of the WebSerive instead of higher level functionality (e.g. performing the order processing for the given order which is sent over as a XML-Document).

Altough generating CRUD-Style APIs for WebServices is easy using code generation, it is not at all helpful. As the WebServiceClient and WebServiceServer will need several round-trips do a complex action when splitting it up into CRUD-Messages. CRUD will make your application both: slow and not scalable! It will not be fast as several round-trips are needed instead of one, and it can also not be scalable as it wastes resoureces on the server.

Did you know that this is the mayor reason why tangible architect does not generate CRUD-Style APIs for WebServices? No? Now you know it - and you even know why.

You should think about higher level, more complex actions when designing your WebService and use the object model's strengths to implement the service.

Happy Coding!

No comments: