mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-13 20:14:59 +00:00
docs: add diagrams for lazy loading, leader election, leader followers, lockable object
This commit is contained in:
1 parent
d8b07ac484
commit
72eeb167c5
8 files changed
+16
-8
No files matched your search
@@ -35,6 +35,10 @@ Wikipedia says
|
||||
|
||||
> In distributed computing, leader election is the process of designating a single process as the organizer of some task distributed among several computers (nodes). Before the task has begun, all network nodes are either unaware which node will serve as the "leader" (or coordinator) of the task, or unable to communicate with the current coordinator. After a leader election algorithm has been run, however, each node throughout the network recognizes a particular, unique node as the task leader.
|
||||
|
||||
Sequence diagram
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Leader Election Pattern in Java
|
||||
|
||||
The Leader Election pattern is a design approach that enables a distributed system to select one node as the coordinator or leader to manage tasks and maintain order, while other nodes operate as followers. This pattern is particularly useful in distributed systems where one node needs to act as a central coordinator for a specific function or decision-making process.
|
||||
@@ -137,10 +141,6 @@ The `RingApp` class implements the Ring algorithm for leader election. In this a
|
||||
|
||||
These examples demonstrate how the Leader Election pattern can be implemented in different ways to suit the specific requirements of a distributed system.
|
||||
|
||||
## Detailed Explanation of Leader Election Pattern with Real-World Examples
|
||||
|
||||

|
||||
|
||||
## When to Use the Leader Election Pattern in Java
|
||||
|
||||
Use the Leader Election pattern in Java applications where:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
Reference in new issue
Block a user