Hacker News new | past | comments | ask | show | jobs | submit login

   if (strcmp($POST['cardtype'], "mastercard")) {
      $Processor = $PaymentProcessorFactory.InstantiateByType("mastercard");
      $Processor = $PaymentProcessorFactory.InstantiateByType("visa");
   }
   $Processor.process($POST);
Sorry, cannot simulate "real-world" (lame enough) PHP OO code, but you got the idea.)



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: