
What
is the need for Bridge
|
class sampleAbstraction
{
protected sampleImplementation impObj;
public sampleImplementation ImpObj {
set { impObj = value;}
}
public virtual void sampleMethod() {
impObj.sampleMethod();
}
}
class sampleImplementation {
public virtual void sampleMethod() {
Console.WriteLine(Executing sampleMethod of sampleImplementation);
}
}
class derivedAbstraction : sampleAbstraction {
public override void sampleMethod() {
impObj.sampleMethod();
}
}
public class testClass {
public static void Main() {
abstractionPart absObj = new derivedAbstraction();
absObj.ImpObj = new sampleImplementation();
absObj.sampleMethod();
}
}
_______________________________________________________________________
FREE Subscription
Subscribe
to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.
Note
: We never rent, trade, or sell my email lists to
anyone.
We assure that your privacy is respected
and protected.
Visit .NET Programming Tutorial Homepage
______________________________________________________