|
1 | | ---- # this is so called 'Yaml Front Matter', read up on it here: http://jekyllrb.com/docs/frontmatter/ |
2 | | -layout: pattern # layout must allways be pattern |
3 | | -title: Best Pattern Ever # the properly formatted title |
4 | | -folder: best-pattern-ever # the folder name in which this pattern lies |
5 | | -permalink: /patterns/best-pattern-ever/ # the permalink to the pattern, to keep this uniform please stick to /patterns/FOLDER/ |
6 | | - |
7 | | -# both categories and tags are Yaml Lists |
8 | | -# you can either just pick one or write a list with '-'s |
9 | | -# usable categories and tags are listed here: https://github.com/iluwatar/java-design-patterns/blob/gh-pages/_config.yml |
10 | | -categories: creational # categories of the pattern |
11 | | -tags: # tags of the pattern |
12 | | - - best |
13 | | - - ever |
14 | | - - awesome |
15 | 1 | --- |
| 2 | +layout: pattern |
| 3 | +title: Delegation |
| 4 | +folder: delegation |
| 5 | +permalink: /patterns/delegation/ |
| 6 | +categories: Behavioral |
| 7 | +tags: |
| 8 | + - Java |
| 9 | + - Difficulty-Beginner |
| 10 | +--- |
| 11 | + |
| 12 | +**Also known as:** Proxy Chains |
16 | 13 |
|
17 | | -**Intent:** Makes your code awesome |
| 14 | +**Intent:** It is a technique where an object expresses certain behavior to the outside but in |
| 15 | +reality delegates responsibility for implementing that behaviour to an associated object. |
18 | 16 |
|
19 | | - |
| 17 | + |
20 | 18 |
|
21 | | -**Applicability:** Use the Best Pattern Ever pattern when |
| 19 | +**Applicability:** Use the Delegate pattern in order to achieve the following |
22 | 20 |
|
23 | | -* you want to be the best |
24 | | -* you need to ... |
| 21 | +* Reduce the coupling of methods to their class |
| 22 | +* Components that behave identically, but realize that this situation can change in the future. |
25 | 23 |
|
26 | | -**Real world examples:** |
| 24 | +**Credits** |
27 | 25 |
|
28 | | -* [Nowhere](http://no.where.com) |
| 26 | +* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) |
0 commit comments