views:

70

answers:

1

We are designing a WCF layer which can be invoked either by a Asp.Net or a WinForm application. Our Application contains too many Entities. We have basically two choices.

  1. If we design WCF Contract around these entities then we get too many Contracts e.g IPartyService, IUserService, IPaymentService etc. So, I may end up with 30-40 Contracts?

  2. One huge contracts with around 100 operations?

What are the pros and cons of each approach or is there a better way?

+3  A: 

The first approach makes the entities more organized. The downside is that you have too many endpoints. Your client needs to initialize multiple service instance to perform a operation (for example: You need to initialize the customer service and the order service to save customer and order details. - But this could be prevented if you implement business process logically on each service\operation).

The second approach is quite overwhelming to the client app developer. The advantage is performance since everything is on a single contract, it will be easier for you to optimize the code and minimize service calls.

Jojo Sardez