mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-13 20:14:59 +00:00
docs: add diagrams for decorator, delegation, dependency injection, dirty flag, domain model, double buffer, double-checked locking, double dispatch, and dynamic proxy
This commit is contained in:
1 parent
203548ec03
commit
30d13083ae
18 files changed
+36
-12
No files matched your search
@@ -33,6 +33,10 @@ Wikipedia says
|
||||
|
||||
> In object-oriented programming, delegation refers to evaluating a member (property or method) of one object (the receiver) in the context of another original object (the sender). Delegation can be done explicitly, by passing the sending object to the receiving object, which can be done in any object-oriented language; or implicitly, by the member lookup rules of the language, which requires language support for the feature.
|
||||
|
||||
Sequence diagram
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Delegation Pattern in Java
|
||||
|
||||
Let's consider a printing example.
|
||||
@@ -114,10 +118,6 @@ Canon Printer:hello world
|
||||
Epson Printer:hello world
|
||||
```
|
||||
|
||||
## Detailed Explanation of Delegation Pattern with Real-World Examples
|
||||
|
||||

|
||||
|
||||
## When to Use the Delegation Pattern in Java
|
||||
|
||||
* When you want to pass responsibility from one class to another without inheritance.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
Reference in new issue
Block a user