Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6065595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:24:29+00:00 2026-05-23T09:24:29+00:00

Could I please get some clarification on a complex WCF service that exposes my

  • 0

Could I please get some clarification on a complex WCF service that exposes my business objects. Let’s say I have 4 objects: contact, organisation, project and letter.

Is the best way to create my service:

  1. Make 4 contracts as ‘service objects’ and pass the object and the intended operation as values/parameters in the ‘service object’? or
  2. Create contracts for all of the objects and their functions (which could be many)?

Many Thanks,

Chris

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:24:29+00:00Added an answer on May 23, 2026 at 9:24 am

    According to the Interface Segregation Principle, you might want to think about splitting those things up.

    One typical approach is to have one interface (e.g. one “service”) per object type – e.g. one interface for Contact with all the operations needed and useful for contacts, etc.

    Of course, you might also have methods that deal with multiple different types of objects – those are a bit tricky to place in a specific service contract.

    Also, with WCF, you can easily have a single service implementation class that then in turn implements multiple of those interfaces at once – e.g. to use common code or common patterns.

    But I guess it would be a good idea to rethink your service contract and convert it into smaller, more manageable chunks.

    Update:

    if your service implementation class implements four service contracts, then you’d have to configure it like this:

    <services>
      <service name="YourNamespace.YourServiceImplementation">
         <host>
            <baseAddresses>
                <add baseAddress="http://YourServer/MyServices/" />
            </baseAddresses>
         </host>
         <endpoint name="Contact"
             address="Contact"
             binding="basicHttpBinding"
             contract="YourNamespace.IContactService" />
         <endpoint name="Letter"
             address="Letter"
             binding="basicHttpBinding"
             contract="YourNamespace.ILetterService" />
         <endpoint name="Organisation"
             address="Organisation"
             binding="basicHttpBinding"
             contract="YourNamespace.IOrganisationService" />
         <endpoint name="Project"
             address="Project"
             binding="basicHttpBinding"
             contract="YourNamespace.IProjectService" />
         <endpoint name="mex"
             address="mex"
             binding="mexHttpBinding" 
             contract="IMetadataExchange" />
      </service>
    </services>
    

    Now, each of your services is available at a specific endpoint:

    • your IContractService is reachable at http://YourServer/MyServices/Contact
    • your ILetterService is reachable at http://YourServer/MyServices/Letter

    and so on….

    For each of those addresses, you can now add service references from a client – add only those you really need. One app might need only a single of those services, another might need two or three etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could somebody please help me get Clang up and running? (I don't have 3.2)
hoping to get some help here. I have locations on a database that I
Could I get some help creating this query please? Users book product video slots
Could I get some advice with an authentication/authorisation design please? It's for a car
I have an issue that I get some some response as a String. This
Could I please get some help with coverting some PHP code to jQuery/JavaScript? What
Could I get some opinions on this MySQL table structure please? Is the amount
Could you please help me to get image upload working on a view with
Could someone please help explain why I can't get this to work? I properly
Could someone please demystify interfaces for me or point me to some good examples?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.