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 901235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:31:30+00:00 2026-05-15T15:31:30+00:00

I am new to Web/WCF/Services – so bear with me :) I am trying

  • 0

I am new to Web/WCF/Services – so bear with me 🙂

I am trying to analyse the code-flow in a .NET application but I have a hard time understanding the reasoning behind using the following approach when it comes to exposing services :

Now, in the application, I have a C# Class Lib Proj which has a C# Class Library project called “XXX.YYY.Services ” within which I have 2 files :

ISomeServiceProviderClass.cs
SomeServiceProviderClass.cs

Within the ISomeServiceProviderClass.cs I have the following structure for code :

 [ServiceContract]
    public interface ISomeServiceProviderClass
    {
        [OperationContract]
        int SomeFunc();
    }

Then there is the
SomeServiceProviderClass.cs class which is defined like so :

public class SomeServiceProviderClass: ISomeServiceProviderClass
{
    public int  SomeFunc()
    {

        /// some code to do the implementation..
    } 
}

This is a sample service structure in my Provider Application. Obviously the Consumer application is using this service to show results in its UI layer.

Now I want to know, what is the need to have the interface called ISomeFile.cs and then SomeFile.cs which implementes this interface ?

I guessed that one of the reasons could be to allow for different types of implementations in each of the class that implements this interface …
If that is the case, then why not have just a SomeServiceClass.cs file within which I have Virtual functions that can be overridden in derived classes ? Or why not have an Abstract class with abstract functions ?

  • 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-15T15:31:31+00:00Added an answer on May 15, 2026 at 3:31 pm

    The clue is in the [ServiceContract] and [OperationContract] attributes in the ISomeServiceProviderClass. These indicate that ISomeSomeServiceProviderClass is defining a WCF Service Contract.

    This contract (ie, the interface) can be implemented by code on the server side to carry out the actual operations, and on the client side it is dynamically implemented by WCF to create a proxy that relays calls across the network to the server.

    You would not want to use an abstract class in this case, because that would restrict the freedom of implementation for the server and client side objects.

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

Sidebar

Related Questions

Im am not new to WCF web services but there has been a couple
Im totally new to WCF. Trying to create a Silverlight application with WCF services.
I have a web site that communicates with a .NET 4 WCF web services.
I have started a new web application and have decided to use jquery as
I'm converting from the WCF Web API to the new ASP.NET MVC 4 Web
I have developed a silverlight application with WCF-RIA services and is working fine. I
I have a Windows Service Application in which i create WCF services in it.
I'm just starting out with WCF web services, and I'm having a really hard
I use ASP.NET and WCF services in a load balanced web server environment, using
I am new to WCF Service. I read that both ASP.NET and WCF Services

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.