Exposing services in WCF ?

Guys,

I started to learn WCF and i would like to know if Am i in right way.

I have app done in Delphi using MVC. If i  put all my business layer in SERVICE on WCF will be   many services ( about 40 ). It is  correct to expose a bunch of business like this or expose ONE Service that will contain properties type of my business ?

Tks Guys.
MortarelloAsked:
Who is Participating?
 
Kiran SonawaneProject LeadCommented:
WCF service gives you both ability. You can expose single WCF service with multiple endpoints. Better way to have single endpoint with different type of your business objects.
0
 
MortarelloAuthor Commented:
Hi Sonawanekiran,

I was thinking that, otherwise on my client side i could have bunch of references of my services ( bad practice ).

Thank you very much !!!!
0
 
jagrut_patelCommented:
I think single service will clutter the contract definition with unrelated operations.

I will recommend to think about grouping your business layer functionality in terms of business domain rather than in terms of classes. e.g. Combine all business functionality related to Purchase department in a service contract IPurchase.
You can think of some other way of logically grouping the business layer functionality into set of services. Overall idea is to reduce the number of exposed services as well as keep only related operations in a contract definition.

0
 
Kiran SonawaneProject LeadCommented:
I think single service will clutter the contract definition>>
Disadvantage of this is,
1) Client need to remember which contract has which definition
2) At the time of versioning
0
 
MortarelloAuthor Commented:
Thanks for sonawanekiran and  jagrut_patel.

I'm going to use de idea of both of you.

I will separate the endpoints in domains and 1 RepositoryAddressEndPoint

This RepositoryAddressEndPoint will have a list of another guys. On my client side first goes to RootEndpoint and retrieve information about another.

I think this is a good idea for small number of clients.

:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.