Hi,
I am working on a WCF based web services project. We have like 50 different services which provide get,create, update and delete operations. My problem is when I find a bug in an operation, let's say in get operation, that is common on all the services, i need to open and replace all the code in all the 50 services. My question is, is there a way to implement one single core code template so any change I made will be used by all services? Basically I am looking something just like master page concept in ASP.NET. Let me give one imaginary example to illustrate my question better;
public string Get(Parameter param)
{
ArrayList myList = new ArrayList();
//some service specific business rules implemented here
return myList.ToString();
}
Let's say that above code are being used by all the services and I want to change my ArrayList object to a List object like this:
public string Get(Parameter param)
{
List<string> myList = new List<string>();
//some service specific business rules implemented here
return myList.ToString();
}
So, right now, I need to change all the services if I want to implement this by opening respective code files in each and every of them and then replacing the code. I am thinking using interfaces, which we already use now, but I cannot think a way to implement interfaces in such a way. If there is, do you have any examples? Or is there any other way around to solve this issue? I appreciate any help in advance. Thanks.