Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt authored Jul 16, 2024
1 parent bb8911d commit 50923dd
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# MethodProxies
A library to decorate and control method execution. Such library allows one to proxy any method in the system and its architecture is robust enough to develop powerful propagating method proxies that automatically and lazzily install them without falling in endless loops.


A library to decorate and control method execution. Such library allows one to proxy any method in the system and its architecture is robust enough to develop powerful propagating method proxies that automatically install them without falling in endless loops.


## Examples

A simple counting handler.

```
handler := MpCountingHandler new.
p := MpMethodProxy
onMethod: Object >> #error:
handler: MpCountingHandler new.
onMethod: Object >> #error:
handler: handler.
p install.
p uninstall.
p enableInstrumentation.
1 error: 'foo'.
p count
p uninstall.
handler count.
>>> 1
```

Expand All @@ -28,6 +28,7 @@ p := MpMethodProxy
onMethod: MwClassB >> #methodTwo
handler: MpFailingHandlerMock new.
p install.
p enableInstrumentation.
p uninstall.
MpClassB new methodTwo.
Expand All @@ -54,6 +55,10 @@ p3 := MpMethodProxy
handler: h.
p3 install.
p1 enableInstrumentation.
p2 enableInstrumentation.
p3 enableInstrumentation.
p1 uninstall.
p2 uninstall.
p3 uninstall.
Expand All @@ -71,7 +76,7 @@ The handler design protects you from that by avoiding that you extend and break
testCase := StringTest selector: #testAsCamelCase.
(MpMethodProxy
onMethod: testCase testMethod
handler: MpProfilingMethodHandler new) install.
handler: MpProfilingMethodHandler new) install; enableInstrumentation.
testCase run.
proxies := MpProfilingMethodHandler allInstances.
Expand Down

0 comments on commit 50923dd

Please sign in to comment.