Skip to content

Commit 44d25b0

Browse files
committed
Added some java examples to behavioral
1 parent 83fe54c commit 44d25b0

File tree

1 file changed

+66
-1
lines changed
  • src/main/java/com/philipjhamilton/patterns/behavioral

1 file changed

+66
-1
lines changed

src/main/java/com/philipjhamilton/patterns/behavioral/behavioral.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,84 @@ Design patters that identify common communication patterns between objects and r
1010
objects and pass the request along the chain until an object handles it.
1111
2. Launch-and-leave requests with a single processing pipeline that contains many possible handlers.
1212
3. An OO linked list with recursive traversal.
13+
14+
#### Examples in the JDK
15+
1. java.util.logging.Logger#log()
16+
2. javax.servlet.Filter#doFilter()
1317

1418
- ### Command
19+
#### Intent
20+
1. Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
21+
22+
#### Examples in the JDK
23+
1. java.lang.Runnable
24+
2. javax.swing.Action
1525
- ### Interpreter
26+
#### Intent
27+
1. Given a language, define a represention for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
28+
#### Examples in the JDK
29+
1. java.util.Patter
30+
2. java.text.Normalizer
31+
3. java.text.Format
32+
4. javax.el.ELResolver
1633
- ### Iterator
34+
#### Intent
35+
1.
36+
#### Examples in the JDK
37+
1. java.util.Iterator - Scanner as well
38+
2. java.util.Enumeration
1739
- ### Mediator
40+
#### Intent
41+
1.
42+
#### Examples in the JDK
43+
1. java.util.Timer
44+
2. java.util.concurrent.Executor#execute()
45+
3. java.util.concurrent.ExecutorService
46+
4. java.util.concurrent.ScheduledExecutorService
47+
5. java.lang.reflect.Method#invoke()
1848
- ### Memento
49+
#### Intent
50+
1.
51+
#### Examples in the JDK
52+
1. java.util.Date
53+
2. java.io.Serializable
54+
3. javax.faces.component.StateHolder
1955
- ### Null Object
56+
#### Intent
57+
1.
2058
- ### Observer
59+
#### Intent
60+
1.
61+
#### Examples in the JDK
62+
1. java.util.Observer/Observable
63+
2. java.util.EventListener
64+
3. javax.servlet.http.HttpSession*Listener
65+
4. javax.faces.event.PhaseListener
2166
- ### State
67+
#### Intent
68+
1.
69+
#### Examples in the JDK
70+
1. javax.faces.lifecycle.LifeCycle#execute()
2271
- ### Strategy
72+
#### Intent
73+
1.
74+
#### Examples in the JDK
75+
1. java.util.Comparator#compare()
76+
2. javax.servlet.http.HttpServlet
2377
- ### Template method
78+
#### Intent
79+
1.
80+
#### Examples in the JDK
81+
1. java.io.InputStream
82+
2. java.io.OutputStream
83+
3. java.io.Reader
84+
4. java.io.Writer
2485
- ### Visitor
25-
86+
#### Intent
87+
1.
88+
#### Examples in the JDK
89+
1. javax.lang.model.element.AnnotationValue(Visitor)
90+
2. javax.lang.model.model.element.Element(Visitor)
2691
## Rules of thumb
2792

2893
1. Behavioral patterns are concerned with the assignment of responsibilities between objects, or, encapsulating behavior in an object and delegating requests to it.

0 commit comments

Comments
 (0)