Firstly I'll explain my code in a nutshell
A config file is present which has a list of ID's. In a for loop these ID's are read one at a time and a list of JSON Structures are created. If everything goes well without any exception (e.g. entire data not being present) they are pushed into a database.
Coming to my question... For each ID, there are a bunch of business rules which are being executed. I've coded in such a way that even if any of the expected data is missing or if the business rules fails at any point of time I'm not inserting the data into the DB. The processing for that ID stops there, error message is written to a log file and then proceeding with the next ID. Can this be defined as a Fail Fast Design Patter is my question.
Aucun commentaire:
Enregistrer un commentaire