I work with WCF 4.0 and have a good understanding of how to create services from a technical point of view. I have been working with WCF for 3 years now.
Despite this, I and others, I have different ideas about what should be the unit of software that makes up the service and what does not. Many people with whom I speak believe that services should be details. Indeed, my previous company spent a lot of time turning some of its Meetings into Services (as I was told).
In many cases, I don’t see how the service is better ... and maybe it doesn’t always have to be. I will give you an example: in our system we have a great service that has really grown to fulfill two different independent tasks. I am going to split it into two services for two reasons: performance and isolation from failure (we are hosted on a Windows service without IIS). The fact is that, despite servicing two independent business processes (one service may not be available without affecting the other), both have a fair chunk of common business logic.
Now they tell me that this common logic should be divided into a third service under the direction of SOA and consumed by two new services. As I see it, this only partially cancels out the benefit of sharing a large service in the first place: we have introduced a performance bottleneck and a single point of failure. If the host process of the third service is reduced, 1 and 2 can no longer do their work. This is happening to us now that we have a “deep” structure of many services. One of them exits, and any dependent services drag out the network timeout, since their calls never answer.
Now, if common logic was just a library, not a service, we get the benefit of code reuse, no bottlenecks, and isolation as each service executes its own copy of the assembly in its own memory. There is also no overhead for serialization.
What do people think about this? Is there a rule, or a general rule, when you need to decide when something should be a service or library? Any other tips?
Thanks michael
source share