I am working on several projects that connect to external services such as Facebook and Netflix. At the moment, most of the libraries that I use to access these APIs (including the ones I wrote myself) have separate methods, so calling certain API functions still always calls some basic method to execute the request. Something like that:
public class ExternalApi
{
public string SendMessage( criteria )
{
return SendRestRequest( modifiedCriteria );
}
public string GetData( criteria )
{
return SendRestRequest( modifiedCriteria );
}
public string SendRestRequest( modifiedCriteria )
{
var request = new HttpRequest();
}
}
So my question is, is it better to use a template or OO CEO, so in each singular method of calling the API, I will not explicitly call the base method every time?
Am I looking for some kind of call pickup pattern like ASP.NET MVC framework and ActionResults?
1: , Wcf. 1-5% API .