tags:

views:

34

answers:

3

Situation is like this:

There are independent 5 services. Each service consists of a project for interface, implementation and test. Example:

LocalizationService.Interfaces
LocalizationService.Implementation
LocalizationService.Test

There is a WCF service for each of the services:

LocalizationService.WcfContract (including DataContracts)
LocalizationService.WcfHost

The client applications are probably mostly going to use all of the services. Should I combine all service interfaces into a common one?

AllServices.AllInterfaces

In my opinion, this is a bad idea. The services are independent and there is no reason to introduce a dependency. I imagine that especially testing becomes more difficult. However, one may argue that having to include 5 libraries is too much of a hassle.

(I'm not sure how to tag this. Feel free to retag.)

+3  A: 

I personally don't mind that I would have to include 5 libraries. My view is that if your services are completely independent of each other, then they should be in a different lib. Easier to maintain and enhancements can be applied to a single lib service rather than across the board.

If there would be an issue where someone doesn't like having to include 5 libraries, it is easy to explain why. More flexibility in providing enhancements, smaller downloads (if it would be an option), etc. etc. Not to mention that load times will be faster for the libraries.

To OregonGhost's point, I hadn't thought of ILMerge - so here is a link that might be of use: Daniel Cazzulino's Blog : Leveraging ILMerge. I have only heard of ILMerge - and haven't had a chance to use it. Hope that helps a bit.

dboarman
+1. The Don't-like-multiple-libraries problem can be solved by ILmerging the libraries into one for that specific project, yet you can still maintain them as separate libraries.
OregonGhost
+2  A: 

Definately seperate, see: Interface Segregation Principle (ISP) http://en.wikipedia.org/wiki/User:LupusDei108/Interface_Segregation_Principle

Keeping things seperate will make it easier to refactor, etc. For consumers, pulling in something additional(i.e. optional) is usually easier than getting stuck with something you don't want.

You seem to be using the term interface and service as though they are inter-changable, which isn't always the case; if you're talking about "interfaces" ISP will definately apply, and will probably apply for 'services' as well.

The other thing to be aware of is that having all five services provided makes for a larger attack surface. Exposing test code / suites into PROD is seldom a great idea :)

Adrian K
A: 

The way the question is phrased makes me immediately think of the Facade pattern, but I'm not sure about the language you're using above (looks like VB to me) so I don't know how it applies in that domain.

Shaggy Frog