OOP&D
July 3rd, 2020So 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:I am TSLA Long. Model 3 Owner. Brother of a Model 3 owner. Son of a Model S owner. I have reservations for Slate Roof and Cybertruck. I am a Tesla speculator and fanboy. I am not a financial advisor. Investing in anything comes with inherent risk. This is not financial advice.
Patreon Support:
I proudly support the following Patreons:
Benefits Include
- Set Climate & Heat Seats from App
- Top Safety
- Lower Fuel Costs
- Mobile Service
- Autopilot
- Dashcam
- Security Monitoring System (Sentry Mode)
- Dog Mode
- Great Handling
- Acceleration
- Great looking cars
- Netflix/Youtube
- Video Games
- CARAOKE
- Enhanced Summon
- Super Charger Network