Skip to content

Commit 2aaf712

Browse files
committed
docs: object pool and observer diagrams
1 parent 6bae409 commit 2aaf712

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

object-pool/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ Wikipedia says
3535

3636
> The object pool pattern is a software creational design pattern that uses a set of initialized objects kept ready to use – a "pool" – rather than allocating and destroying them on demand.
3737
38+
Sequence diagram
39+
40+
![Object Pool sequence diagram](./etc/object-pool-sequence-diagram.png)
41+
3842
## Programmatic Example of Object Pool Pattern in Java
3943

4044
In our war game we need to use oliphaunts, massive and mythic beasts, but the problem is that they are extremely expensive to create. The solution is to create a pool of them, track which ones are in-use, and instead of disposing them re-use the instances.
Loading

observer/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Wikipedia says
3333

3434
> The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.
3535
36+
Sequence diagram
37+
38+
![Observer sequence diagram](./etc/observer-sequence-diagram.png)
39+
3640
## Programmatic Example of Observer Pattern in Java
3741

3842
In a land far away live the races of hobbits and orcs. Both of them are mostly outdoors, so they closely follow the weather changes. One could say that they are constantly observing the weather.
44.9 KB
Loading

0 commit comments

Comments
 (0)