Hi how do we implement interface in a real time scenario??
This is my situation
I have made an interface IPayPal which has 2 methods
void SaleTransaction();
void VoidTransaction();
now i have a class PayPal which implements this service.
class PayPal:IPayPal{
public void SaleTransaction(){
// Implementation happens here
}
public void VoidTransaction(){
// Implementation happens here
}
}
now i have a service that requests the services from PayPal
lets say
class Service{
IPayPal pp=null;
static void Main(){
pp=new PayPal();
//Now i do not want to expose all the methods in my class PayPal
// is there any other way to just show pp.SaleOneTransaction() method?? i donot want the //PayPal class to be present in this Program..
//Please tell me how to acheive this.
}
}
i.e Please tell me a way in which i can initialise my interface class without revealing the class that implements the interface.
Thanks
I would suggest:
good luck!