language agnostic - Are fail-fast and fail-safe exception handling principles incompatible? -


i'd understand better fail-fast , fail-safe.

what seems me @ first glance fail-fast means want make system fail when unexpected thing happens. mean exemple if factory can't create instance of object, fail-fast principle, don't want factory return null, or empty object, or partially initialized object could, chance, used correctly application -> time have unexpected behaviour, or unexpected exception raised @ level wouldn't permit know real matter in factory. principle means?

fail safe principle quite hard understand me. common exemple in java collections, iterators , concurrent access. it's said collection/iterator permits modifying list while iterating on called fail-safe. it's done iterating on copy of initial list. in exemple don't understand system fails... , while it's fail-safe... failure? iterate on copy or not, depending on our needs... don't see match wiki definition of fail-safe...

thus in such articles like: http://www.certpal.com/blogs/2009/09/iterators-fail-fast-vs-fail-safe/ opposite fail-fast fail-safe... don't catch why call fail-safe iteration on copy...

i found exemple here: http://tutorials.jenkov.com/java-exception-handling/fail-safe-exception-handling.html seems lot more related initial definition of fail-safe principle. think of fail-safe when system fails, must ensure failure handler doesn't fail or, if does, ensure real initial problem not hidden failure of handler. in given exemple handler right near initial failure code, it's not case. fail-safe means me more handle correctly errors happen in failure handlers or that...

thus me these 2 principles doesn't seem incompatible. think? can't system fail fast & safely???

it better avoid failure in first place (fail safe), if not possible, best fail fast (to fail possible).

the 2 not opposites, complementary.

as - code fail safe possible, isn't, want fail fast.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -