Skip to content

Commit c5de9f6

Browse files
committed
docs: update delegation
1 parent 1c478a5 commit c5de9f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

delegation/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Real-world example
2323

2424
> In a restaurant, the head chef delegates tasks to sous-chefs: one manages grilling, another handles salads, and a third is in charge of desserts. Each sous-chef specializes in their area, allowing the head chef to focus on overall kitchen management. This mirrors the Delegation design pattern, where a main object delegates specific tasks to helper objects, each expert in their domain.
2525
26+
In plain words
27+
28+
> Delegation is a design pattern where an object passes on a task to a helper object.
29+
2630
Wikipedia says
2731

2832
> 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.

0 commit comments

Comments
 (0)