July 3rd, 2020

So I had this problem. I need to get 17++ variations of CSV files for price/inventory updates.

Perfect place to make a parent class with most of the common functionality and child classes where each child overrides functions:

  • loadCSVFile() //uniquely fetches inventory/price file from FTP, Email Attachment, SFTP, HTTP, etc.
  • updateProducts() //parses files specific fields, nomalize the data and store it

Parent class saves everything to the db once data is normalized.

Outcome:

Very good.

Posted In:

ABOUT THE AUTHOR:
Software Developer always striving to be better. Learn from others' mistakes, learn by doing, fail fast, maximize productivity, and really think hard about good defaults. Computer developers have the power to add an entire infinite dimension with a single Int (or maybe BigInt). The least we can do with that power is be creative.