We have a large project that has nearly 20 modules on it. We want to use WCF for the business layer.

We have thought of three ways to implement WCF our project:

  1. Use only one datacontract and one operation contract. Send ClassName, MethodName to operation and create class by reflection then invoke the method in WCF side.
  2. Put all the modules in one wcf application, and create their data contracts, operation contracts.
  3. Create a seperate wcf application for each module and host them seperatly.

We use web services because, we need call business layer in java and c#.

Which one is the best way? I need your ideas.

  • 1
    -1: We want to use WCF for the business layer. Please tell us why you think that WCF is a good fit for your application. For instance, why is a DLL project insufficient? – Jim G. Nov 23 '12 at 16:45

Assuming that the 20 modules are not completely unrelated, the second way is the normal approach.

Ideally, you would like calling your services via WCF to feel very similar to calling methods in a DLL. That's the whole point of the WCF (and going back to earlier days, webservice) client proxies.

The first idea - using one contract and sending the class name and method name - is just horrible.

The third idea is just more work for no apparent reason, unless the 20 modules are so unrelated that it makes no sense for them to be in a single application.

  1. Don't, It will be a mess.
  2. If you need all modules everytime do it.
  3. On my side I have several services serving different usecase domain. I want them to be injected in my app through an abstract interface so our app can use local implementation, wcf distant implementation or anyother transport. It looks like this:

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.