mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-05 18:24:34 +00:00
docs: balking, bloc, bridge diagrams
This commit is contained in:
@@ -29,6 +29,10 @@ Wikipedia says
|
||||
|
||||
> The balking pattern is a software design pattern that only executes an action on an object when the object is in a particular state. For example, if an object reads ZIP files and a calling method invokes a get method on the object when the ZIP file is not open, the object would "balk" at the request.
|
||||
|
||||
Flowchart
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Balking Pattern in Java
|
||||
|
||||
This example demonstrates the Balking Pattern in a multithreaded Java application, highlighting state management and concurrency control. The Balking Pattern is exemplified by a washing machine's start button that initiates washing only if the machine is idle. This ensures state management and prevents concurrent issues.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Reference in New Issue
Block a user