loB=createobject([Bindtest]) loCIA=createobject([SpyAgency]) loCIA.watch(m.loB) *-- fire the method of interest loB.method1([foo],1) *===================================== define class BindTest as Relation *===================================== function method1( tcParam1, tnParam2 ) debugout [method1 daring do here] *-- try a little recursion if m.tnParam2<3 this.method1(tcParam1,tnParam2+1) endif enddefine *===================================== define class SpyAgency as custom *===================================== add object oSpys as collection function watch( toObject ) local loSpy, laMembers(1), lnMembers loSpy = createobject( [spook] ) *[[ consider data-driven include/exclude lists here lnMembers = amembers(laMembers,m.toObject,1) for lnK = 1 to m.lnMembers *[[need to think about member objects here too *[[ maybe we could just hook a reference to toObject on loSpy here? if laMembers(m.lnK,2) $ "Event, Method" bindevent(toObject,laMembers(m.lnK,1),loSpy,[start]) bindevent(toObject,laMembers(m.lnK,1),loSpy,[end],1) endif endfor this.oSpys.add( m.loSpy ) endfunc enddefine *===================================== define class Spook as Relation *===================================== function start( p1,p2,p3,p4,p5,p6,p7,p8,p9 ) local laStack(1), lnDepth, laEvents(1) lnDepth = astackinfo( laStack ) aevents( laevents, this ) debugout [start: ]+laevents(1,2).class+[::]+getwordnum(laStack(m.lnDepth-1,6),2,[.(]) function end( p1,p2,p3,p4,p5,p6,p7,p8,p9 ) local laStack(1), lnDepth, laEvents(1) lnDepth = astackinfo( laStack ) aevents( laevents, this ) debugout [end: ]+laevents(1,2).class+[::]+getwordnum(laStack(m.lnDepth-1,6),2,[.(]) enddefineWhich returns: