N_Sri
asked on
How interface provides decoupling to the client
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Interface
{
interface Interfface
{
void ADD();
void SUB();
}
//Service Provider
class ServiceProvider : Interfface
{
public void ADD()
{
Console.WriteLine(" I am ADD");
}
public void SUB()
{
Console.WriteLine(" I am Sub");
}
}
class Program
{
// Client
static void Main(string[] args)
{
Interfface Reff = new ServiceProvider();
Reff.ADD();
Reff.SUB();
}
}
}
Here the client is aware of Service Provider and Client he is creating reference to service provider.
There client is aware of service provider.
" I have studied client need not to now the implementation part of service provider. "
But here client knows about service provider and client is also creating reference of it.
So I think client can get the logic of service provider by using Reflection concepts in .NET.
Can you please help me understanding this case.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thankyou
ASKER