mercredi 20 juillet 2016

Which design pattern to use for Step wise object update

I have to write a logic that would update an Object through a series of methods and would detect what step has failed :

EntryPointForLogic() {
    Object obj = CreateObject();

    UpdateObj1(obj);
    UpdateObj2(obj);
    ....
    UpdateObj_(obj);
}

Is there a preferred / standard design pattern for writing similar logic. The different steps could fail and I want to detect which one of them failed.

Aucun commentaire:

Enregistrer un commentaire