In our application users may upload different type of files in ftp folder. All these files will be CSV files but the format (number of columns, purpose, order of column etc.) could be different. For each type there will be seperate folder. So from folder name we may easily recognise which format is applciable for that file. For each file, we need to read the file (following the format) and validate some records and need to take some specific action against those records. At this moment we have 14 type of files. But in near future it may increase. So for each patter we need three methods -
- Read file and save into database table.
- Validate the file, save error massages (if any).
- Take actions (if it is a valid file).
Which pattern I should use to design this solution and why? Is it Factory method?
Regards, Angshujit
Aucun commentaire:
Enregistrer un commentaire