예제 #1
0
 // Notice how the dependencies are injected through constructor (constructor dependency injection)
 public Machine(IPrinter printer, IFax fax, IScan scan, IPhotoCopy photocopy, IStaple staple)
 {
     this.Printer   = printer;
     this.Faxer     = fax;
     this.Scanner   = scan;
     this.Photocopy = photocopy;
     this.Stapler   = staple;
 }
예제 #2
0
 public SuperMegaPrinterMachine(
     IPrinter printer,
     IScan scanner,
     IStaple stapler,
     IFax fax,
     ICopy copier)
 {
     _printer = printer;
     _scanner = scanner;
     _stapler = stapler;
     _fax     = fax;
     _copier  = copier;
 }
예제 #3
0
 public SuperMegaPrinterMachine(
     IPrinter printer,
     IScan scanner,
     IStaple stapler,
     IFax fax,
     ICopy copier)
 {
     _printer = printer;
     _scanner = scanner;
     _stapler = stapler;
     _fax = fax;
     _copier = copier;
 }