// 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; }
public SuperMegaPrinterMachine( IPrinter printer, IScan scanner, IStaple stapler, IFax fax, ICopy copier) { _printer = printer; _scanner = scanner; _stapler = stapler; _fax = fax; _copier = copier; }