I've written a few posts about WCF lately... mostly about how to batch WCF service calls. In case you didn't know, i consider batching support a MUST-HAVE feature. Since then, my WCF services all extend the following interface:
[ServiceContract]
public interface IService : IDisposable
{
/// <summary>
/// Processes each request within the same service call
/// </summary>
/// <param name="requests">each request</param>
/// <returns>the corresponding responses</returns>
[OperationContract]
[ServiceKnownType("GetKnownTypes", typeof(KnownTypeProvider))]
Response[] Process(params Request[] requests);
}
I wanted to keep providing specific service methods for each kind of request, but each service implementation would delegate the handling of the requests to the Process method, which in turn would delegate the handling of the request to a specific request handler type which was associated with the request type. So basically, all of these specific service contracts which extend this service don't really offer me anything extra.
So now i'm wondering why i'm even bothering with the specific services anymore... it only leads to more work: more service interfaces and more proxies and in the end, everything is routed to the Process method. So what's the point of these specific services anymore if you don't have batching support out of the box? If i have to go with a generic Process method to get batching support (again, which i consider a MUST-HAVE feature), why am i even bothering with Services at all? Essentially, i'm using a service bus with WCF. Why shouldn't i just move to NServiceBus which is actally perfectly suited for this kind of work?
For the record, i'm not trying to flame or anything... i really want to get some answers to the following question: why shouldn't i drop WCF and the whole service layer thing in favor of a real service bus and Messaging in general?
Pingback: Blue Onion Software - Onion Peels Blog - Friday Links #8