lundi 5 octobre 2015

Suggestion Required : Java Design Pattern to use

I'm looking for a java design pattern which is best suited for the below functionality. I have a series of file creations and persisting the same to the db.
For eg, say I have files A1 and B1. Now, when the job is triggered, , file A1 will be created and saved in a windows path, on successful creation of A1 the data has to be persisted. Only on the successful creation and persistence of file A1, the next step of creation and persisting for file B1 should start. Considering the above situation, please suggest which pattern will fit in right?

Two things in my mind are, Observer Pattern or Event Listeners. Please suggest!

Aucun commentaire:

Enregistrer un commentaire