Bridge Pattern Code Review
Define the Portal Object
Code Review
- Bridge Pattern: Define the Pattern Interface and Handler Objects
- Bridge Pattern: Define the Portal Object
- Bridge Pattern: Use the Bridge Pattern
Code Walkthrough
The PrinterPortal class (object) represents the abstraction component.
class PrinterPortal
{
private PrinterBridge.IPrinter printer;
public PrinterPortal(PrinterBridge.IPrinter bridge) { printer = bridge; }
public string printOperation() { return printer.printTestPage(); } }
public PrinterPortal(PrinterBridge.IPrinter bridge) { printer = bridge; }
public string printOperation() { return printer.printTestPage(); } }
The dependent Bridge class is "injected" into the class constructor.
Printer Friendly Version
Add to Favourites
DotNet Kicks
Digg
del.icio.us
Live Favourites
ma.gnolia
reddit
Slashdot
Technorati
Yahoo!