mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-24 10:25:17 +00:00
docs: balking, bloc, bridge diagrams
This commit is contained in:
+4
-4
@@ -36,6 +36,10 @@ Wikipedia says
|
||||
|
||||
> The bridge pattern is a design pattern used in software engineering that is meant to "decouple an abstraction from its implementation so that the two can vary independently"
|
||||
|
||||
Sequence diagram
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Bridge Pattern in Java
|
||||
|
||||
Imagine you have a weapon that can have various enchantments, and you need to combine different weapons with different enchantments. How would you handle this? Would you create multiple copies of each weapon, each with a different enchantment, or would you create separate enchantments and apply them to the weapon as needed? The Bridge pattern enables you to do the latter.
|
||||
@@ -203,10 +207,6 @@ The hammer is unwielded.
|
||||
The item's glow fades.
|
||||
```
|
||||
|
||||
## Bridge Pattern Class Diagram
|
||||
|
||||

|
||||
|
||||
## When to Use the Bridge Pattern in Java
|
||||
|
||||
Consider using the Bridge pattern when:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Reference in New Issue
Block a user