mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-04 16:13:42 +00:00
docs: update monitor & monostate
This commit is contained in:
1 parent
6ff2009f61
commit
a0f90fa75e
2 files changed
-8
No files matched your search
@@ -77,10 +77,6 @@ public class App {
|
||||
|
||||
In this example, we create two instances of `LoadBalancer`: `loadBalancer1` and `loadBalancer2`. They share the same state. When we make a request via `loadBalancer1`, the request is served by the first server. When we make a request via `loadBalancer2`, the request is served by the second server, not the first one, because the `nextServerIndex` has been updated by `loadBalancer1`. This demonstrates the Monostate pattern in action.
|
||||
|
||||
## Class diagram
|
||||
|
||||

|
||||
|
||||
## Applicability
|
||||
|
||||
Use the Monostate pattern when
|
||||
|
||||
Reference in new issue
Block a user