Skip to content

Commit 21914f9

Browse files
committed
docs: updated diagrams for tolerant reader and trampoline
1 parent 95bfd6c commit 21914f9

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

tolerant-reader/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ In plain words
3333

3434
> Be conservative in what you do, be liberal in what you accept from others.
3535
36+
Sequence diagram
37+
38+
![Tolerant Reader sequence diagrams](./etc/tolerant-reader-sequence-diagram.png)
39+
3640
## Programmatic Example of Tolerant Reader Pattern in Java
3741

3842
We are persisting `RainbowFish` objects to file. Later on they need to be restored. What makes it problematic is that `RainbowFish` data structure is versioned and evolves over time. New version of `RainbowFish` needs to be able to restore old versions as well.
Loading

trampoline/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Wikipedia says
3636

3737
> In Java, trampoline refers to using reflection to avoid using inner classes, for example in event listeners. The time overhead of a reflection call is traded for the space overhead of an inner class. Trampolines in Java usually involve the creation of a GenericListener to pass events to an outer class.
3838
39+
Flowchart
40+
41+
![Trampoline Pattern Flowchart](./etc/trampoline-flowchart.png)
42+
3943
## Programmatic Example of Trampoline Pattern in Java
4044

4145
Here's the `Trampoline` implementation in Java.
51.4 KB
Loading

0 commit comments

Comments
 (0)