What might be interesting is to extend this to other actions as well -- creating/updating/deleting/renaming files, sending emails, etc. As you say, anything that can receive the 'begin_work', 'commit' and 'rollback' messages can participate. Making the messages observations (using something like, oh, Class::Observable) would be very flexible as well and you'd get for free object/class/subroutine registration to receive the messages. Just a thought.
I've found the Unit Of Work pattern most helpful with this. Martin Fowler used to have a lengthy description of it on his site but he went and published a book and changed the description to a simple summary. (The book is highly recommended, BTW.)
Chris
M-x auto-bs-mode
In reply to Re: RFC: transactions.pm
by lachoy
in thread RFC: Transactions.pm
by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |