Exposing services in WCF ?

Posted on 2011-10-11
Last Modified: 2012-06-21

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.
Question by:Mortarello
    LVL 17

    Accepted Solution

    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.

    Author Comment

    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 !!!!
    LVL 8

    Expert Comment

    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.

    LVL 17

    Expert Comment

    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

    Author Comment

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
    Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now