Bridge Pattern Code Review

Use the Bridge Pattern

Code Review

Code Walkthrough

The Program class creates an instance of the PrinterPortal class "injecting" the different implementations of the Bridge classes.

class Program { static void Main(string[] args) { PrinterPortal portal;
portal = new PrinterPortal(new PrinterBridge.InkJetPrinter()); Console.WriteLine(String.Format("{0}\n", portal.printOperation())); portal = null;
portal = new PrinterPortal(new PrinterBridge.LaserPrinter()); Console.WriteLine(String.Format("{0}\n", portal.printOperation())); portal = null;
portal = new PrinterPortal(new PrinterBridge.DotMatrixPrinter()); Console.WriteLine(String.Format("{0}\n", portal.printOperation())); portal = null;
Console.Read(); } }