Unless I'm missing something, using blocks in Ruby gets around most of this:

Hung Jung Lu wrote:
> class A:
>    def f1():
>        start_timer()
>        try:
>            log()
>            register()
>            ... non-factorizable code specific to f1
>            deregister()
>        except:
>            ...
>        finally:
>            ...
>        end_timer()

Instead of "... non-factorizable code specific to f1", just yield to the 
block given to the function.  Tada!  Or, for a more concrete example:

module HelperMixin
   def helper
     start_timer
     begin
       log
       register
       yield
       deregister
     rescue
       ...
     ensure
       ...
     end
     end_timer
   end
end

class A
   include HelperMixin

   def f1
     helper do
       ... code specific to f1
     end
   end

   def f2
     helper do
       ... code specific to f2
     end
   end
end

Did I miss the point here?

Ben